Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 10-04-2005, 16:00   #1 (permalink)
Neuer User
 
Benutzerbild von alexpetri
 
Registriert seit: Sep 2001
Ort: FrankfurtMain, Sondershausen
Beiträge: 710
onEnterFrame extrem langsam?

Hallo!
ich habe ein swf in dem eine einfache Contentbox schwebt.
dieses sollte sich immer im swf zentrieren
(habe die ganze Stage noscale geschichte eingebaut)
jetzt ist es so das ich eigentlich wenn ich die fenstergröße verändere
die Contentbox langsam nachziehen lasse (dazu benutze ich die penner easing equations - ist aber erstmal unwichtig)
hier erstmal mein Code:
ActionScript:
  1. Stage.align = "TL";
  2. Stage.scaleMode = "noScale";
  3. m = new Object();
  4. kacheln(28, 28, "kachel");
  5. m.onResize = function() {
  6.     tiefe = kacheln(28, 28, "kachel");
  7.     newx = Math.ceil((Stage.width/2)-(contentBox._width/2));
  8.     newy = Math.ceil(Stage.height/2-contentBox._height/2);
  9.     delete _root.contentBox.onEnterFrame;
  10.     contentBox.onEnterFrame = moveContent(newx, newy, this._x, this._y, 50);
  11. };
  12. Stage.addListener(m);
  13. stop();
  14.  
  15.  
  16. MovieClip.prototype.moveContent = function(newx, newy, aktx, akty, duration) {
  17.     if (t == undefined) {
  18.         t = 0;
  19.         trace(t);
  20.     }
  21.     if (t<duration) {
  22.         trace(t);
  23.         t++;
  24.         //this._x = Math.easeInBack(t++, aktx, newx, duration);
  25.         //this._y = Math.easeOutBack(t++, akty, newy, duration);
  26.     } else {
  27.         trace("fertich getweent!");
  28.         delete this.onEnterFrame;
  29.     }
  30. };
wie man sieht habe ich die easign eq. fkt mal ausgeklammert..d.h. meit denen hab ich erstmal kein Problem...
was aber seltsam ist, ist das die onEnterFrame Funktion extrem langsam dahinkleckert...
hat jemand eine Ahnung was da schif laufen könnte?
__________________
Talk to the hand, cause the head aint listening
alexpetri ist offline   Mit Zitat antworten
Alt 10-04-2005, 16:14   #2 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Was issn das???
ActionScript:
  1. contentBox.onEnterFrame = moveContent(newx, newy, this._x, this._y, 50);

ActionScript:
  1. contentBox.onEnterFrame = function() {
  2. moveContent(newx, newy, this._x, this._y, 50);
  3. };
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 10-04-2005, 17:46   #3 (permalink)
Neuer User
 
Benutzerbild von alexpetri
 
Registriert seit: Sep 2001
Ort: FrankfurtMain, Sondershausen
Beiträge: 710
mhh nagut...
kann ja nicht jeder gleich wissen

aber wo ist eigentlich das Problem bei meiner lösung
ich dachte er kopiert in dem moment einfach meine Funktion in onEnterFrame rein..
__________________
Talk to the hand, cause the head aint listening
alexpetri ist offline   Mit Zitat antworten
Alt 10-04-2005, 17:53   #4 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Nicht wirklich. Habe die funktion auch nicht ganz gerafft bzw. glaube ich nicht, dass das fuktioniert. Stelle mir das eher so vor:
ActionScript:
  1. contentBox.moveContent(newx, newy, this._x, this._y, 50);

ActionScript:
  1. MovieClip.prototype.moveContent = function(newx, newy, aktx, akty, duration) {
  2.     this.onEnterFrame = function() {
  3.         if (t == undefined) {
  4.             t = 0;
  5.             trace(t);
  6.         }
  7.         if (t<duration) {
  8.             trace(t);
  9.             t++;
  10.             //this._x = Math.easeInBack(t++, aktx, newx, duration);
  11.             //this._y = Math.easeOutBack(t++, akty, newy, duration);
  12.         } else {
  13.             trace("fertich getweent!");
  14.             delete this.onEnterFrame;
  15.         }
  16.     };
  17. };

...aber nur ne Vermutung. Kann's ja nicht testen.
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager 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 23:17 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele