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
866 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
  • 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
flash cs6 4 343
Virus or Outlook 2007 problem, how to tell? 8 76
black magic design 1 120
HTML 5 video and audio or Flash 1 44
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

948 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now