Solved

How to import external images at runtime as a class?

Posted on 2008-10-10
3
181 Views
Last Modified: 2013-11-11
Hi

I need to preload an external image into an SWF file with a unique identifier like say, img_a01.

I will than need to be able to create new instances of that image, plus assign certain generic functions to them.

This has to be done at runtime because there are about ~100 images and their URLs are stored in an XML file.

Thanks in advance
0
Comment
Question by:hedgehog-fluffy
3 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 250 total points
ID: 22705274
have a look at the Bitmap class.
create your own class that extends that class, and then add your methods accordingly.

you'll use the loader class still to load the image. read up more in the help file for more detailed explanations.
blu.
0
 
LVL 4

Assisted Solution

by:MattKenefick
MattKenefick earned 250 total points
ID: 22734431
Actionscript 2 or Actionscript 3?


If you're using 2... look at this link. http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html

You cannot duplicate MovieClips that have been dynamically loaded, so you will have to take the BitmapData out and then save that into an array and you can attach that.




if you're using AS3, you need the Loader class. Here is documentation/examples: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHP Session ID 5 80
Basics of Drool Rule Engine with few samples 2 41
Microsoft Edge 9 79
Problem to echo 6 53
A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
The goal of the tutorial is to teach the user how to how to record live broadcast.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now