Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to import external images at runtime as a class?

Posted on 2008-10-10
3
Medium Priority
?
193 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
2 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 1000 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 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

810 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