Reputation: 1176
Can I get the height of an image from its URL information in ActionScript 3?
I have the image URL. I want to draw the image in my UI and I want to set the height of the drawing area dynamically upon getting the image.
Upvotes: 2
Views: 561
Reputation: 74
You can use the loader class.
Once the image is loaded in the object, use loaderInfo
for getting the image properties.
Upvotes: 1
Reputation: 59471
You can read the height/width of an image only after loading it to your SWF. Load the image using a Loader
instance, cast the loader.content
to Image
, read the height and width of its bitmapData
.
Upvotes: 2