Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to import external images at runtime as a class?

Posted on 2008-10-10
3
Medium Priority
?
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

618 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