Try not setting a loaderContext and just using loadForCompatibility.  If both 
apps are on myhost.com, it should center correctly.


On 1/30/10 9:29 AM, "jamesfin" <[email protected]> wrote:








This is my loader code which is built with sdk3.4.  The foo.swf is built with 
3.2 thus the loadForCompatibility=true.  No problems loading it.

loader = new SWFLoader();
addChild(loader);
var context:LoaderContext = new LoaderContext();
context.securityDomain = SecurityDomain.currentDomain;
context.applicationDomain = new ApplicationDomain();
loader.loaderContext = context;
loader.load("http://myhost.com/foo.swf";);
loader.loadForCompatibility = true;
loader.trustContent = true;

If trustContent is true or false, it doesn't change anything in that you can 
see 100% of the dialog (it isn't clipped).

So, show me some code that can center this dialog in this use-case.  If the 
dialog can be shown it can certainly be somehow centered.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com> , Alex 
Harui <aha...@...> wrote:
>
> If the sub-app is in a separate sandbox it gets centered to its sandbox as it 
> is clipped to that area.
>
>
> On 1/29/10 7:42 PM, "jamesfin" <james.alan.finni...@...> wrote:
>
>
>
>
>
>
> In addition...
>
> Depending on where the loader is in the display list, the popup seems to move 
> around relative to it.
>
> // AS3
> loader = new SWFLoader();
> addChild(loader);
>
> // MXML
> <mx:SWFLoader id="loader"/>
>
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>  
> <mailto:flexcoders%40yahoogroups.com> , "jamesfin" <james.alan.finnigan@> 
> wrote:
> >
> > I've been studying the sub application functionality lately and have a 
> > question.
> >
> > If a multi-versioned sub application wants to put up a popup via the popup 
> > manager, it all works well except that the centerPopUp doesn't seem to work 
> > correctly in that it isn't centered in the Main application.  This is 
> > probably due to that the loadForCompatibility is true and the docs note the 
> > following:
> >
> > "There are several ways to access the methods and properties of the main 
> > application from the sub-application. These ways only work for 
> > sub-applications that are loaded as children into a main application's 
> > application domain. You cannot use these for sandboxed applications, or for 
> > multi-versioned applications.
> >
> > These methods include:
> >
> >       Using the application property of the Application class. This 
> > property accesses the root application from anywhere in the application. 
> > For more information, see Accessing document and application scopes.
> >
> >       Using the parentDocument property of the Application class. This is 
> > useful if you have multiple applications embedded and want to just access 
> > the immediate parent. For more information, see Accessing document and 
> > application scopes."
> >
> >
> >
> > So, I'll take PopUps in a multiversion sub application for $100...
> >
> >
> >
> > What do I pass for the createPopUp first parameter to get it to center on 
> > the main application hosting the sub application?  Or, can the main 
> > application/parent move the window after it appears perhaps? Or, better 
> > yet, the best solution?
> >
> >
> > public static function createPopUp(parent:DisplayObject...
> >
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to