onEnterFrame???

  • Started
  • Last post
  • 2 Responses
  • ********

    So I have a menu system that is dynamically created from an array; the items all pull up random shapes and 'animate' to random positions.
    Each one of these items are running through an EnterFrame script that executes 6 things per item per time. I assume this is going to bog down my processor, no? Again, this is only the menu, content will most likely be animated as well...

    What are my options here? Should I jump out of the EnterFrame script? Should I try that flash decompiler software(flazoom?) please help!

    ********
  • unknown0

    set id vars for each menu behavior so you can ask onEnterFrame if that variable is true then do the thing otherwise nothing. That way you will release the CPU from onEnterFrame running constantly. Let me show you an example how I do it in some cases:

    process=false; (place this somewhere on the frame actions)

    onClipEvent(enterFrame){
    if(process){
    ..do something until it's done
    }
    }

    this means that let's say you have a button and when you click on it you set process var to true, in that case onClipEvent will start looping...this is good because you can change the process var when those onClipEvent actions are actually finished back to false and onEnterFrame will stop working..

    I hope this helped.

    Cheers.

  • unfittoprint0

    I prefer to use FlashMX syntax:

    myClip.onEnterFrame=function(){
    if(count<myArray.length())[
    dothis()
    ++count
    }else{
    delete onEnterFrame
    }
    }

    As you can see this let's delete in each MovieCLip the onEnterFrame function, releasing the user's CPU from this loop.