I’m having a little problem naming my MovieClip instances. After naming each instance I added a mouse event that traces the name of that instance on MOUSE_OVER. The only instance that traced back the name I gave it is “about”. Can anyone tell me if I’m doing something wrong here?
package {
import flash.display.;
import flash.events.
public class MainMenu extends MovieClip {
var home:MovieClip = new homeBtn();
var forum:MovieClip = new forumBtn();
var shows:MovieClip = new showsBtn();
var about:MovieClip = new aboutBtn();
var members:MovieClip = new membersBtn();
var register:MovieClip = new registerBtn();
var calendar:MovieClip = new calendarBtn();
var contact:MovieClip = new contactBtn();
public function MainMenu() {
ButtonPositions();
addChild(home);
addChild(forum);
addChild(shows);
addChild(about);
addChild(members);
addChild(register);
addChild(calendar);
addChild(contact);
this.buttonMode = true;
this.addEventListener (MouseEvent.MOUSE_OVER, thisOver);
}
function thisOver (event:MouseEvent):void {
trace (event.target.name);
}
function ButtonPositions():void {
home.name = "home";
forum.name = "forum";
shows.name = "shows";
about.name = "about";
contact.name = "contact";
calendar.name = "calendar";
register.name = "register";
members.name = "members";
}
}
}