A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [MX04] Is it possible to find out which mc's are running functions onEnterFrame()

Hybrid View

  1. #1
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662

    [MX04] Is it possible to find out which mc's are running functions onEnterFrame()

    i have done everything i can to optimize my code and movies to make everything run as smoothly as possible and decrease processor load... BUT, thins are still running slow and processor load is pretty heavy. I have made sure I have deleted every onEnterFrame() running from within the functions themselves.. but the only thing i can figure is that some aren't deleting properly...

    So i was wondering if there is a way to output (at any random time i want to) any and all MC's running onEnterFrame loops?....

    or can anyone offer another solution for how to pinpoint what is causing the lag?....

    Thanks in advance
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    you could have each function trace something like "onenterframe1 has stopped."
    Then just watch your output panel until you see every one's message.

  3. #3
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    i thought of that.... i just was hoping there was a way that i could do it, without having to go through and edit each FLA... cuz i need to check it in all the swf's loaded into my main movie.. i thought there m,ight be some kind of 'typeof' thing i could do or something....
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    Havent got flash on this computer ...so this is a shot in the dark: suppose your mc is called mcDuck which has an onEnterFrame running

    ..then see if the following code spits out something which refers to the onEnterFrame

    Code:
    for(var i:String in mcDuck){
    
    trace("property: " + i + " value: " + mcDuck[i] + "type: " + typeof mcDuck[i]);
    }
    If you do get something positive from the above then u can use a recursive function to loops through all the movieclips removing onEnterFrames..

    actually maybe u could do it anyway..even if they dont have onEnterFrames running on them..the following should remove all onEnterFrames from all movieclips

    Code:
    deleteOnEnter(_root); 
    
    function deleteOnEnter(movie:MovieClip):Void {
    	delete movie.onEnterFrame;
    	for (var i:String in movie) {
    		if (movie[i] instanceof MovieClip) {
    			delete movie[i].onEnterFrame;
    			deleteOnEnter(movie[i]);
    		}
    	}
    }
    Last edited by silentweed; 07-16-2006 at 05:25 AM.
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center