A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: HELP 911! Setting 3 loop limit!

  1. #1
    Junior Member
    Join Date
    Apr 2005
    Posts
    2

    HELP 911! Setting 3 loop limit!

    I need to set a flash mx banner limit to 3 times but I don't know how to do it exactly. I have a deadline for a project that is due and I really would appreciate it if anybody could help me out.

    THANKS!!

  2. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    163
    make a new layer, Called actions. On the first frame of this layer make a key frame.

    write this in the actions for that keyframe:

    if(numberOfTimesToLoop == undefined){
    numberOfTimesToLoop = 0
    }

    that's it forr that frame.

    Now go to the last frame and create another keyframe on the actions layer. Write this in the actions for that keyframe:

    if(numberOfTimesToLoop < 3){
    gotoAndPlay(1);
    }
    else{
    stop()
    }

    that's it. It should only loop 3 times now.

  3. #3
    Denim Demon
    Join Date
    Jun 2002
    Location
    Outside of society
    Posts
    514
    You forgot to add a line to update/increment the numberOfTimesToLoop variable.

    It should probably be like this:
    if(numberOfTimesToLoop < 3){
    gotoAndPlay(1);
    numberOfTimesToLoop++;
    }
    else{
    stop()
    }
    Davy Paycheck- Kicking more ass than your daddy on a 3 bottle night.

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