Skip to main content
Participating Frequently
Aug 18, 2006 10:18 AM UTC
Answered

How to control the playback of an externally loaded movieclip

Hi guys,
I am doing this presentation now..and i am loading external swf's inside a movieclip...is it possible to control the playback of the externally loaded swf, i mean i want to play and pause that swf file within the main movie.....can someone please help me with it.....

Thanks in advance

Cheers
Sullan
This topic is closed to new replies. Start a new post to keep the conversation going.
tahadafCorrect answer
Inspiring
Aug 21, 2006 9:03 AM UTC
Well, very easy...
After you load the external SWF, pause and play it with the following AS on the buttons...

//AS to pause:
on (release) {
_root.dropZone001.stop();
}

//AS to replay:
on (release) {
_root.dropZone001.play();
}


This must work with no problem :)

8 replies

Participating Frequently
Aug 21, 2006 7:26 AM UTC
Thanks once again...what i need to do is to pause that external movie which is playing...and when i click on the play button once again..the external movie should start playing from that stopped portion.....can it be done ??...please help....
Translate
tahadafCorrect answer
Inspiring
Aug 21, 2006 9:03 AM UTC
Well, very easy...
After you load the external SWF, pause and play it with the following AS on the buttons...

//AS to pause:
on (release) {
_root.dropZone001.stop();
}

//AS to replay:
on (release) {
_root.dropZone001.play();
}


This must work with no problem :)
Translate
Participating Frequently
Aug 21, 2006 10:22 AM UTC
Thanks a lot.....it did work out fine with external swf's exported from flash....BUT when i use external swf's exported from Macromedia Captivate.....the same script is not working.....wonder why this happens.......anway thanks a lot...this did made me learn a new thing........:)
Translate
Inspiring
Aug 19, 2006 2:02 PM UTC
well, that code was just an example, you can add any AS over the targeted movie clip!

What do you need to do exactly?
Translate
Participating Frequently
Aug 19, 2006 6:32 AM UTC
It worked out fine....but what i am trying to do here is that i have loaded External captivate swf files....and i am exporting them without the progress toolbar from Captivate......so in flash i need a toolbar to play and pause the movie.......

on (release) {
_root.dropZone.stop();
}

This worked out fine...but when the movie is playing, and when i use this script..the movie starts to play from the start once again....and what do i need to do to make the movie pause......
Translate
Inspiring
Aug 18, 2006 2:28 PM UTC
With all respect to the answer provided by derobinson, maybe loading an external MC using an empty MC like "dropZone" would give you more control :)

Use this code to load the .swf
loadMovie("file.swf", _root.dropZone);

Now simply you can control it. forexample by a button:

on (release) {
_root.dropZone.stop();
}

Or any other order can be applied :)
Translate
Inspiring
Aug 18, 2006 2:19 PM UTC
yes it is possible.
just find the correct path to the loaded .swf. (use trace(_root.mcHolder.externalSWFinstanceName); where _root is the main timeline(the origin), and mcHolder is your movie clip in the main movie to which the external .swf will be attached)\
the actual path might be different depending on where exactly your external .swf will be placed.
then you can do something like:

button.onRelease = function():Void {
mcHolder.externalSWFinstanceName.gotoAndPlay(2);
};
hope this helps, let me know if my info is not correct...
etc...
Translate
derobinson
Participating Frequently
Aug 18, 2006 2:11 PM UTC
Just address the MC you load the SWF into using its instance name (whether you use createEmptyMovieClip or have an existing MC on the stage) or I think you can address the entire level you load the SWF into (e.g. _level1).

Hope that helps!
Translate