Re: [Flashcoders] getBounds AS3/AS2 issue (SOLVED)

2008-03-12 Thread Ian Thomas
Followup on this issue for the archives...

Eder Fortunato from Brazil suggested setting _lockroot=true on App C.
This solves the problem.

Cheers,
   Ian

On Tue, Mar 11, 2008 at 10:14 AM, Ian Thomas <[EMAIL PROTECTED]> wrote:
> Further to this (again) I've investigated the whole thing in some
>  depth, and come up with this:
>
>  The bug affects 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
>
>  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
>
>  P.S. Fairly obviously, I will be reporting this to Adobe.
>
>
>
>  On Mon, Mar 10, 2008 at 5:41 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:
>  > On Mon, Mar 10, 2008 at 5:38 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:
>  >
>  >  >  Using MovieClip.getRect() or MovieClip.getBounds() within b) (or a, of
>  >  >  course) works fine.
>  >  >
>  >  >  Using MovieClip.getRect() or MovieClip.getBounds() within c) returns
>  >  >  undefined (at least, in my setup).
>  >
>  >  Sorry - to be clearer - using getRect() or getBounds() _on any object_
>  >  in c) returns undefined. If you write code in c) that calls getRect()
>  >  or getBounds() on b) e.g. _parent.getBounds(_parent) works fine.
>  >
>  >  Ian
>  >
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-11 Thread Ian Thomas
Further to this (again) I've investigated the whole thing in some
depth, and come up with this:

The bug affects 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

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

P.S. Fairly obviously, I will be reporting this to Adobe.

On Mon, Mar 10, 2008 at 5:41 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 10, 2008 at 5:38 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:
>
>  >  Using MovieClip.getRect() or MovieClip.getBounds() within b) (or a, of
>  >  course) works fine.
>  >
>  >  Using MovieClip.getRect() or MovieClip.getBounds() within c) returns
>  >  undefined (at least, in my setup).
>
>  Sorry - to be clearer - using getRect() or getBounds() _on any object_
>  in c) returns undefined. If you write code in c) that calls getRect()
>  or getBounds() on b) e.g. _parent.getBounds(_parent) works fine.
>
>  Ian
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread Ian Thomas
On Mon, Mar 10, 2008 at 5:38 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:

>  Using MovieClip.getRect() or MovieClip.getBounds() within b) (or a, of
>  course) works fine.
>
>  Using MovieClip.getRect() or MovieClip.getBounds() within c) returns
>  undefined (at least, in my setup).

Sorry - to be clearer - using getRect() or getBounds() _on any object_
in c) returns undefined. If you write code in c) that calls getRect()
or getBounds() on b) e.g. _parent.getBounds(_parent) works fine.

Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread Ian Thomas
Further to this, what looks like is happening is this:

There are 3 layers:

a) An AS3 App that instantiates/addChilds ->
b) An AS2 Shell _embedded_ within the AS3 App that loads ->
c) An AS2 .swf file.

a & b communicate using Grant Skinners SWFBridge, and have no problems
communicating.

Using MovieClip.getRect() or MovieClip.getBounds() within b) (or a, of
course) works fine.

Using MovieClip.getRect() or MovieClip.getBounds() within c) returns
undefined (at least, in my setup).

Running c) standalone, getRect() and getBounds() work fine.

All other code in c) and b) works fine.

At the moment it's looking like a player bug. Anyone got any other
ideas/things to test?

Cheers,
   Ian


On Mon, Mar 10, 2008 at 4:29 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:
> Thanks for that, Glen.
>
>  No loading of images in involved here. I'm just trying to retrieve the
>  sizes of objects already on the stage.
>
>  Cheers,
>Ian
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread Ian Thomas
Thanks for that, Glen.

No loading of images in involved here. I'm just trying to retrieve the
sizes of objects already on the stage.

Cheers,
   Ian

On Mon, Mar 10, 2008 at 4:20 PM, Glen Pike <[EMAIL PROTECTED]> wrote:
> Not sure if this applies to AS3, but in AS2, you had problems getting
>  the width & height of loaded images & swfs until they were completely
>  loaded.
>
>  The AS2 method was to implement the onLoadInit() function of the
>  MovieClipLoader class and get info there.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread Glen Pike
Not sure if this applies to AS3, but in AS2, you had problems getting 
the width & height of loaded images & swfs until they were completely 
loaded.


The AS2 method was to implement the onLoadInit() function of the 
MovieClipLoader class and get info there.


Glen

Ian Thomas wrote:

Hi Eka,
   Thanks for that - I'm well aware of the limitations. I'm using
Grant Skinner's SWFBridgeAS2 to talk between the two VMs. The problem
isn't that AS2 code isn't working - the rest of the contained AS2
MovieClip is running correctly, including all scripts. The only
function failing is MovieClip.getBounds(), which is why I'm confused.

