dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: transitions between frames

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Posts
    133

    transitions between frames

    Hi guys!

    I am working on a slideshow (sort of). The idea is that each frame in the root timeline works as a slide. Each slide inside each frame is a simple MC filled with images, texts, audio and animations and so on. Once this MC reaches its last frame, it should stop and trigger another MC used as a transition. And I've put inside this transition MC a code that should tell the root timeline to advance a single frame in order to show the next "slide".

    So, on the timeline, I've put this code:
    ***
    this.onEnterFrame = function(){
    if(slide._currentframe == slide._totalframes){
    //_root.slides.nextFrame();
    _root.slides.mctransition.gotoAndPlay(2);
    }
    }
    ***

    And, inside the transition MC i've put this code:
    On frame 2: _root.slides.slide.stop();
    On frame 15: _root.slides.nextFrame();

    Well, needless to say it is not working. The whole swf just stops. And if I remove the stop() code of the Transitions MC at frame 2, the current slide will loop before the transition triggers the nextFrame command.

    I have attached a movie with the same structure that I am using so that you guys can have a better understanding of the problem.

    Any help would be greatly appreciated.

    All the best
    Attached Files Attached Files
    Last edited by Mcrodrigues; 10-26-2011 at 04:06 PM. Reason: forgot to attach file

  2. #2
    Senior Member
    Join Date
    Feb 2004
    Posts
    133
    Ok... I am solely a newbie, so please don't laugh ')

    So far, I've done some progress. Right now, I've managed to make the transition between frames work only once, from frame 1 to frame 2. When the movie goes from frame 2 to frame 3, it won't work.

    Here is what I've done:

    Added a delete onEnterFrame command. Now, the code looks like this:

    this.onEnterFrame = function(){
    if(slide._currentframe == slide._totalframes){
    //_root.slides.nextFrame();
    _root.slides.mctransition.gotoAndPlay(2);
    delete this.onEnterFrame;
    }
    }

    Basically, onEnterFrame is monitoring the timeline so that once the slide movie clip reaches its last frame, another movieclip that works like a transition starts. Inside the transition movieclip there is a code which tells the main (root) timeline to advance a single frame. It works only once because my code deletes the onEnterFrame function. Is there a way to fix it?

    Once again, thanks for the help, guys!

    (attached the updated fla)
    Attached Files Attached Files

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