tags:

views:

43

answers:

2

Give an Image component, how can I tell the size [width and height] of the bitmap image that the Image is containing (not the size of the Image component)

Also I want to know this as soon as possible, so I think this needs to be in the Event.COMPLETE event?

Thanks!!

A: 

The BitmapData class will give you the width and height properties.

This should be available in the

protected measure()

method, which you can override if you need to do things to it.

Robusto
Is there a way to access the BitmapData class of an Image component?
John Isaacks
+2  A: 

Since Image extends SWFLoader, properties contentWidth and contentHeight are both publicly available. They are available on the "complete" event.

Accessing the Image's bitmap data might not be allowed if the Image is loaded from another domain.

jason jones