That's the catch 22 of crossdomain swfs.  We expect to have better
support for crossdomain flex apps, but not in the next release as it is
quite a bit of work.

 

If the two apps are in the same sandbox, you can get to loader.content
and call setActualSize to size it differently.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of ivansebastiansurya
Sent: Monday, May 21, 2007 5:28 PM
To: [email protected]
Subject: [flexcoders] Re: Secuity sandbox violation when SwfLoader is
used to load swf file from a URL

 

Hi everyone,

I did manage to get my application working. What I had to do was put 
Security.allowDomain("*") in my parent swf movie.

However, I got two issues:
1. The sub movie doesn't get scaled properly (no scrollbar although 
it's needed as the submovie is bigger than the space if not scaled) 
and it doesn't work if they are in different domain, e.g. parent 
movie is in www.abc.com and submovie is in www.ade.com
2. If I host both the parent and child movie from the same host but 
in different webapps, the application loads and scaled properly, 
however, the child application can't interact with its servlets which 
provides its data.

So at the moment it only works if I put both the parent and child
(sub) movie in the same webapps, i.e. I put the parent movie in the 
webapp folder of the child movie and run it from tomcat.

Any idea?
Thanks,

Ivan.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> I don't have the exact answer, but in my model of the world, swfs 
from
> the file system don't have a domain so there's no way to check the
> crossdomain and allow sandbox importing.
> 
> 
> 
> Once you are in the web tier, you do have a domain name and
> crossdomain.xml takes effect. If the sub-swf is a Flex swf, it 
will try
> to ask its parent questions. By getting the crossdomain.xml 
correct and
> loading into the same security domain it should work. Flex does not
> currently support loading other Flex apps into separate security
> domains.
> 
> 
> 
> -Alex
> 
> 
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>

[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of ivansebastiansurya
> Sent: Monday, May 21, 2007 12:00 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Secuity sandbox violation when SwfLoader 
is
> used to load swf file from a URL
> 
> 
> 
> Thanks for your reply first of all ;)
> So, what's the sandbox rules when the main app is launched from a 
> web server then? I think the illegal access is when the sub 
> application (loaded swf) tried to access the parent swf. The funny 
> thing is, I don't have any code in my sub application where I 
> request access to the parent application.
> Thanks for your time. It's greatly appreciated.
> 
> Ivan. 
> 
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > The sandbox rules when the main app is launched from the file 
> system is
> > different than when the main app is launched from a web server.
> > 
> > 
> > 
> > -Alex
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:[email protected]
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of ivansebastiansurya
> > Sent: Sunday, May 20, 2007 9:35 PM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Secuity sandbox violation when SwfLoader is 
> used
> > to load swf file from a URL
> > 
> > 
> > 
> > Hi everyone,
> > 
> > I wrote an application that has an SWFLoader to load another swf 
> > movie/application into the main application.
> > 
> > The server where my sub application is served from already has 
the 
> > crossdomain.xml, letting any domain to access data from it.
> > 
> > However, I got the following error message:
> > SecurityError: Error #2047: Security sandbox violation: parent: 
> > http://submovie.swf <http://submovie.swf>  <http://submovie.swf
<http://submovie.swf> > <http://submovie.swf <http://submovie.swf> 
> <http://submovie.swf <http://submovie.swf> > > cannot access
> > file:///C:/Documents <file:///C:\Documents>  <file:///C:\Documents> 
<file:///C:\Documents>
> and 
> > Settings/IvanS/My Documents/Flex Builder 2/parentApp.swf.
> > at flash.display::DisplayObject/get parent()
> > at mx.managers::SystemManager/::executeCallbacks()
> > at mx.managers::SystemManager/::docFrameHandler()
> > 
> > Does anyone have any idea how to handle this?
> > Thanks,
> > 
> > Ivan.
> >
>

 

Reply via email to