To resize an image, it is struggling to find the correct as3 code once it is dynamically I am loaded in an MC and I am loading using:
var myLoader: loader = new loader (); Mc.addChild (myLoader); Var url: URLRequest = new URLRequest ("myimage.jpg"); MyLoader .load (url);
The step will eventually open in fullscreen (works fine) so I need to keep the image in its original size which is much more than the stage.
Do I need to do this by placing the width (oh and middle) in the form of a shrinking phase on the loading of a similar height. I have tried all kinds of codes, but nothing can be found to work, because whatever MC has done I have to change the image, but the image itself is not mine. Any guidance as to the correct code will be greatly appreciated.
I think it is as simple as something like
"myimage" .x = 600;
But if that is the right way to write an image name, as I have written it is wrong. Thank you very much
ed
I try to answer your questions < / P>
Import flash.display.MovieClip; Import flash.display.Sprite; Import Flash.Display.DisplayObject; Import Flash.Display.Loader; Import Flash.Display.LoaderInfo; Import flash.events.Event; Var myLoader: Loader = New Loader (); Var image: bitmap; Var url: URLRequest = new URLRequest ("im1.jpg"); MyLoader.contentLoaderInfo.addEventListener (Event.Complete, On ImageLoaded); MyLoader.load (URL); Function on imageloaded (e: event): zero {image = new bitmap (e.target.content.bitmapData); Var mw: number = forum.stagewidth; Var MH: number = step. Location hight; / * If you set the width and height image to the stage then it will be * / image.width = mw; Image.height = mh; Mc.addChild (image); }
Comments
Post a Comment