If you look at the source code for mx:Image/SWFLoader, you'll see it is
much more sophisticated than your example.  Also, you are not waiting
for the complete event so there is nothing to manipulate until then.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Sheriff
Sent: Friday, November 23, 2007 5:02 PM
To: [email protected]
Subject: [flexcoders] loading an image via actionscript

 

Ok so what is happening is when i load the image via actionscript it
scales it twice as big as when i just do 
<mx:Image source="image1.jpg"/> //Displays the correct size
automatically
    public class Test extends Sprite
    {
        internal var loader:Loader;
        public function Test(){
            super();
            loader= new Loader();
            var url:URLRequest = new URLRequest("image1.jpg");
            loader.load(url);
            this.addChild(url); //what i get is an image that is twice
the height and width i want even though the dimensions are correct. I
tried doign scaleX etc.. and nothing works
 
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,setupStage);
            
        }

 

________________________________

Get easy, one-click access to your favorites. Make Yahoo! your homepage.
<http://us.rd.yahoo.com/evt=51443/*http:/www.yahoo.com/r/hs>  

 

Reply via email to