actionscript 3 - Using the Loader display object to load X jpegs, then resize each of the images differently while they're on the stage -
Hey, I was thinking that it is possible
I am able to load the image And it is easily displayed using the addChild (myLoader); The private private sector problem where myLoader is in the classroom is that whenever I call my function inside the range that connects the loader to the stage, it clears the old and this new one even here Keeps, even if I add a little bit where I change my letter. It has completed it is a serious barrier because I can not know anything about how I will need to load and write X times. The problem is that the URL is read from the XML file.
My main wish was that my loaders used to be in a class-wide private array and I was always using my Array Push (my loader). The load was completed.
Public class images expands Sprite {Personal Work Imagesloaded = 0; This is a problem that it is compiled but they never display Private Vair myLoader: Loader; ... public function picture (): zero {myLoader = new loader; // loop url calls a myLoader.load (imageURL) to a group of myLoader.contentLoaderInfo.addEventListener (Event.Complete, Image Loaded); } Public function image loaded {myArray [imagesLoaded] = myLoader; Trace ("does \ nt reach here !!"); AddChild (myArray [imagesLoaded]); ImagesLoaded ++; }}
You can create multiple loaders to load your multiple files:
Public squares provide sprites {personal var imagesLoaded = 0; Private opponent myArray: array; ... public function picture (): zero {myArray = []; (Var url: string in myBunchOfURLS) loadURL (url) for each; } Private function loadURL (url: string): zero {var loader: loader = new loader (); Loader.contentLoaderInfo.addEventListener (event.complete, imageloaded); Loader.load (new URLRequest (url)); // You must add the loader to the display list to see something! AddChild (loader); } Private function imageLoaded (Event: Event): Zero {var info: LoaderInfo = LoaderInfo (event.currentTarget); Info.removeEventListener (event.complete, imageloaded); Var Loader: Loader = info.loader; MyArray [imagesLoaded ++] = Loader; // Or you can add the loader to the display list instead? }}
If you have a loader, you have to wait to complete each load, get bitmap data from loaded bitmap, add it to a new bitmap, Then start loading the next image. It is a bit more of a pain - if I were you, then I stuck to this approach.
Comments
Post a Comment