Currently, the only way to talk out of Flash is fscommand & getURL.
var a:Array = ["one", "two", "three"];
var str:String = a.join(",");
trace(a); // one,two,three
fscommand("sendarray", str);
Going to Flash if your not using JavaScript, one 2 ways:
- LoadVars
- watchers
VC++
-----
s = "foo=bar&a=1,2,3&maybe=34.999";
flashobject.setVariable("cmd", s);
Flash
------
function init()
{
this.watch("cmd", onCMDChange);
lv = new LoadVars();
}
function onCMDChange(prop, oldVal, newVal)
{
prop = newVal;
lv.decode(newVal);
showProps();
return prop;
}
function showProps()
{
for(var p in lv)
{
trace(p + ": " + lv[p]);
}
}
above will show:
foo: bar
a: 1,2,3
maybe: 34.999
If you don't want to use the LoadVars, you can just set a bunch of variables
(that will be on _root's scope) that don't have watchers on them, and then
the last call in VC++ calls like "cmd", "done" which will trigger your
watcher to parse the other variables; whatever you feel comfortable with.
Hopefully in the future, it'll be easier to talk to and from Flash.
----- Original Message -----
From: "awflasher.com" <[EMAIL PROTECTED]>
To: "Open Source Flash Mailing List" <[email protected]>
Sent: Thursday, June 30, 2005 9:34 PM
Subject: [osflash] Hi all , a question about Flash <-communication-> VC++
Any body know how to send data to VC++ or receive VC++ data?
I found a class "CShockwaveFlash" , but it can only realize some easy
commuications with fscommand .This time I wanna send some data(an array of
numbers) to vc, then vc send this data to HARDWARE with _asm functions .....
vc2hardware is done , but i don't know how to send the array of data to vc
... and how to receive data from vc.... i have no ideas
i guest there SHOULD be some methods that can let the variables(at least the
variables of _root) communication from the two stuff. but i don't know
exactly how....
I am from China , sorry for my poo English, thanks!
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org