Hello I’m trying to load external swf’s with a drop menu, this menu it’s a movie clip and I,m trying to controlling it with script out of the movie clip, the main button apparently works fine but the rest of the code fail. And i want to know how can i make a script for the sub menus.
Thanks for the help, can you tell me where can i find some references to do this or if somebody explain to me what I’m doing wrong I’ll appreciated.
Sample in the file…
Thanks for watching…
this is the script:
stop();
var myLoader:Loader; [COLOR=Red][COLOR=Red][COLOR=Red][COLOR=Red][COLOR=Red]//how can i target this variable to the dropMenu movie clip instance???[/COLOR][/COLOR][/COLOR][/COLOR][/COLOR]
dropMenu.main.addEventListener(MouseEvent.CLICK, clickB);
function clickB(e:MouseEvent):void {
trace(“click”)
myLoader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, onLoaded);
myLoader.load(new URLRequest(“B.swf”));
}
dropMenu.subA.addEventListener(MouseEvent.CLICK, gotoframe); [COLOR=Red]// why this not work???[/COLOR]
function gotoframe(e:MouseEvent):void {
trace(“click”)
myLoader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, onLoaded);
myLoader.load(new URLRequest(“B.swf”));
gotoAndStop(“frame”);
}
function onLoaded(e:Event):void {
container.removeChildAt(0);
container.addChild(myLoader);
myLoader = null;
}