如何创建两个按钮:一个按钮被按下,另一个按钮上升。我尝试使用这个:
//Create male/female button objects
var maleButton:maleButtonObejct = new maleButtonObject();
var femaleButton:femaleButtonObject = new femaleButtonObject();
//Add evnet listeners to both buttons
maleButton.addEventListener(MouseEvent.CLICK, setToMale);
femaleButton.addEventListener(MouseEvent.CLICK, setToFemale);
//Create isMale variable
var isMale:Boolean;
//Male/Female button functions
function setToMale(event:MouseEvent):void {
isMale = true;
maleButton.stop(3);
femaleButton.stop(1);
}
function setToFemale(event:MouseEvent):void {
isMale = false;
femaleButton.stop(3);
maleButton.stop(1);
}
我收到运行时错误:TypeError: Error #1006: stop is not a function。在 Untitled_fla::MainTimeline/setToFemale()