This is how I do it (this is from my memory, so I haven't tested this exact
code):
--------------------------------------------
ACTIONSCRIPT :
//(At the start of your script)
// set up the listener that passes the event and variables to Director...
var directorListener:Object = new Object();
directorListener.handlerName = function(evt_obj:Object):Void { }
//(At the end of the first frame of you script)
if (System.capabilities.playerType == "DirectorXtra") {
getURL("event:flashLoaded"); // Director can now do stuff with the flash
object!
} else {
// commands to test swf outside of Director go here...
}
--------------------------------------------
LINGO:
on flashLoaded me
//set up an intercept of any calls to the directorListener function...
sp=sprite(spriteNum)
listener=sp.directorListener
sp.setCallBack(listener, "handlerName", #lingoHandler, me)
end
on lingoHandler me,directorListener,flashVariables
put flashVariables.type
put flashVariables.target._x
put flashVariables.selectedIndex
end
--------------------------------------------
Then, back in ACTIONSCRIPT, to pass Flash variables, not string values, use
this code:
--------------------------------------------
//call the function in the directorListener event
directorListener.handlerName ({type:"select", target:this, selectedIndex:23});
//the props in the assoc. array can be anything! Add as many as you need.
For more on Flash<->Director variable passing and events, see
http://www.adobe.com/cfusion/webfor...mid=11&catid=18
7&threadid=1382714&enterthread=y