A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Stop while in Reverse

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    5

    Stop while in Reverse

    Hello, this is my first post here. I read the archives often, but haven't had the need to post until now. Hopefully my problem can be solved, and hopefully I will be able to help others eventually.

    Here is my dilemma: I have a movie clip which is controlled by two buttons; forward and reverse. Forward just makes the movie play until it reaches a stop within it. However, my reverse function ignores all stops in the movie clip and keeps playing in reverse to frame 1.

    Here is the code within the reverse button;
    Code:
    on (press) {
       _root.onEnterFrame = function() {
             _root.portfolio.prevFrame();
             _root.portfolio.stop();
                   if (_root.portfolio._currentframe == 1) {
                         delete _root.onEnterFrame;
                   }
             };
    }
    I tried throwing this function in to no avail;
    Code:
    if (_root.portfolio.currentLabel.name == "stophere") {
          _root.portfolio.stop();
          delete _root.onEnterFrame;
    }
    It seems like something so obvious... I have been trying to fix this for hours now. Please help.

  2. #2
    professional amateur
    Join Date
    Apr 2001
    Location
    Amsterdam
    Posts
    187
    obvious.... except for that there is no currentLabel in flash.
    what you could do is have an piece of actionscript on the frame you want it to stop that sets an variable to stophere = true;
    then you could check in an if statement
    Code:
    if ( stophere == false ) 
       got to previous frame 
    else 
       delete OnEnterFrame
    after click the button again to make it move forward or backward, change the stopnow to false and it'll keep playing till you reach another frame with stopnow = true.

    Succes.
    back to work at flashclub.nl.
    Ngezi


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