Solved

How to import external images at runtime as a class?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA for Outlook Web App 5 402
Non-Cloud Bookmark Manager 3 76
What do you call the following portion of a Web Application 12 78
Video and audio capture on Windows 7 3 86
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
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…
This video teaches users how to migrate an existing Wordpress website to a new domain.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

806 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