?
Solved

How can I reset the swf file back to the way it looked when the page first loaded with a button?

Posted on 2008-10-11
2
Medium Priority
?
881 Views
Last Modified: 2013-11-11
Is there something in flash where I can reset an swf back to its original state in a web page.  IWould Navigating to the first frame take care of it?  Like would it restor all the knobs and levers back to their original state?
0
Comment
Question by:flashactions
[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
  • 2
2 Comments
 
LVL 4

Expert Comment

by:ckoning
ID: 22694445
Yes, navigating to the first page should solve that problem.
0
 
LVL 4

Accepted Solution

by:
ckoning earned 2000 total points
ID: 22694471
Here is a code snippet to accomplish that in AS3.
// The button that will go to the first frame
// Must be created, initialized, etc. to your liking
var myButton:Sprite = new Sprite();
myButton.buttonMode = true;
.
.
.
 
// Add an event listener for the button
myButton.addEventListener( MouseEvent.CLICK, handleMyButtonClick, false, 0, true );
 
// Define the event listener
function handleMyButtonClick( e:MouseEvent ):void
{  // To restart from the beginning
   gotoAndPlay(1);
   // Or *ALTERNATIVELY* to freeze at the beginning
   gotoAndStop(1);
}

Open in new window

0

Featured Post

Independent Software Vendors: 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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

771 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