A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Loop single frame with AS

Hybrid View

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Loop single frame with AS

    I have a main timeline with 3 frames. I use AS2 to pause them, with
    PHP Code:
    function pause(){

    play();

    clearInterval(timer);

    };


    stop();

    timer setInterval(pause2500); 
    in the first frame, and just

    PHP Code:
    stop();
    timer setInterval(pause5000); 
    on the next two.
    It's basically a slideshow, with no fancy transitions or animation.
    However, on frame two, I have a Movie Clip with an animation that plays for 60 frames/4 seconds. I'm AS noob, but assume the stop hinders the MC playing.
    What I want is this frame to play (or loop ?) for 4 seconds, preferably with AS, instead of inserting frames in the main timeline for the duration of the MovieClip.

    The solutions I've found so far all involve scripts with two or more frames.
    Any help, hints and suggestions would be greatly appreciated.

  2. #2
    Teacosy is coming ranoka's Avatar
    Join Date
    Jun 2003
    Location
    UK
    Posts
    123
    If you stop the parent timeline (eg the main sage), then the child timeline (eg a MovieClip on the stage) will keep playing. So you don't need to anything extra for what you want to achieve.

  3. #3
    Junior Member
    Join Date
    Nov 2008
    Posts
    2
    I couldn't get it to work for the life of me, but reading this, I understood the problem was not in the AS itself. Somehow the MC had changed property to Graphic.
    Thanks for the quick reply, and patience with a beginner - very much appreciated.

  4. #4
    Teacosy is coming ranoka's Avatar
    Join Date
    Jun 2003
    Location
    UK
    Posts
    123
    Ah yes. A graphic won't loop if you stop the timeline it's on because it doesn't have it's own timeline like a MovieClip does -- it syncs with the timeline it's on, so if you stop the parent timeline then the graphic will also stop.

    Since you mentioned MovieClip, I didn't think to suggest checking it's not a graphic.

    Graphics are great, I use them a lot as an animator, but they are better suited to stuff that is linear and that you want to have granular control of in the IDE's main timeline because you know which frame will show when.

    But if you want to do anything interactive/dynamic then you need to turn to MovieClips instead!

    I'm glad you solved your problem, it's a good lesson to learn

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