今天有个设计师问我这个了,我对as3很熟悉了,as2的忘了很多,于是查了下帮助文档记录下:
[code]
//as2
f=false;
onMouseDown = function ()
{
//trace(f);
if(!f)
{

stop();
}
else
{
play();
}
f=!f;
}
[/code]
~~~~~~~~~~~~~~~~~~我是分割线~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[code]
//as3
import flash.events.MouseEvent;
stage.addEventListener(MouseEvent.CLICK,doClick);
var f:Boolean=false;
function doClick(e:MouseEvent):void
{
//trace(f);
if(!f)
{

stop();
}
else
{
play();
}
f=!f;
}
[/code]