We help IT Professionals succeed at work.
Get Started

AS3 MovieClip Properties Question

erzoolander asked
Last Modified: 2013-11-11
Hi -

Here's the situation.  I have a movieclip that I want to swap embedded bitmaps within - and I'm not quite sure what the proper procedure is for that.

Here's what I have now...which is pulling the images from the web server.

I don't want to do that.  Instead - I want to use bitmap images which are embedded in the .swf file.

Say the graphics are called "graphic1.gif", "graphic2.gif", "graphic3.gif" within the library.  How would I go about swapping them and what would be the right syntax for that?  

var rbg:Object=user.group;
var UserClicked:String = "";

var ldr:Loader = new Loader();
ldr.load(new URLRequest("http://www.sample.com/design1.gif"));

var mc:MovieClip = new MovieClip();
ldr.x = 300;
ldr.y = 100;

user.group.addEventListener(MouseEvent.CLICK, checkAnswer);

function checkAnswer(evt:MouseEvent):void {
	UserClicked = String(rbg.selectedData);
	ldr.load(new URLRequest("http://www.sample.com/design2.gif"));


Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE