I want to load an image, and then change widht and height of this .jpg. So I’m making something like this:
_imageSprite = new Sprite();
var imgRequest:URLRequest = new URLRequest( "data/image.jpg" );
var imgLoader = new Loader();
_imageSprite.addChild( imgLoader );
imgLoader.load( imgRequest );
imgLoader.addEventListener( IOErrorEvent.IO_ERROR , function( e:IOErrorEvent ):void { trace( e ); } );
stage.addChild( _imageSprite );
Then when I try to change _imageSprite .x or .y properties it’s working. But when I change width or height, the image is hiding? It’s just not in the screen.
Even if I try to get _imageSprite.widht, I’m getting 0? Why?
Maybe I’m doing something wrong? Because I need to get width and height of this image. Also to change this properties.