A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Play 10 frames and then goto - how?

  1. #1
    Member
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    30

    Play 10 frames and then goto - how?

    On frame 1 I need an action on a button that plays an animation during 10 frames and then goto another scen - without putting an action on frame 10. Only one button action. Possible?

  2. #2
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472
    hi,

    I'm not gonna ask why ...

    mymc.onEnterframe=function(){
    if(this._currentframe==10){
    _root.someclip.gotoAndStop("something");
    delete this.onEnterframe;
    }
    }

    //poden

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Why can't you put an action on frame 10?

    You could always monitor (through an onEnterFrame...) the timeline's current frame being played, and when it's > 9, re-direct the playhead to some other labeled frame in whatever scene...

  4. #4
    Member
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    30
    Because I have multiple buttons that plays the samt animation but then goto different scenes. Thanks for the script!!!

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You could them simply differently set a global variable (_global.whereToGo), on each button, and then have the button simply play the the timeline...
    code:

    on(release){
    _global.whereToGo = "traget1"; //"target2" for button 2, etc...
    this.play();
    }

    //Then on frame 10...

    stop();
    this.gotoAndPlay(_global.whereToGo);
    }


  6. #6
    Member
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    30
    Thanks! Gonna try that one too!

    /p

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