Without a loaderContext, many errors appear (below) as loader.content is
null in this call...

(loader.content as Object).application.myswfroutine(someid)


Let me build a demo app. and let you see for yourself what's going on.





VerifyError: Error #1053: Illegal override of concurrency in
mx.rpc.http.mxml.HTTPService.

    at flash.display::MovieClip/nextFrame()
    at
mx.managers::SystemManager/deferredNextFrame()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\SystemManager.as:322]
    at
mx.managers::SystemManager/preloader_initProgressHandler()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\SystemManager.as:3094]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
mx.preloaders::Preloader/timerHandler()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\preloaders\Preloader.as:399]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()



TypeError: Error #1009: Cannot access a property or method of a null object
reference.
    at mx.managers::SystemManager/
http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C
:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\SystemManager.as:3213]
    at
mx.managers::SystemManager/docFrameListener()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\SystemManager.as:3065]



On Sat, Jan 30, 2010 at 10:07 PM, Alex Harui <[email protected]> wrote:

>
>
> 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"; <http://myhost.com/foo.swf%22>);
> 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<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<flexcoders%40yahoogroups.com>>
>  <mailto:flexcoders%40yahoogroups.com <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