Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading an .swf into movie clip

Status
Not open for further replies.

orangejuice

Technical User
Nov 18, 2002
33
CA
I am having trouble loading an .swf into an empty movie clip. I have placed an empty movie clip on the stage, and named the instance "empty". Then on the frame I have placed the following script:

empty.loadMovie("Applanix POS.swf");

The .swf file loads fine, but stops while playing. The original flash files for this contain a "stop" command right where the file stops playing. However, autoplay features have been incorporated, and it works fine when you just open the .swf file in a flash player. Can anyone tell me why it doesnt work the same way when loaded into my movie???
 
First off, it's a bad idea for your filenames to contain spaces and mixed cases.

So your loaded swf stops while playing, but you want it to keep going... but you said the original file contains a stop() action. I don't quite understand the problem.
 
Someone else created the original file and has somehow made the movie stop at a frame for about 5 seconds, and then continue to play. They have set up some autoplay variables, which work perfectly when the .swf is played directly in a Flash player. Is it possible that these are disabled when the movie is loaded?
 
That might be a bit tough if you don't have the original file.

You might have to just keep telling it to stop... with:

Code:
onClipEvent(enterFrame){
   _root.empty.stop();
}

Or something like that.
 
I do have the original file. The problem is that when the movie stops, there is no button or anything for the user to make it continue playing. It is simply supposed to run on its own. Will I have to re-do the entire file?
 
What exactly do you want to do then?

Do you want the user to control when that movie resumes play (rather than it automatically playing)?

If that is what you want, what actionscripting is being used to stop/resume the movie?
 
I want the movie to play automatically, as it is set up right now. The creator of this file has set up some variables in the first frame, as follows:

var autoPlay = false;
var autoPlayTimeOut = 1500;
var autoPlayTimer;
var autoAdvance = false;
var autoReplay - false;

Then, when the movie reaches the frame with the stop command, the actionscripting is as follows:

autoplay = true
stop();

This is the only place I can find where these variables are used. I don't completely understand the concept of variables, and don't know why this script would be "erased" when the movie is loaded into my file.

Any clarification you could give would help immensely!!
 
If I had made it I would - however, I can post an .swf for you to look at. How do I do that?
 
Can you link to it on a place on your server? If not email what you can to spp79@hotmail.com and I'll take a look.
 
So the original deveolper set up:

Code:
var autoPlay = false;
var autoPlayTimeOut = 1500;
var autoPlayTimer;
var autoAdvance = false;
var autoReplay - false;

and

Code:
autoplay = true
stop();

He set these up in your file or in his original?
 
Loading the swf into an MC seems to be lousing it up, so load it into a level instead:

Code:
_level0.loadMovie("ApplanixPOS.swf");

frozenpeas
 
Thanks!

Loading it into level0 seems to work, but when I load it into level1 so that the background and structure I've set up will still be visible, nothing happens. Any ideas?
 
Check that.

The movie loads, but loads overtop of the structure I've set up (basically some grid lines and other menu buttons) They are still clickable but are not visible (its like the movie is over top of them) Any way to determine the "viewable" area of the movie? or where it is placed on the stage??

Thanks!
 
You might have to shuffle some things around. Putting swfs on levels is similar to putting things on layers.
 
Thanks so much for your help.... I should be able to figure it out from here!

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top