Cheers,
   Ian

On Mon, Mar 10, 2008 at 4:06 PM, ekameleon <[EMAIL PROTECTED]> wrote:
  

hello :)

 PS : in AS3 application AS2 code source can't work... the AVM2 (new virtual
 machine of the flashPlayer 9) can't use AVM1 scripts (AS1 or AS2)

 eKA+ :)


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


--

Glen Pike
01736 759321
www.glenpike.co.uk 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread Ian Thomas
Looking at it, it's MovieClip.getRect() too. How weird - must be some
sort of display parenting issue. I'll dig deeper and see what I can
find out; must be some sort of player bug.

Any and all ideas welcomed - I can't dream up a way to fake
getBounds() immediately (without some fancy blitting around of
Bitmaps, and that's much too heavyweight).

Cheers,
  Ian

On Mon, Mar 10, 2008 at 4:16 PM, Ian Thomas <[EMAIL PROTECTED]> wrote:
> Hi Eka,
>Thanks for that - I'm well aware of the limitations. I'm using
>  Grant Skinner's SWFBridgeAS2 to talk between the two VMs. The problem
>  isn't that AS2 code isn't working - the rest of the contained AS2
>  MovieClip is running correctly, including all scripts. The only
>  function failing is MovieClip.getBounds(), which is why I'm confused.
>
>  Cheers,
>Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread Ian Thomas
Hi Eka,
   Thanks for that - I'm well aware of the limitations. I'm using
Grant Skinner's SWFBridgeAS2 to talk between the two VMs. The problem
isn't that AS2 code isn't working - the rest of the contained AS2
MovieClip is running correctly, including all scripts. The only
function failing is MovieClip.getBounds(), which is why I'm confused.

Cheers,
   Ian

On Mon, Mar 10, 2008 at 4:06 PM, ekameleon <[EMAIL PROTECTED]> wrote:
> hello :)
>
>  PS : in AS3 application AS2 code source can't work... the AVM2 (new virtual
>  machine of the flashPlayer 9) can't use AVM1 scripts (AS1 or AS2)
>
>  eKA+ :)
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread ekameleon
hello :)

PS : in AS3 application AS2 code source can't work... the AVM2 (new virtual
machine of the flashPlayer 9) can't use AVM1 scripts (AS1 or AS2)

eKA+ :)

2008/3/10, ekameleon <[EMAIL PROTECTED]>:
>
> Hello :)
>
> Test my AVM2Loader class :
>
> Référence : http://www.ekameleon.net/vegas/docs/
> Class   :
> http://svn1.cvsdude.com/osflash/vegas/AS3/trunk/src/asgard/display/AVM2Loader.as
>
> If you want install my framework :
> http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN
>
> you can use the AS3 SVN repository to checkout the sources :
> http://svn1.cvsdude.com/osflash/vegas/AS3/
>
> EKA+ :)
>
>
> 2008/3/10, Ian Thomas <[EMAIL PROTECTED]>:
> >
> > Has anyone got any idea why when I create an instance of an AVM1Movie
> > (embedded) within an AS3 app, AS2's MovieClip.getBounds() function
> > returns undefined within the contained movie whereas it works
> > perfectly well if the AS2 movie is run outside the AS3 app?
> >
> > Same result with Flex2.01 and Flex3 compilers.
> >
> > Cheers,
> >Ian
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
>
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread ekameleon
Hello :)

Test my AVM2Loader class :

Référence : http://www.ekameleon.net/vegas/docs/
Class   :
http://svn1.cvsdude.com/osflash/vegas/AS3/trunk/src/asgard/display/AVM2Loader.as

If you want install my framework :
http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN

you can use the AS3 SVN repository to checkout the sources :
http://svn1.cvsdude.com/osflash/vegas/AS3/

EKA+ :)


2008/3/10, Ian Thomas <[EMAIL PROTECTED]>:
>
> Has anyone got any idea why when I create an instance of an AVM1Movie
> (embedded) within an AS3 app, AS2's MovieClip.getBounds() function
> returns undefined within the contained movie whereas it works
> perfectly well if the AS2 movie is run outside the AS3 app?
>
> Same result with Flex2.01 and Flex3 compilers.
>
> Cheers,
>Ian
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] getBounds AS3/AS2 issue

2008-03-10 Thread Ian Thomas
Has anyone got any idea why when I create an instance of an AVM1Movie
(embedded) within an AS3 app, AS2's MovieClip.getBounds() function
returns undefined within the contained movie whereas it works
perfectly well if the AS2 movie is run outside the AS3 app?

Same result with Flex2.01 and Flex3 compilers.

Cheers,
   Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders