Joe's Blog


A blog by Joe Billman about programming, and other stuff


Archive for January, 2014

Get Spark Image width or height

Posted on: January 9th, 2014 by Joe

line No Comments

So one of the most annoying things about working with display items in the Flex framework is the difference in how things are rendered. This means that after you have created an object in AS3 code you can’t get the properties of that object until after a certain event in the creation process. Generally you need to listen to FlexEvent.CREATION_COMPLETE. After that fires you can usually get width and height etc. the Spark image is a little different. The best way that I’ve found is to listen to Event.COMPLETE and then get sourceWidth or sourceHeight instead of width or height. This one drove me nuts for longer than it should have so hopefully if you have this problem you can find this post before it drives you nuts.

Warning: Use of undefined constant Y - assumed 'Y' (this will throw an Error in a future version of PHP) in /homepages/16/d145171736/htdocs/php/footer.php on line 1