Hi ive got this code:
import flash.events.MouseEvent;
var myImageMovie:ImageMovie = new ImageMovie();
myImageMovie.x = 20;
myImageMovie.y = 20;
var myImageMovie2:a2 = new a2();
myImageMovie2.x = 20;
myImageMovie2.y = 20;
ab.buttonMode = true;
ab2.buttonMode = true;
ab.addEventListener (MouseEvent.CLICK, open1);
function open1 ($event:MouseEvent) {this.addChild (myImageMovie);}
ab2.addEventListener(MouseEvent.CLICK,open2);
function open2 ($event:MouseEvent) {this.addChild (myImageMovie2);}
ab and ab2 are buttons(mc’s)on my stage. ImageMovie and a2 are mcs at library which i want to attach. This works fine - when you click on button it will attach a movie in some place. There is only one problem - what if you click twice on button/click button one by one - you’ve got two loaded mc’s from library;I need to have only one. Ive tried putting some code like removeChild behind and in the front of addchild for each button but as you probably know, it will not work properly. How to solve it? please help because its really important to me:(