Pssing objects between flash and javascript

I am trying to pass a large object from flash to javascript/ coldfusion. What is the best way to do this

iv tried doing something like this  and worked ok

var  greeting = String(ExternalInterface.call("sayHello",obj));

but i also want to try getUrl where does the obj go in getUrl

getURL("scripts/nmbh13th_submiths.php", "", "POST");

or are there other ways that i can do this

jockmahon01Asked:
Who is Participating?
 
julianopolitoConnect With a Mentor Commented:
to communicate to Javascript use ExternalInterface.call and ExternalInterface.addCallback . To receive data via POST, use LoadVars in Actionscript 2.0 or URLLoader in Actionscript 3.0. If you need example, tell me and I send you, just tell what you need to know. Also know that ExternalInterface converts primitive object types from AS to JS and vice-versa, so you can use an complex object from on e to the other.
0
 
julianopolitoCommented:
also you can use JSON to tranport data in decodable string format if you are having problems. Just download the JSON library for actionscript and fot javascript in links below. Just to clarify, JSON is a way to serialize/encode objects (no matter how complex or deep they are) into small strings, and then decode again. So you can turn your AS Object into a string pass to JS, decode and use. Then encode again send to Actionscript decode and use it.It s much smaller and easier to use than XML for instance.

Here you can learn more about json
http://www.json.org/

AS 2.0
http://www.json.org/JSON.as

AS 3.0
http://code.google.com/p/as3corelib/

Javascript
http://www.json.org/js.html
0
 
jockmahon01Author Commented:
well im am currently using the External call and can get it to js but i dont know how to read and use it at the js end.basically i am trying toget around the print dialog that comes when printing in flash so am using scriptx to auto print the content i send from flash to js and then print
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
julianopolitoCommented:
So you want to learn how to pass arguments from JS to flash? It so let me know so I can get you an example.
0
 
jockmahon01Author Commented:
i have changed this to use xml.send instead
0
 
julianopolitoCommented:
I'm sorry I did not understand your statement:
"i have changed this to use xml.send instead"

If you need more help let me know.
0
All Courses

From novice to tech pro — start learning today.