摘要:
package{importflash.display.Sprite;importflash.events.TimerEvent;importflash.utils.Timer;publicclassMainextendsSprite{privatevara:Timer=newTimer(1000);publicfunctionMain():void{a.delay=500;//时间延迟半秒a.repeatCount=10;//一共运行10次a.addEventListener(TimerEvent.TIMER,yunxing);//运行时调用a.addEventListener(TimerE 阅读全文
摘要:
package{importflash.display.Sprite;importflash.utils.setInterval;//运行间隔运行函数importflash.utils.clearInterval;//停止间隔运行函数publicclassMainextendsSprite{vari:uint=1;vara:uint;publicfunctionMain():void{a=setInterval(b,1000,"当前次数:");//1000毫秒=1秒}privatefunctionb(str:String):void{trace(str+":&qu 阅读全文
摘要:
package{importflash.display.Sprite;importflash.events.ContextMenuEvent;importflash.net.URLRequest;importflash.net.navigateToURL;importflash.ui.ContextMenu;importflash.ui.ContextMenuItem;publicclassMainextendsSprite{privatevarb:ContextMenuItem=newContextMenuItem("XXX");//添加新项privatevarc:Con 阅读全文
摘要:
package{importflash.display.Sprite;importflash.display.Stage;importflash.events.KeyboardEvent;importflash.ui.Keyboard;importflash.events.Event;publicclassMainextendsSprite{privatevarflag:Boolean=newBoolean();publicfunctionMain():void{stage.addEventListener(KeyboardEvent.KEY_DOWN,a);stage.addEventLis 阅读全文
摘要:
package{importflash.display.Sprite;importflash.events.MouseEvent;importflash.ui.Mouse;publicclassMainextendsSprite{privatevarflag:Boolean=newBoolean();publicfunctionMain():void{//创建一个新光标(小方块)vara:Sprite=newSprite();a.graphics.beginFill(0xff0000);a.graphics.drawRect(0,0,50,50);a.graphics.endFill();th 阅读全文
摘要:
package{importflash.display.Sprite;importflash.text.TextField;importflash.text.TextFieldType;importflash.text.TextFormat;//文字格式类publicclassMainextendsSprite{publicfunctionMain():void{varformat:TextFormat=newTextFormat();format.bold=true;format.color=0xff0000;format.size=40;format.underline=true;//带下 阅读全文
摘要:
package{importflash.display.Sprite;importflash.text.TextField;importflash.text.TextFieldType;publicclassMainextendsSprite{publicfunctionMain():void{//创建动态文本vartxt:TextField=newTextField();txt.htmlText="<bstyle='font-size:36px'>AS3开发AS3开发AS3开发AS3开发AS3开发</b>";txt.y=100;tx 阅读全文
摘要:
//a_mc为flash中的一个影片剪辑按钮a_mc.addEventListener(MouseEvent.CLICK,an);functionan(evt:MouseEvent):void{//aaa是js的方法名,wen_txt.test是传递到js中aaa方法里的参数ExternalInterface.call("aaa",wen_txt.text);} 阅读全文
摘要:
package{importflash.display.Sprite;importflash.events.MouseEvent;importflash.media.Sound;importflash.media.SoundChannel;importflash.media.SoundTransform;importflash.net.URLRequest;publicclassMainextendsSprite{privatevar_sound:Sound;privatevar_channel:SoundChannel;privatevar_playing:Boolean=false;pri 阅读全文
摘要:
package{importflash.display.Sprite;importflash.events.MouseEvent;importflash.media.Video;importflash.net.NetConnection;importflash.net.NetStream;//播放FLV视频publicclassMainextendsSprite{varstream:NetStream;publicfunctionMain():void{//第一步:创建通道,打开通道varconn:NetConnection=newNetConnection();conn.connect(nu 阅读全文