Solved

Problems with buttons and two movies

Posted on 2002-03-17
1
238 Views
Last Modified: 2010-04-03
I am new to Flash 5 and have been experimenting with buttons.

I have two movies which I want to link.
The original is called Shapes and on this I have created a button.  I want to be able to click this button and another movie (called Demo1) to be loaded and run - thus replacing the original.

For the actions for the button press I have used this code

on (press) {
    with ("shapes.swf") {
        stop ();
    }
    unloadMovie ("_root");
    loadMovieNum ("demo1.swf", 0);
    tellTarget ("_root") {
        play ();
    }
}

However, when I test the scene I get the following message

Target not found: Target="demo1" Base="_level0"

This can appear several times - once for each time I click the button - and then all of a sudden the Demo1 movie starts to play.  At other times, it appears only once or twice and then the demo1 movie starts to play.

What am I doing wrong?
0
Comment
Question by:MnrSchot
1 Comment
 

Accepted Solution

by:
LOBO earned 100 total points
Comment Utility
MnrSchot, try this....

On (Press)
      Load Movie ("demo1.swf", 0)
End On

The 0 indicated that you would like to replace the original movie, if it was a 1 the movie would load on another layer.

I am presuming your movie has already stopped when using the button, and the "demo1" movie will play automatically along as there is no stop action on the first frame.

Also the two .swf files should be in the same directory.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to record live broadcast.

743 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

18 Experts available now in Live!

Get 1:1 Help Now