文王武帅

2012年10月31日

模拟时钟

摘要: 下面是一个模拟时钟的例子:var second:uint;var minute:uint;var hour:uint;var myDate:Date=new Date();secondHand.rotation=myDate.getSeconds()*6;minuteHand.rotation=myDate.getMinutes()*6+myDate.getSeconds()*6/360*6;hourHand.rotation=myDate.getHours()*30+myDate.getMinutes()*6/360*30;var timer:Timer=new Timer(800);ti. 阅读全文

posted @ 2012-10-31 20:50 文王武帅 阅读(149) 评论(0) 推荐(0) 编辑

2012年10月30日

数学类 sin cos

摘要: 今天做了一个和数学类有关的例子:一个小球沿着一个圆的边旋转,小球发出一条射线,画出正弦的图像轨迹;代码如下:package{ //导入需要的类 //基类 import flash.display.Sprite; //用于绘图 import flash.display.Shape; //需要ENTER_FRAME事件 import flash.events.Event; //定义类 public class wave extends Sprite{ //定义属性 //坐标系左侧做圆周运动的圆 private var circle:Shape=new Shape(); //动态绘制正弦... 阅读全文

posted @ 2012-10-30 20:49 文王武帅 阅读(232) 评论(0) 推荐(0) 编辑

3D菜单(3)

摘要: 接着上次的写的:include "Math2.as";var menu:Sprite=new Sprite();menu.x=275;menu.y=180;menu.addEventListener(Event.ENTER_FRAME,moveMenu);this.addChild(menu);var disx:Number=200;var disy:Number=10;var speed:Number=0;initMenu(5);function initMenu(n:int){ for(var i:int;i<n;i++) { var mc:MovieClip=n 阅读全文

posted @ 2012-10-30 20:45 文王武帅 阅读(133) 评论(0) 推荐(0) 编辑

2012年10月29日

3D菜单(2)

摘要: 让图标旋转(1);写一个Math2.as;并保存和fla文件同一目录下:代码如下:function angleToRadian(angle:Number):Number{ return angle*(Math.PI/180);}function radianToAngle(radian:Number):Number{ return radian*(180/Math.PI);}function sinD(angle:Number):Number{ return Math.sin(angleToRadian(angle));}function cosD(angle:Number):Number{ 阅读全文

posted @ 2012-10-29 21:41 文王武帅 阅读(131) 评论(0) 推荐(0) 编辑

3D菜单(1)

摘要: 制作3D菜单前,首先需要设计好它的结构。(1)把库中的图片全部导出来,并放在显示对象menu中,只需输入下面代码:import flash.display.MovieClip;import flash.display.Sprite;var mc:MovieClip=new IconMenu();addChild(mc);var menu:Sprite=new Sprite();menu.x=275;menu.y=180;this.addChild(menu);initMenu(5);function initMenu(n:int):void{ for(var i:int;i<n;i++) 阅读全文

posted @ 2012-10-29 21:37 文王武帅 阅读(126) 评论(0) 推荐(0) 编辑

鼠标跟随

摘要: 我有一个朋友,也学了as3.0,他已经学了一年,以前我还不知道。最近和他联系,才知道。他把他做的一些例子 给我分享了一下。下面是一个简单的鼠标跟随。他写代码的习惯和我不同。var textStr:String="郑州信息科技职业学院";var dx:uint=20;for(var i:uint;i<textStr.length;i++){ this["text"+i]=new TextField(); this["text"+i].text=textStr.charAt(i); this["text"+i]. 阅读全文

posted @ 2012-10-29 21:11 文王武帅 阅读(120) 评论(0) 推荐(0) 编辑

2012年10月23日

做了一个小例子

摘要: 模仿 键盘手机,的选择菜单功能:import flash.events.MouseEvent;var mc:Mc=new Mc();mc.x=35.65;mc.y=92;addChild(mc);up_btn.addEventListener(MouseEvent.CLICK,up);function up(e:MouseEvent):void{ if (mc.y == 35.65) { mc.y = 140.65; } mc.y -= 35;}down_btn.addEventListener(MouseEvent.CLICK,down);function down(e:M... 阅读全文

posted @ 2012-10-23 23:01 文王武帅 阅读(138) 评论(0) 推荐(0) 编辑

2012年10月21日

简单的 MP3

摘要: 前天 做了一个MP3,当时之实现了 ,播放 暂停和 停止,今天 又修改了一下;实现了 简单的 下一曲,上一曲,歌曲名字,和歌手的图片;package { import flash.display.MovieClip; import fl.controls.*; import flash.media.Sound; import flash.net.URLRequest; import flash.media.SoundChannel; import flash.events.MouseEvent; import flash.media.SoundTransform; import fl.eve. 阅读全文

posted @ 2012-10-21 23:03 文王武帅 阅读(154) 评论(0) 推荐(0) 编辑

2012年10月19日

sound

摘要: sound类在 flash3.0中算是很常见的功能,也是很常用的,下面 简单的运用了 sound类,加载了一首歌,控制 播放 暂停 停止,和控制音量大小;package { import flash.display.MovieClip; import fl.controls.*; import flash.media.Sound; import flash.net.URLRequest; import flash.media.SoundChannel; import flash.events.MouseEvent; import flash.media.SoundTransform; im.. 阅读全文

posted @ 2012-10-19 22:25 文王武帅 阅读(261) 评论(1) 推荐(0) 编辑

2012年10月17日

画圆

摘要: 今天做了一个小小的画圆的程序,就和flash里面的工具面板上画圆的工具类似的功能;代码如下:import flash.events.MouseEvent;import flash.display.Shape;import flash.events.Event;var chuX:Number;var chuY:Number;stage.addEventListener(MouseEvent.MOUSE_DOWN,onDown)stage.addEventListener(MouseEvent.MOUSE_UP,onUp)var shape:Shape=new Shape();function . 阅读全文

posted @ 2012-10-17 21:58 文王武帅 阅读(191) 评论(0) 推荐(0) 编辑

导航