A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] possible to play a range of frames then stop?

  1. #1
    Senior Member
    Join Date
    Mar 2003
    Posts
    233

    [F8] possible to play a range of frames then stop?

    If I have a frame-by-frame animation of say 25 frames, is it possible to have a button play frames 12 to 17 then stop, and another button play frames 3 to 19 then stop, for example.

    I have lots of combinations of these to do, the only way I can think of if this isn't possible to do is to have a duplicate animation for every eventuality just using the frames I need and a stop frame, but I would need over 100

    Can a range be played and then stop?

    Many thanks

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    this should do it. put this on the button.
    PHP Code:
    on (release) {
        
    gotoAndPlay(12);
        
    onEnterFrame = function () {
            
    myStop _currentframe;
            if (
    myStop == 17) {
                
    stop();
            }
        };

    here is the code if the animation is in a movieclip and the button outside the movieclip
    mc = instance name of movieclip
    PHP Code:
    on (release) {
        
    mc.gotoAndPlay(12);
        
    onEnterFrame = function () {
            
    myStop mc._currentframe;
            if (
    myStop == 17) {
                
    mc.stop();
            }
        };

    hope this helps
    Last edited by EQFlash; 04-16-2008 at 10:13 AM.
    If you don't think you're going to like the answer, then don't ask the question.

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