Hi Guys,
For some reason, unbeknown to me, whenever I try to call the removeMovieClip function in a callback handler, it just doesn’t work! Maybe I’m tired, or I’ve just missed something this is apparantly obvious. In my code exert below, is just a simple script that attaches a movie clip to stage (square_mc) and creates a duplicate instance. When the component button is clicked, I want the original movie clip to be deleted, but nothing happens!
this.attachMovie("square", "square_mc", this.getNextHighestDepth());
square_mc.duplicateMovieClip("square_mc2", this.getNextHighestDepth(),
{_x:50});
var listener:Object = new Object;
listener.click = function(evtObject:Object) {
square_mc.removeMovieClip();
}
delete_btn.addEventListener("click", listener);
If anybody could be as so generous to help me, I would very grateful. Much appreciated.
TAJ