Controlling loaded swfs, from other swfs

alright on my site, i have a loaded movie clip with sound, which is the main bg music, and i have a samples page, and i want each sample to load up on press or whatever. now i need to know how to not just unload the mian bg music swf, but make that swf go to and stop on frame 3 (1 is loader, 2 is play, and 3 is stop) thanks alot!!

anyone? sorry i really need to get this finished soon :chinaman:

i need help guys!!! :chinaman:

put your source fla up and i will take a look

this is taken straight from the Flash reference. If you use loadMovie to get your swfs in, you can refer to them by the name of the target you specify.

soundSwfTarget.stop(); should stop the MC you load the sound SWF into.

MovieClip.loadMovie

Availability

Flash Player 5.

Usage

myMovieClip.loadMovie(“url” [,variables])

Parameters

url An absolute or relative URL of the SWF or JPEG file to be loaded. A relative path must be relative to the SWF file at _level0. The URL must be in the same subdomain as the URL where the movie currently resides. For use in the stand-alone Flash Player or for testing in test mode in the Flash authoring application, all SWF files must be stored in the same folder, and the filenames cannot include folder or disk drive specifications.

variables An optional parameter specifying an HTTP method for sending or loading variables. The parameter must be the string GET or POST. If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL, and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.

Returns

Nothing.

Description

Method; loads SWF or JPEG files into a movie clip in the Flash Player while the original movie is playing. Without the loadMovie method, the Flash Player displays a single movie (SWF file) and then closes. The loadMovie method lets you display several movies at once and switch between movies without loading another HTML document.

A movie or image loaded into a movie clip inherits the position, rotation, and scale properties of the movie clip. You can use the target path of the movie clip to target the loaded movie.

Use the unloadMovie method to remove movies or images loaded with the loadMovie method. Use the loadVariables method to keep the active movie, and update the variables with new values.

See also

loadMovie
loadMovieNum
MovieClip.loadVariables
MovieClip.unloadMovie
unloadMovie
unloadMovieNum


Of course, you should be using sound files by themselves without saving each in an swf. You CAN load a sound with the Sound object

mySound = new Sound();
mySound.loadSound(“demo1.mp3”); or “.wav” or “.au”
mySound.stop();
mySound.start();
etc…
all this is in the Reference too

alright so lets say the swf is called loop.swf and i have an mc named hi, it would be like on release loop.swf.hi.gotoAndStop(1);

what if i had no mcs, just keyframes.

also, what if i want to control loop.swf from a new loaded swf?

say i loaded it at 66 so its like (“http://tek-labs.com/jsa/loop.swf”, 66) how would i do it?

when you attach the swf it is going to have a new name, not loop.swf
For example loadMovie(“loop.swf”,“myClip”) would require that you already have a clip called myClip. This code would replace myClip with your swf, and from then on you can refer to it as myClip, so myClip.play() will play loop.swf in your main swf.