views:

505

answers:

3

Hi,

I have a little HTML based Adobe AIR project I'm playing with and I'd like to add an existing SWF to the project. Now, I can see it running via the trace/log messages coming through from the SWF, but I can't seem to call any function within the SWF. I've read that the ExternalInterface function isn't available within the Air container, which looks like the right thing to use if within a browser.

Most of the samples on the Adobe site are all HTML, or all Flex/ActionScript. Has anyone tried to pull these together successfully, either as source, or through compiled SWF?

Many thanks

Robbie

A: 

Using a compiled swf has sandboxing issues.

Maybe you can make use of LocalConnection? Here is an example.

Joel Hooks
Thanks, I never got to try this - I found an answer. See below.
Robbie
A: 

I guess this article answers pretty completely your question :

http://www.hufkens.net/2008/09/loading-remote-swf-files-in-air/

Theo.T
There are comments suggesting that doesn't work with Air 1.5, which is my target. However, I found my solution. See below.
Robbie
A: 

This basically was what I needed:

http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7ed9.html

However, my scenario was complicated in that it turns out my SWF had an embedded SWF and I was trying to access a class within the embedded SWF. Once I tried to access a class within the wrapping SWF, it all was rosy.

Cheers

Robbie

Robbie