A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: back ground script.

  1. #1
    Member
    Join Date
    Dec 2000
    Posts
    79

    back ground script.

    ok wonder if some one could help please > i wish to use a < for next loop> over a 30 frame anim but i do not want the <for next loop> to complete straight away on the first key frame but over the period of the 30 frame anim.

    many thx.

    ie: i want the code to run over the period of the anim a little like multi task in the back ground of the anim and not straight away before the anim begins to start.

    hope thats clear thx.

    need to run action scipt in the back ground while stuff going on sure im missing some thing or is this the nature of flash.

    ps.sorry if this has been asked before.

  2. #2
    Modulator Katnap Kaos's Avatar
    Join Date
    Nov 2003
    Location
    A shoebox outside of SM Megamall
    Posts
    149
    Just create another layer that is the length of the animation, and place a MovieClip in that layer.

    Then put the the script in the MC:
    code:

    onClipEvent(enterFrame){
    //Your script goes here
    }




    Actually a better way is just to put within that new layer
    code:

    _root.onEnterFrame = function(){
    //Your script goes here
    }


    The idea is that the layer spans the entire animation, but there aren't any keyframes to remove the script (since the layer should be blank). By using either of the enterFrame functions, the script repeats itself each frame.
    Last edited by Katnap Kaos; 03-06-2007 at 07:01 AM.
    As a Gamer, you play by the rules.
    As a Programmer, you play as God.

  3. #3
    Member
    Join Date
    Dec 2000
    Posts
    79
    many thx sorted.

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