Image of re-use of the charger - how to duplicate the image in a sprite

Hello.

I would like to be able to load an external image and then use the loaded image several times in a sprite.

So, what I can do, I need to get the image on the charger somehow and use it as a Bitmap.

Searched for a solution for this for hours now and try every possible permutation I could think, but have met a real impasse.

Really hope someone can point me in the right direction.

Here is my code:

[CODE]

Import 12345678910111213import;

var sp:Sprite = new Sprite();

addChild (sp);

var bitmapData:BitmapData;

var imageURLRequest:URLRequest = new URLRequest("images/myimage.png");

var loader: Loader = new Loader();

Loader.Load (imageURLRequest);

loader.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);

function imageLoaded(e:Event):void {}

bitmapData = e.target.content.bitmapData;

var myBitmap:Bitmap = new Bitmap;

myBitmap.bitmapData = bitmapData;

for (var i: int = 1; i < 3; i ++) {}

myBitmap.x = 300 * (i-1);

sp.addChild (myBitmap);

}

}

[/ CODE]

Any ideas how I can fix this so that the loaded image outputs 3 times of the sprite?

Thank you very much.


use:

[CODE]

Import 12345678910111213import;

var sp:Sprite = new Sprite();

addChild (sp);

var bitmapData:BitmapData;

var imageURLRequest:URLRequest = new URLRequest("images/myimage.png");

var loader: Loader = new Loader();

Loader.Load (imageURLRequest);

loader.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);

function imageLoaded(e:Event):void {}

bitmapData = e.target.content.bitmapData;

for (var i: int = 1; i<3; i++)="">

var myBitmap:Bitmap = new bitmap;

myBitmap.bitmapData = bitmapData;

myBitmap.x = 300 * (i-1);

sp.addChild (myBitmap);

}

}

[/ CODE]

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • Vista Home Premium SP1 for Windows 7 64-bit

    I have a laptop HP HDX16 with T6400 2 dual processors 200Ghz and 4 GB of RAM... currently have Vista 64-bit with SP1... How much will it cost to upgrade to Windows 7, how long take and what is the best place to get the upgrade... My laptop has only 5

  • Sharp TV RS232 command

    I work with 5.2 DMM and DMP4400G w / 5.2I try to control a TV Sharp (LC-42D65UT) through DMM system tasks.The Sharp TV is looking for text control rather than hex apparently.  Order codes are indicated in the guide.The format is 4 digits of order, of

  • T500 bios which versions? flashing or not?

    Hello lenovo community users. I have a questions about my t500 bios. When do you need to level or to Flash your bios? I flashed once, but I don't really know why and if it has done anything. can I upgrade the bios back to default settings? Thanks for

  • Event viewer errors

    I had the best ever win 7 own reinstalling. not an error or a warning, but event viewer shows me 85 errors and warnings. WHY?

  • I got Facebook on the left of the LR 6 and he disappeared. How can I get that back?

    I had Facebook on the left side of the LR 6.  His is no longer there. How can I get that back[Duplicate message deleted... post the same question more than once is confusing... MOD][This is an open forum, not a direct line to Adobe support... you hav