PDA

View Full Version : How to Pass Variables to external SWF via Windows Component


mikew909
01-01-2007, 04:59 AM
Hi all and happy new year..

I've been beating me head against a wall with this problem for a while now.

I can create a popup to my external swf from my main swf with no problems like so:

myWindow = mx.managers.PopUpManager.createPopUp(_root,
mx.containers.Window, true, {title:"Food Selector",
contentPath:"Status.swf"});
myWindow.setSize(500,350);

I can also send values between swfs with no problems like so (sender)

sendingLC = new LocalConnection();
var tf1 = "blablabla";
var tf2 = "123123123123";
sendingLC.send("lc_name", "methodToExecute", tf1, tf2);

What I cant do is pass a value to my SWF when its wrapped in the Window Component. This only works if I'm running the SWFs in the browser or player separately. I think I need to initialize the window componant and pass the value in the constructor someway but I can't seem to get it working.

Any help would be appreaciated..

cheers

mike

mikew909
01-02-2007, 02:25 PM
Hi, major roadblock with this, would love to bang it on the head

This is what I've got so far

Swf A "customers" has button which launches Window component (createPopup)

PopUp window loads in external swf "orders".

I want to pass a variable to the Window Component's swf "orders" - a string.

Problem i got is LocalConnection() doesnt work when I use the window component, an external projector or single page .. fine.

If anyone has sample code for back-forth exchange between swfs ( in a Window Component ) I will pledge my first born to you.

Cheers
M