Solved

Reset button

Posted on 2004-04-14
5
319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
To view Flash technology content error 4 6,741
Flash player plugin 13 7 346
Online Course Not Responding 3 96
PDF: Display my cards game? 8 135
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
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…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
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.

756 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