I have implemented an iframe into my flex application. The iframe contains a google map and various JavaScript functions which i am successfully able to call from my flex app.
like so
ExternalInterface.call("top.frames[0].addMarker", i, latitude, longitude, timestamp, user, state, datestring);
But now i want to pass data in the other direction.
I have found the following article http://webdevwonders.com/communication-between-flex-and-javascript/
which shows usage of addcallback
ExternalInterface.addCallback( "iAmCalledFromJavascript", iAmCalledFromJavascript);
do i need to add the same top.frames[0]. or something different?
Thanks
Vince
No you don’t need to add top.frames[0]. cause you calling ActionScript inside of Flex from JavaScript, and there are no such thing like DOM frames inside of Flex.
Just keep using the same approach from JavaScript as before:
But more details about accessing parent iframe document can be found here
http://www.esqsoft.com/javascript_examples/iframe_talks_to_parent/