Skip to main content
Benjamin Waller
Known Participant
March 11, 2010
Answered

How can I display a Movie clip from library on stage in AS3?

  • March 11, 2010
  • 1 reply
  • 1249 views

Hi,

I have a movie clip in my library and I would like to display it on the stage using AS3.

do I have to define it as a variable?Do  I need to use this code:  addchild(movieclip);

can I use the 'x' and 'y' to position it?

What would the code look like?

Ben.

This topic has been closed for replies.
Correct answer spvr

Steps:

  1. Right-click Moviclip from library and choose: Linkage...
  2. Select the checkbox to Export for ActionScript.
  3. Give the class "mov_clip"
var movie:mov_clip = new mov_clip;
movie.x = 50;
movie.y = 50;
addChild:(movie);

1 reply

spvr
spvrCorrect answer
Inspiring
March 11, 2010

Steps:

  1. Right-click Moviclip from library and choose: Linkage...
  2. Select the checkbox to Export for ActionScript.
  3. Give the class "mov_clip"
var movie:mov_clip = new mov_clip;
movie.x = 50;
movie.y = 50;
addChild:(movie);
Inspiring
March 11, 2010

Typo: no colon in addChild

Benjamin Waller
Known Participant
March 11, 2010

Great! it works  well ! thanks

But I have another question, if I wanted to used the same movie clip but postion it at different x and y positions when a different btn is selected how could I do that?

Would I have to make a copy of the movie clip and give it a different name?

or is there an better way around it?

Ben.