Skip to main content
Participant
November 11, 2011
Question

Control One Flash Movie with Another

  • November 11, 2011
  • 2 replies
  • 1183 views

I have a need to control one flash movie with another.

For example: I have a graphical interface created in Flash AS3 which is simulating the control of machines on the ocean floor. I have 3D animations that will animate what is happening on the ocean floor when a control element is activated on the graphical interface. At the moment I have this happening all in one Flash player window that has been made to look like two windows. One which is the interface...one that is made to look like a small screen showing what looks like video coming in from a camera on the ocean floor.

What I need to be able to do is have the Control Screen as one window, and the animations to appear in another. In this way we can set up two monitors, have the control screen on one (computer monitor), the animations playing on the other (a large plasma connected to the same computer). The animations need to play within a flash shell and the control screen would need to play in a separate shell. So in essence I need to be able to double click on an .exe....two screen will activate showing one screen with buttons that port animations into the second screen which I have positions to play on the larger screen.

Has anyone ever done something like this and could point me to a tutorial or aid me?

Thanks

This topic has been closed for replies.

2 replies

Known Participant
November 12, 2011

One last question, I am trying to understand this process, starting with this simple function I would like to understand how to do other functions...just something simple so I can better understand am go from there:

This tutorial told how to do this simple fuction. Push a button on the sender (something I need mine to do) and send text to the reciever.

Sender:

stop();

var sending_lc:LocalConnection;
sending_lc = new LocalConnection();

function send_it(evt:MouseEvent):void {
sending_lc.send("my_lc_as3", "execute_this", "fcOnTheWeb.com");
}

my_btn.addEventListener(MouseEvent.MOUSE_UP, send_it);

to send "fcOnTheWeb.com" to receiver

Receiver:

stop();

var receiving_lc:LocalConnection;
receiving_lc = new LocalConnection();
receiving_lc.connect("my_lc_as3");
receiving_lc.client = this;

function execute_this(new_text:String):void {
my_text.text = new_text;
}

to recieve and display text inputed into sender and sent when button is pushed.

Would you be able to illustrate to me how to do another simple fuction on button push? Such as sending a command to the reciever to gotoAndPlay frame 2? I know this is probably simple but I just want to see what changes. In that way I might be able to understand better as all I could fine for code was mostly sending text like the code above.

I know it probably has something to do with changing:

function execute_this(new_text:String):void {

my_text.text = new_text;

on the receiver and:

sending_lc.send("my_lc_as3", "execute_this", "fcOnTheWeb.com");

on the sender

I know there are others look for help doing what I am trying to do (in the end, loading FLVs in the reciever through commands sent from sender...I think if I see how to implement a simple the gotoAndPlay I might be able to figure the rest out.

Thanks again for helping

BTW, I am also maximinus, one is for work the other home as I must access different e-mail addresses.

Known Participant
November 13, 2011

Okay, it took me awhile but I think I solved this plus I gained a greater understanding of how this works and how to format sending and receiving:

Sender:

stop();

var sending_lc:LocalConnection;
sending_lc = new LocalConnection();

function send_it(evt:MouseEvent):void {
sending_lc.send("my_lc_as3", "execute_this", gotoAndPlay(2));
}

my_btn.addEventListener(MouseEvent.MOUSE_UP, send_it);

Receiver:

stop();

var receiving_lc:LocalConnection;
receiving_lc = new LocalConnection();
receiving_lc.connect("my_lc_as3");
receiving_lc.client = this;

function execute_this(event:Event):void {
     gotoAndPlay(2); }

So this sends a command to execute a gotoAndPlay event in the receiver movie using LocalConnection

Thanks

kglad
Community Expert
Community Expert
November 13, 2011

you're welcome.

kglad
Community Expert
Community Expert
November 11, 2011

if both swfs are playing on the same computer at the same time you can use the localconnection class to communicate between the two.

Known Participant
November 12, 2011

okay, that will give me a starting point. Thanks

kglad
Community Expert
Community Expert
November 12, 2011

you're welcome.

p.s.  please mark helpful/correct responses, if there are any.