FMX: controling another movie

Hello All,
Could someone point to me some tutorial on how to control another swf in a html page?

I’m having a 2 flash movies in my web page (let’s say index.html , movie01.swf and movie02.swf). Is there a way, when something happens on movie01 (like a click) that movie02 does something as well like plays a MC? My HTML page has 3 frames, 1 top, 1 left, 1 main. Movie01 on top and Movie02 just a small area in left frame.

TiA :slight_smile:

Yeah that’s pretty easy using LocalConnection.

on The first frame of Movieone.swf (The sender movie in this case), insert this action:

myButton.onRelease = function() {
myLocalConnection = new LocalConnection();
myLocalConnection.send(“IncomingMessage”, “onRecieve”, myTextBox.text);
myLocalConnection.close();
};

Ok, here goes, when myButton is pressed, a local connection object will be created, then it will send an incoming message to the function onRecieve with the parameter myTextBox.text (The text you will be inputing in that field) to the reciever movie.

on The first frame of Movietwo.swf (The reciever movie in this case), insert this action:

myLocalConnection = new LocalConnection();
myLocalConnection.onRecieve = function(parameter){
myTextField.text = parameter
//Anything else, mc.play() etc
}
myLocalConnection.connect(“IncomingMessage”);

When the incomingMessage is recieved, the parameter will be assigned to myTextField…Looks confusing, check the attached example then. open both movies together, submit a message, and you’ll get what you submited in the other movie. :slight_smile:

nice example =)

Thanks for sharing this with us :wink:

Thanks a bunch!
Will check/tweak it out, thanks for the attached files, very helpful!8]

mm ok well i’m not that advanced it seems :confused: hehe you kinda went too soon too fast for me :hangover:

I don’t really understand how i can call a MC and tell it to go to a frame and stop with that function … can you help me out?

TiA
:trout:

> I don’t really understand how i can call a MC and tell it to go to a frame and stop with that function … can you help me out?

Yeah your sending strings, however, I have seen a function called doCommand that let you execute strings:

If the parameter from sender movie is “myMC.play()”, then use doCommand:

myLocalConnection = new LocalConnection();
myLocalConnection.onRecieve = function(parameter){
doCommand(parameter)
}
myLocalConnection.connect(“IncomingMessage”);

I’ll try to get the link and post an example as well… :slight_smile:

There:

Example:

MC1.play();

will play the movie! :slight_smile:

thanks a million!!
Now it’s getting clearer. Much appreciated!!<:}

Glad it worked.