Home » Archive

Articles in the Strange/Bugs Category

AS3, Strange/Bugs »

[4 Jul 2008 | No Comment | ]

Be aware of the stage property of a DisplayObject instance (any class that can be added to a Display List in order to be shown on screen). It is only accessible when the instance is added to the Display list.
I went into some troubles when trying to add an event listener on the stage to manage an onReleaseOutside mouse event for my button. The problem was that all my listeners were created in my class constructor, thus before my class could be added to the display list. So if you …

AS3, Strange/Bugs »

[20 Jun 2008 | 2 Comments | ]

I just spent 2 hours trying to solve a bug that seemed to appear only in IE.
The stage.stageWidth and stage.stageHeight properties were set to 0 at the start of the execution…
The strange thing about this bug is that it appeared only when I would refresh the page. The first time, the stage.stageWidth and stage.stageHeight properties were “ok”, but then…
Anyway, I found out how to fix this strange bug:
just force flash to re-calculate those properties by setting the scaleMode property of stage, like this :

import flash.display.StageScaleMode;
stage.scaleMode = StageScaleMode.NO_SCALE // or any …