I have a bit of a problem.
I am trying to build a site in Flash, and the structure i have in mind is like this:
Main movie
|_ Menu class / swf
| |_ Button class / instances
|_ Movie loader class / swf
so how do I let the buttons in my menu, which are in a different class/swf tell the MovieLoader class/swf to load something, and at the same time passing some values?
if I am looking at this wrong, I am open to suggestions on how I should build it… thanks!
i saw this method from another site, and tried it out.
i tried adding a MouseEvent.CLICK listener to each Button instance in Menu class / swf, which just dispatches the event.
button_instance.addEventListener(MouseEvent.CLICK, clickHandler);
private function clickHandler(e:MouseEvent):void{
dipatchEvent(e);
}
Then in my Main movie, I add another CLICK listener to the Menu class / swf with useCapture set to ‘true’ to trace what object is clicked. It is tracing the different components of the Button instance (Sprites, TextFields), and not the Button itself…
any ideas?
menu.addEventListener(MouseEvent.CLICK, menuClickHandler, true);
private function menuClickHandler(e:MouseEvent):void{
trace (e.target);
}