Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 20-09-2005, 07:44   #1 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
interruptus bei functions & setIntervals

aloha!

habe mehrere funktionen eines "intros";
in diesen habe ich setIntervals(alle "_global" indiziert);
folgendermaßen versuche ich, das intro während der ausführung zu killen, um etwaige böse überaschungen im nächsten frame zu erleben, und um onEnterFrames zu killen(performance);

funkt das so?
wie kann ich testen(debugger?---> wo?), ob noch relikte des intros herumschwirren?


die funktionen
ActionScript:
  1. MC_wokloader.MC_smoke._alpha = 7;
  2. MC_wokloader._alpha = 0;
  3. function smoke() {
  4.     MC_wokloader.MC_parentName.setMask(MC_wokloader.MC_mask);
  5.     for (i=1; i<10; i++) {
  6.         _root.MC_wokloader.MC_parentName["MC_name_"+i].wert = .2;
  7.         _root.MC_wokloader.MC_parentName["MC_name_"+i]._alpha = 0;
  8.         _root.MC_wokloader.MC_parentName["MC_name_"+i].onEnterFrame = function() {
  9.             //trace(_root.MC_wokloader.MC_parentName.MC_name_1._y);
  10.             this._y -= 1.3;
  11.             this._y<=-100 ? this._alpha += 3.5 : 0;
  12.             this._x += this.wert;
  13.             this._x>=5 ? this.wert=-.2 : 0;
  14.             this._x<=-5 ? this.wert=.2 : 0;
  15.             if (_root.MC_wokloader.MC_parentName.MC_name_9._y<=-125) {
  16.                 delete this.onEnterFrame;
  17.             }
  18.         };
  19.     }
  20.     _global.exploding = setInterval(explode, 7500);
  21. }
  22. //smoke();
  23. //+++++++++++++++++EXPLODE+++++++++++++++++++++++++++++
  24. function explode() {
  25.     clearInterval(_global.exploding);
  26.     for (i=1; i<10; i++) {
  27.         var zahlArray = ["1", "-1"];
  28.         _root.MC_wokloader.MC_parentName["MC_name_"+i].randomerX = random(2);
  29.         _root.MC_wokloader.MC_parentName["MC_name_"+i].randomerY = random(2);
  30.         _root.MC_wokloader.MC_parentName["MC_name_"+i].randomZahlX = zahlArray[_root.MC_wokloader.MC_parentName["MC_name_"+i].randomerX];
  31.         _root.MC_wokloader.MC_parentName["MC_name_"+i].randomZahlY = zahlArray[_root.MC_wokloader.MC_parentName["MC_name_"+i].randomerY];
  32.         _root.MC_wokloader.MC_parentName["MC_name_"+i].onEnterFrame = function() {
  33.             this._x += 10*this.randomZahlX;
  34.             this._y += 5*this.randomZahlY;
  35.             this._alpha -= 5;
  36.             if (this._x>=600 || this._x<=-600) {
  37.                 delete this.onEnterFrame;
  38.                 this._parent._parent.onEnterFrame = function() {
  39.                     this._alpha -= 5;
  40.                     if (this._alpha<=0) {
  41.                         _global.weiter = setInterval(function () {
  42.                             clearInterval(_global.weiter);
  43.                             _root.gotoAndStop(3);
  44.                         }, 1000);
  45.                     }
  46.                 };
  47.             }
  48.         };
  49.     }
  50. }
  51. //+++++++++++++++++++++++++++PRELOADER+++++++++++++++++++
  52. MovieClip.prototype.preload = function() {
  53.     var prozent = 0;
  54.     this.balken._xscale = prozent;
  55.     this.T_prozent.autoSize = "LEFT";
  56.     this.T_laden.autoSize = "LEFT";
  57.     this.T_noch.autoSize = "RIGHT";
  58.     this.onEnterFrame = function() {
  59.         var totalBytes = _root.getBytesTotal();
  60.         var loadedBytes = _root.getBytesLoaded();
  61.         prozent = Math.round(loadedBytes*100/totalBytes);
  62.         if (prozent<100) {
  63.             this.T_laden.text = "Webseite wird geladen, wir bitten um etwas Geduld ...";
  64.             this.T_prozent.text = prozent+"% geladen";
  65.             this.balken._xscale = prozent;
  66.         } else {
  67.             this.T_laden.text = "Webseite komplett geladen!";
  68.             this.T_prozent.text = "100 %";
  69.             this.balken._xscale = 100;
  70.             _global.iv = setInterval(function () {
  71.                 _root.MC_preloader.T_laden.text = "";
  72.                 _root.MC_preloader.T_prozent.text = "";
  73.                 _root.MC_preloader.onEnterFrame = function() {
  74.                     this._alpha -= 5;
  75.                     if (this._alpha<=0) {
  76.                         delete this.onEnterFrame;
  77.                         _root.MC_wokloader._alpha = 100;
  78.                         smoke();
  79.                     }
  80.                 };
  81.                 // _root.nextFrame();
  82.                 clearInterval(_global.iv);
  83.             }, 1000);
  84.             delete this.onEnterFrame;
  85.         }
  86.     };
  87. };

skip:
ActionScript:
  1. //+++++++++++++++++++++++++++++SKIP+++++++++++++++++++++++++++++++++
  2. MC_cover._alpha = 0;
  3. MC_preloader.preload();
  4. _root.MC_skip.onRelease = function() {
  5.     clearInterval(_global.iv);
  6.     clearInterval(_global.weiter);
  7.     clearInterval(_global.exploding);
  8.     _root.MC_cover.onEnterFrame = function() {
  9.         this._alpha += 3;
  10.         if (this._alpha>=100) {
  11.             delete this.onEnterFrame;
  12.             _root.gotoAndStop(3);
  13.         }
  14.     };
  15. };
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 20-09-2005, 15:03   #2 (permalink)
voidboy
 
Benutzerbild von rendner[i]
 
Registriert seit: Sep 2004
Ort: München
Beiträge: 5.588
Einfach in jedem onEnterFrame und in den Funktionen die im Intervall aufgerufen werden ein trace einbauen.

Wenn dann alles gekillt wurde dürfte ja nix mehr vom trace ankommen.
__________________
ERROR: Signature is too large
rendner[i] ist offline   Mit Zitat antworten
Alt 20-09-2005, 22:13   #3 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
aloha!

god idea!

merci!


(jetzt trace ich eh schon wie ein weltmeister, aber ich bin net draufkommen in dem fall..... )
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti 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 16:43 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele