Solved

Reset button

Posted on 2004-04-14
5
309 Views
Last Modified: 2010-04-03
How do i set-up a reset button that when pressed returns several different movie clips in one scene back to their respective first frames...cheers

mf
0
Comment
Question by:Matt22
5 Comments
 
LVL 9

Assisted Solution

by:j3one
j3one earned 50 total points
ID: 10828462
You could make a button that tells it to go to a frame with nothing on it, and tell that frame to go back to the frame it just came from. basicaly resetting the animation. I am sure there is an actionscript way to do this though...
0
 
LVL 4

Assisted Solution

by:RedLava
RedLava earned 50 total points
ID: 10828791
Hi Mat22,

How are these movies created? Are they loaded at run time?

However they are loaded record which movies they are in an array. If they are loaded dynamically then just add the name to the array when it is loaded or hard code it at design time.
Then loop through the array using the values as the movie name and use the go to and stop method to go to frame 1 of the movies.

Do you have the code you use to create the movies? Post it and I can write the actionscript you need.

RedLava
0
 
LVL 2

Assisted Solution

by:hansblix
hansblix earned 200 total points
ID: 10829866
if you want to do this for all movieclips in the current timeline:

for (i in this)
{
    if (typeof(this[i]) == "movieclip")
    {
        trace("resetting movieclip : " + this[i]);
        this[i].gotoAndPlay(1);
    }
}
-h
-----------
http://www.quillem.com
0
 
LVL 9

Accepted Solution

by:
krishnaprathab earned 200 total points
ID: 10829949
Yes hansblix is right. You can use the similar function below to do it independent of your timeline.

ResetButton.onPress = function()
{
      for (var i in this._parent)
      {
            if (typeof(eval(i)) == "movieclip")
            {
                  eval(i).gotoAndStop(1);
            }
      }
}

Thanks,
KP
0
 
LVL 2

Expert Comment

by:hansblix
ID: 10840739
krishnaprathab :
  Try and avoid eval as much as possible as it's not really recommended.. Left side evals are known to be buggy when used in assignment statments, but generally I recommend that you don't use it at all :)
  use array notation always..

Just a thought..
-H
---------------
http://www.quillem.com
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question