--- In [email protected], "criptopus" <sd_br...@...> wrote:
>
> Is it possible to find out the dimensions of an image without actually 
> loading the image?
> 
> I am going to use an image inline with a Text() object using the normal <img 
> src='xyz.png' etc and I have discovered it you state the height you also need 
> to state the width and if you state the width you have to state the height, 
> which is a pain it doesn't automatically scale one with the other.
> 
> - Stephen
>

How about 

var imgSrc:String = 'myImage_800_600.jpg'

var imgParts:Array = imgSrc.split('.');
imgParts = String(imgParts[0]).split('_');
var width:int = imgParts[1] as int;
var height:int = imgParts[2] as int;

if (width==0 || height==0) {
    throw new Error('Improperly named image source');
}

HTH;

Amy

Reply via email to