什么是动作3.0代码,使一个非常简单的按钮,使用户到下一帧?如果我在ActionScript 2.0中没有记错,它是: instance_name.onPress = function(){ gotoAndStop(2) } 或类似的东西。但是,ActionScript 3.0并非如此。那么有人可以让我知道吗?谢谢!什么是制作简单按钮的ActionScript 3.0代码?
1
A
回答
3
ActionScript 3的使用基于事件系统,所以当用户点击一个DisplayObject通知,你要听的点击MouseEvent。
myDisplayObject.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(event:MouseEvent):void {
event.target.gotoAndStop(2);
}
0
function eventResponse(evt:MouseEvent):void {gotoAndStop(2);}
yourButton.addEventListener(MouseEvent.MOUSE_UP,eventResponse);
1
的答案在这里有对功能corret功能,但有一个考虑用户体验过,你可能要指定这些值:
myDisplayObject.buttonMode = true //use the "hand" cursor on mouseover
myDisplayObject.mouseChildren = false //stops the children of the button firing the event, helpful especially when having text lables etc.
0
私人VAR按钮:雪碧=新的雪碧( );
public function ButtonInteractivity()
button.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
addChild(button);
}
private function mouseDownHandler(event:MouseEvent):void {
your code!!
}
相关问题
- 1. Actionscript 3:简单按钮
- 2. 按钮在ActionScript 3.0工作了
- 3. 简单的Arduino按钮LED代码
- 4. Actionscript 3.0:制作一组按钮实例名称
- 5. 什么是最简单的方法来模拟Actionscript 3.0中的传递引用?
- 6. 将ActionScript 2.0代码转换为ActionScript 3.0
- 7. 什么是单选按钮的CSS选择器硒代码?
- 8. 选择Telerik单选按钮的代码是什么?
- 9. 如何制作简单的java按钮?
- 10. 如何制作简单的XNA按钮?
- 11. Actionscript 3.0按钮不起作用,但有一些是
- 12. 为什么不是这个简单的PHP/MySQL代码工作?
- 13. 调试ActionScript类文件最简单的方法是什么?
- 14. 为什么不是'滚动到顶部'按钮代码工作?
- 15. ActionScript 2.0和ActionScript 3.0之间的区别是什么
- 16. 什么是最简单的Python代码绘制简单的图表(比MATLAB简单)
- 17. 什么是一些简单的JQuery按钮?
- 18. 我简单的代码是不工作
- 19. 最简单的源代码控制 - 你使用什么?
- 20. 如何添加一个简单的按钮actionscript
- 21. 一个简单的代码,返回的结果是什么?
- 22. 这个简单的PHP代码是做什么的?
- 23. 为什么这个简单的代码是错误的?
- 24. 这个简单的代码是做什么的?
- 25. 为什么不会这个简单的代码突然工作?
- 26. 为什么Python这个简单的代码不工作?
- 27. 简单的JavaScript代码不起作用,不知道为什么
- 28. 为什么这段简单的代码不起作用
- 29. 为什么我的简单代码不能在C++中工作?
- 30. 为什么这段代码在Perl不工作...它的简单
任何人都有答案吗? – 2011-01-27 01:09:10