摘要:
package{importflash.display.Bitmap;importflash.display.BitmapData;importflash.display.Sprite;importflash.events.MouseEvent;importflash.geom.ColorTransform;importflash.geom.Matrix;publicclassMainextendsSprite{vara:Sprite;//用来显示拾取颜色的小方块varxin:BitmapData;//存放当前新绘制出来的颜色publicfunctionMain():void{init();} 阅读全文
摘要:
package{importflash.display.Sprite;importflash.events.Event;importflash.media.Sound;importflash.media.SoundChannel;importflash.media.SoundMixer;importflash.net.URLRequest;importflash.utils.ByteArray;//字节数组类publicclassMainextendsSprite{privatevarurl:String="music.mp3";privatevarsound:Sound= 阅读全文
摘要:
//绘制刻度类packagecom{importflash.display.Shape;publicclassBoxextendsShape{publicfunctionBox(){init();}privatefunctioninit():void{this.graphics.beginFill(0x00ff00);this.graphics.drawRect(-3,-85,6,25);//矩形条宽6this.graphics.endFill();}}}//绘制时钟的指针类packagecom{importflash.display.Shape;publicclassXianextendsS 阅读全文
摘要:
package{importflash.display.Bitmap;importflash.display.Loader;importflash.display.Shape;importflash.display.Sprite;importflash.events.Event;importflash.events.MouseEvent;importflash.filters.BlurFilter;importflash.net.URLRequest;publicclassMainextendsSprite{privatevar_pic:Loader;privatevar_pic2:Loade 阅读全文
摘要:
文档类package{importcom.Boll;importflash.display.Sprite;importflash.display.StageScaleMode;importflash.events.Event;publicclassMainextendsSprite{//小球的范围内上下左右的极限边界值privatevarleft:uint=43;privatevarright:uint=457;privatevartop:uint=43;privatevarbottom:uint=247;publicfunctionMain():void{//舞台设为无缩放模式stage.s 阅读全文
摘要:
文档类package{importcom.RectShape;importflash.display.Sprite;importflash.events.MouseEvent;publicclassMainextendsSprite{//方块的排列数组privatevarindexshape:Array=newArray(1,2,3,4,5,6,7,8);//记录地图某个位置是否占用了小方块的坐标数组privatevarditu:Array=newArray(newArray(3),newArray(3),newArray(3));//记录小方块的排列位置privatevarpailie:Ar 阅读全文
摘要:
package{importflash.display.Sprite;publicclassMainextendsSprite{publicfunctionMain():void{//---正则表达式---//普通字符匹配vara:RegExp=/abc=/g;varb:String="AAAAabc=CCCCBBBBB";trace(b.match(a));//将指定的字符a在数据b中匹配//11个被保留的特殊原字符[]\^$.|?*+()vara1:RegExp=/a\/\+bc=/g;//斜杠/和加号+左边都要加上\用来转义varb1:String="AAA 阅读全文
摘要:
package{importflash.display.Sprite;importflash.events.Event;importflash.net.URLLoader;importflash.net.URLRequest;publicclassMainextendsSprite{varjiazai:URLLoader=newURLLoader();publicfunctionMain():void{//加载XMLjiazai.load(newURLRequest("abc.xml"));//监听是否加载完成jiazai.addEventListener(Event.CO 阅读全文
摘要:
package{importflash.display.Sprite;importflash.xml.XMLDocument;publicclassMainextendsSprite{privatevarxl:XML;publicfunctionMain():void{xl=newXML("<root>"+"<username='王翔'>a1内容</user>"+"<username='陈璨'>a2内容</user>"+"<us 阅读全文
摘要:
package{importflash.display.Sprite;importflash.xml.XMLDocument;publicclassMainextendsSprite{privatevarxl:XML;publicfunctionMain():void{xl=newXML("<root>"+"<username='王翔'>a1内容</user>"+"<username='陈璨'>a2内容</user>"+"</r 阅读全文