Does it fail for app A loading app C directly?  Maybe there is some
dependency in app C that isn't in app B like access to stage.  I won't
have time to diagnose from your sources, so maybe someone else will take
the time.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Ian Thomas
Sent: Tuesday, March 11, 2008 10:31 AM
To: [email protected]
Subject: Re: [flexcoders] AS3 loading AS2 getBounds() issue

 

Hello Alex,
This is nothing to do with communication between the VMs.

As it happens, for our actual production app, we are using Grant
Skinner's SWFBridge to communicate via LocalConnection.

But the sample Zip I've provided shows the bug, and has nothing to do
with VM->VM communication - a simple Loader component shows the
problem.

To restate the simplest test case:

AS3 app A loads AS2 app B (via a Loader component)
AS2 app B loads AS2 app C (via MovieClipLoader)

MovieClip.getRect() and MovieClip.getBounds() _fail_ within app C, and
work within app B.

No communication (other than loading) required.

Thanks,
Ian

On Tue, Mar 11, 2008 at 5:23 PM, Alex Harui <[EMAIL PROTECTED]
<mailto:aharui%40adobe.com> > wrote:

> AS3 and AS2 are different VMs and cannot access each other.
LocalConnection
> or ExternalInterface can be used instead. Google for "AS2 SWF Loader"
for
> some existing solutions.

> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Ian Thomas
> Sent: Tuesday, March 11, 2008 3:13 AM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] AS3 loading AS2 getBounds() issue
>
> Hi guys,
>
> (This is an AS3 issue rather than Flex per se, but might be of
interest.)
>
> I've discovered a strange bug with the AS2 MovieClip.getBounds() and
> MovieClip.getRect() methods.
>
> As far as I can tell, it only happens in this situation:
>
> AppA is an _AS3_ application. AppA loads AppB.
> AppB is an AS2 application. AppB loads AppC.
> AppC is an AS2 application.
>
> If you run AppA, then any getBounds() or getRect() calls on objects in
> AppC fail, but they work as expected in AppB.
>
> (If you just run AppB, then everything works as expected.)
>
> I've tried various variants of this; if, instead of loading AppB, you
> embed it into AppA at compile-time, the problem still occurs. It
> appears to be something to do with loading one VM1 movie into another
> one within a VM2 shell.
>
> For the curious, here's a Zip containing a minimal test setup:
> http://www.wildwinter.net/public/getBoundsBug.zip
<http://www.wildwinter.net/public/getBoundsBug.zip> 
>
> All suggestions for workarounds welcomed, as this is a real nuisance
> for what we're currently working on.
>
> (For reference, this is in Flash Player 9,0,115,0, using either Flex
> compiler 2.01 or Flex Compiler 3.0 for the AS3 and using Flash 8.0 or
> MTASC for the AS2.)
>
> Cheers,
> Ian
>

 

Reply via email to