I have a movieclip symbol named "Main", which I am trying to use as an empty base to add other movieclips to.
I have two additional movieclip symbols, named "A" and "B", of whom both have .png images in them.
I am trying to have both movieclip symbols "A" and "B" show up dynamically when my actionscript tells them to. In the following code, movieclip "A" shows up fine, while movieclip "B" does not.
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Main extends MovieClip {
var A:Symbol_A;
var B:Symbol_B;
public function Main() {
A = new Symbol_A();
addChild(A);
A.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
}
function MouseUp(event:MouseEvent):void
{
B = new Symbol_B();
addChild(B);
}
}
}
I must be missing something!
I have read several things about addChild, but am not sure how much of it applies to me. My post here is an attempt to focus my search for information about adding movieclips dynamically, so I very much appreciate anyone who has advice on this matter.
EDIT: I no longer believe that there is anything wrong with this code. It was a silly typo that was giving me problems. I am not sure whether to delete the question, mark it answered, or just leave it be!
A.mouseEnabled = truebut the default value is true, so unless you changed that it's likely not the issue. Otherwise your code is fine, and this won't be enough information to go off of.