Solved

How to import external images at runtime as a class?

Posted on 2008-10-10
3
184 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Adobe Indesign CS6 4 131
Problem to file 3 83
Is there a tool that can take a URL, scan the page and identify dead links? 9 76
Grunt script for Build Process 1 43
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

828 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