I can't speak to the Security domain questions, but I do have an example on
communicating with a loaded SWF here:
http://www.cflex.net/showFileDetails.cfm?ObjectID=690

 

At least read that to know some of the issues.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of Karthik Kailash
Sent: Monday, December 14, 2009 2:32 AM
To: [email protected]
Subject: [SPAM] [flexcoders] Flex Application Interaction with Loaded Flash
SWFs

 

  

Hi all,

First, the background:

I am creating a Flex application with a component that displays various
dynamically loaded SWFs, one at a time (kind of like a kiosk). These loaded
SWFs are created in Flash IDE, not Flex. They will not be created by us (we
will provide a .fla template but that's it), so I am loading them into a
separate SecurityDomain.

My Questions:

1.       I want the application to be able to call methods inside the loaded
SWF. To do this, would I just call Security.allowDomain("domain original app
was loaded from") in the startup process for the loaded SWF?

2.       I want the loaded SWF to be able to throw events that are caught by
the application. Can I accomplish this through the
<http://www.adobe.com/livedocs/flex/3/langref/mx/controls/SWFLoader.html#swf
Bridge> SWFLoader.swfBridge property?

3.       I am defining an interface for the methods inside the loaded SWF.
But, I don't want to leave the implementation up to the customer. Instead, I
want to provide another SWF that contains the interface implementation and
have it be a constraint that the customer includes it in their SWF. I am not
very familiar with the Flash authoring environment, how would it work so
that the interface implementation SWF exposes its methods in such a way to
be accessible to Flex? Is there a way to sign the SWF so that the Flex
application knows that it is dealing with the original, not a spoof? How
would the Flex code pass in arguments, since it is across SecurityDomain
boundary -- is there marshalling involved (say if I want to pass in a
Dictionary or some kind of object graph)?

4.       The Flex application may load hundreds of these smaller other SWFs
during its lifetime. How do I make sure it doesn't keep using up more
memory? I plan on using SWFLoader.unloadAndStop() and clearing all
references in the Flex object that refers to it. Is this enough? Will the
AppDomain for the loaded SWF be torn down automatically so that the class
definitions are no longer in memory?

Thanks,

Karthik

 

 

Karthik Kailash | Product

SocialVision, Online Television Becomes a Social Experience

CELL . 408.768.7704  | WEB . www.socialvisioninc.com | FACEBOOK .
facebook.com/ <http://www.facebook.com/socialvision> socialvision | TWITTER
. twitter.com/ <http://twitter.com/socialvision> socialvision



Reply via email to