Recently I've been playing with Flex's LocalConnection on the AIR platform. I wanted this AIR application to be able to exchange messages with a web application that runs in the browser. Because of this, I could never know the exact domains of these 2 files and they could never be in the same domain.
So I read the documantation, but I did it somewhat between the lines and of course I got the Error #2044: Unhandled statusEvent.
To avoid this all you need to do is follow the documentation :
Different domains with unpredictable domain names.
// sendingLC is in http://www.anotherdomain.com/sending.swf
receivingLC.allowDomain('*');
receivingLC.connect('_myConnection');
// sendingLC is in http://www.anotherdomain.com/sending.swf
sendingLC.send('_myConnection', 'myMethod');
1. | // sendingLC is in http://www.anotherdomain.com/sending.swf |
2. | receivingLC.allowDomain('*'); |
3. | receivingLC.connect('_myConnection'); |
4. | |
5. | // sendingLC is in http://www.anotherdomain.com/sending.swf |
6. | sendingLC.send('_myConnection', 'myMethod'); |
Subscribe to:
Post Comments (Atom)
1 comments:
Great works for me.
Post a Comment