Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problems with buttons and two movies

Posted on 2002-03-17
1
Medium Priority
?
282 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 300 total points
ID: 6876068
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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 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…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

824 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