Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 11-05-2004, 16:53   #1 (permalink)
Blitzuser
 
Registriert seit: Feb 2004
Beiträge: 468
Ueber As ne box oeffnen und zentrieren,

Hallo habe ne Buehne von 750*500
darauf ein MC in ner groesse von 690*420
jetzt soll er sich oeffnen und in die mitte stellenueber folgenden AS:
ActionScript:
  1. //SET VARIABLES
  2. boxspeed = "5"; //SPEED OF THE BOX MOVEMENT
  3. boxstartx = "373.8";
  4. boxstarty = "248.2";
  5. boxstartw = "690";
  6. boxstarth = "420";
  7.  
  8.  
  9. //BOX START
  10. box.onLoad = function() {
  11. setProperty("", _x, boxstartx);
  12. setProperty("", _y, boxstarty);
  13. setProperty("", _width, boxstartw);
  14. setProperty("", _height, "1");
  15. boxy = boxstarty;
  16. boxx = boxstartx;
  17. boxw = boxstartw;
  18. boxh = boxstarth;
  19. };
  20.  
  21. box.onEnterFrame = function() {
  22. _width += (boxw-_width)/boxspeed;
  23. _height += (boxh-_height)/boxspeed;
  24. _y += (boxy-_y)/boxspeed;
  25. _x += (boxx-_x)/boxspeed;
  26. trace(boxy);
  27. };

er oeffnet sich er traced mir boxy auf 248.2
aber die box ist nicht zentriert, die obere linke kante ist zentriert.....


WIESO?

Danke
nxfxcom ist offline   Mit Zitat antworten
Alt 11-05-2004, 17:18   #2 (permalink)
Gib her, ich mach das!
 
Registriert seit: Jul 2003
Ort: Karlsruhe/Kassel
Beiträge: 270
ActionScript:
  1. box.onLoad = function() {
  2.         this._x = boxstartx;
  3.         this._y = boxstarty;
  4.         this._width = boxstartw;
  5.         this._height = 1;
  6.         boxy = boxstarty;
  7.         boxx = boxstartx;
  8.         boxw = boxstartw;
  9.         boxh = boxstarth;
  10. };
Sollte es tun.
Du hast in der setProperty einfach keinen Zielmovieclip angegeben ("").
Außerdem ist setProperty veraltet.
Dr.Atom ist offline   Mit Zitat antworten
Alt 11-05-2004, 17:19   #3 (permalink)
Neuer User
 
Benutzerbild von :: RK ::
 
Registriert seit: Jan 2002
Ort: Umgebung Stuttgart
Beiträge: 5.412
hi,

wieso setzt du die oberen Zahlen in "" ??? So denkt Flash, dass
das Strings sind und keine Zahlen, also raus damit.

und da wir ja in MX sind, mach ma das ganze gleich MX gerecht
ActionScript:
  1. //SET VARIABLES
  2. boxspeed = 5; //SPEED OF THE BOX MOVEMENT
  3. boxstartx = 373.8;
  4. boxstarty = 248.2;
  5. boxstartw = 690;
  6. boxstarth = 420;
  7.  
  8.  
  9. //BOX START
  10. box.onLoad = function() {
  11.         this._x = boxstartx
  12.         this._y = boxstarty;
  13.         this._width = boxstartw;
  14.         this._height = 1;
  15.         boxy = boxstarty;
  16.         boxx = boxstartx;
  17.         boxw = boxstartw;
  18.         boxh = boxstarth;
  19. };
  20.  
  21. box.onEnterFrame = function() {
  22.         this._width += (boxw-this._width)/boxspeed;
  23.         this._height += (boxh-this._height)/boxspeed;
  24.         this._y += (boxy-this._y)/boxspeed;
  25.         this._x += (boxx-this._x)/boxspeed;
  26.         trace(boxy);
  27. };

versuchsch des mal so
__________________
Das Glück im Leben hängt von den guten Gedanken ab, die man hat.

Easing_Equations / Flash Kontaktformular / FlashPlugin W3C konform / Nützliche Beiträge zu FAQs
:: RK :: ist offline   Mit Zitat antworten
Alt 11-05-2004, 17:21   #4 (permalink)
Blitzuser
 
Registriert seit: Feb 2004
Beiträge: 468
Es klappt danke sehr....
muss mich noch auf MX einstellen..

DANKSCHOEN
nxfxcom ist offline   Mit Zitat antworten
Alt 11-05-2004, 17:22   #5 (permalink)
Neuer User
 
Benutzerbild von :: RK ::
 
Registriert seit: Jan 2002
Ort: Umgebung Stuttgart
Beiträge: 5.412
np
__________________
Das Glück im Leben hängt von den guten Gedanken ab, die man hat.

Easing_Equations / Flash Kontaktformular / FlashPlugin W3C konform / Nützliche Beiträge zu FAQs
:: RK :: ist offline   Mit Zitat antworten
Alt 11-05-2004, 17:31   #6 (permalink)
Gib her, ich mach das!
 
Registriert seit: Jul 2003
Ort: Karlsruhe/Kassel
Beiträge: 270
hab ich doch gern gemacht
Dr.Atom ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 07:48 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele