Re: [Flashcoders] stage.stageWidth annoyance
Anyone??? Is using timeout for this just standard practice? mario gonzalez wrote: When I compile the SWF (flash 9 / as3.0) I have a function which uses stage.stageWidth to create a grid. For the children of any object, I of course use Event.ADDED_TO_STAGE to avoid getting a null reference to stage. However this is for my document class. The hacky work around that I have is to put the function on a timeout. I feel like this shouldn't have to be done, and there must be some way of getting the right dimensions of the stage from flash on creation. Does this happen to other people? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] stage.stageWidth annoyance
I can't speak to AS3, but in AS2 I have to do an interval which constantly checks the stage width. Initially it's the size given at build time, then it switches to 0, then some time later it switches to the actual size. I have all my initialization wait until I see the size set to something other than 0 or 1 (I set everything to 1x1 at build time so I can detect it). I'd hope it's better in AS3, but maybe not. -Andy On 8/7/07, mario gonzalez [EMAIL PROTECTED] wrote: Anyone??? Is using timeout for this just standard practice? mario gonzalez wrote: When I compile the SWF (flash 9 / as3.0) I have a function which uses stage.stageWidth to create a grid. For the children of any object, I of course use Event.ADDED_TO_STAGE to avoid getting a null reference to stage. However this is for my document class. The hacky work around that I have is to put the function on a timeout. I feel like this shouldn't have to be done, and there must be some way of getting the right dimensions of the stage from flash on creation. Does this happen to other people? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] stage.stageWidth annoyance
When I compile the SWF (flash 9 / as3.0) I have a function which uses stage.stageWidth to create a grid. For the children of any object, I of course use Event.ADDED_TO_STAGE to avoid getting a null reference to stage. However this is for my document class. The hacky work around that I have is to put the function on a timeout. I feel like this shouldn't have to be done, and there must be some way of getting the right dimensions of the stage from flash on creation. Does this happen to other people? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com