易截截图软件、单文件、免安装、纯绿色、仅160KB

flash 方向箭头

前几天一个3D项目上要运用到 方向箭头(鼠标往哪移,箭头就转动一定的角度指向哪)!!
demo: http://6921.ggii.net/swf/ok.swf
操作是: 按下鼠标,并且移动鼠标观察效果!
下面将其代码贴出来:
MC是箭头影片剪辑   实例为arro
Circle 是一个转动的园  按下鼠标,固定在按下点处 实例 circle
代码是在时间轴上写的:
var arro:Sprite= Sprite(new MC());
var circle:MovieClip= MovieClip(new Circle());
arro.name="arro";
circle.name="circle";
stage.addEventListener(MouseEvent.MOUSE_DOWN,onDown,false,1,true);
stage.addEventListener(MouseEvent.MOUSE_UP,onUp,false,1,true);
stage.addEventListener(MouseEvent.MOUSE_MOVE,onMove,false,1,true);
addEventListener(Event.ENTER_FRAME,onFrame,false,1,true);
var tx,ty,gx,gy:int;
var isDown:Boolean;
function onDown(e:MouseEvent) {
 isDown=true;
 tx=e.stageX;
 ty=e.stageY;
 Mouse.hide();
 addChild(circle);
 positionCircle(tx,ty);
}
function onUp(e:MouseEvent) {
 graphics.clear();
 isDown=false;
 Mouse.show();
 if (getChildByName(circle.name)!=null) {
  removeChild(circle);
 }
 if (getChildByName(arro.name)!=null) {
  removeChild(arro);
 }
}
function onMove(e:MouseEvent) {
 gx=e.stageX;
 gy=e.stageY;
 if (isDown) {
  addChild(arro);
  arro.x=gx;
  arro.y=gy;
 }
}
function positionCircle(tx:int,ty:int) {
 circle.x=tx;
 circle.y=ty;
}
function onFrame(e:Event) {
 // 处理鼠标旋转
 var disX:int=gx-tx;
 var disY:int=gy-ty;
 var angle:Number=Number(Math.atan(disY/disX)*180/Math.PI);// atan返回的是弧度值,要转换为角度值
 //if (disX == 0) {  这里不需要处理  这点是特殊点 可以忽略不计
 //if(disY>=0){
 //
 //angle=90}else{
 //
 //angle=270
 //
 //
 //
 //}
 //}
 //
 if (disX>0) {
  //do nothing
 }
 if (disX<0) {
  


相关文档:

(转载)Flash AS 入门到精通教程


Flash AS 入门到精通教程
      本文详细介绍Flash AS 入门到精通教程
  用Flash制作动画,光凭时间轴和图层来演绎画面,即使动画再精彩,也只能让观赏者盯着屏幕,沿着时间线的进度被动的欣赏。如果要想动画具有交互性,根据观赏者的选择来控制播放的顺序或者呈现不同的内容就非得依靠Fla ......

Necklace USB Flash Drive

All metal heart shaped necklace containing an 8 GB USB flash drive.
These days a
USB flash drive
is as necessary as your house keys. Whether you are
taking large work files back and forth from the office or are sharing pictures
and music with friends, nothing beats the convenience of a USB ......

flash + php 文件上传

 import flash.net.FileFilter;
import flash.net.FileReferenceList;
import fl.controls.Button;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.HTTPStatusEvent;
import flash.display.Loader;
import flash.net.URLRequest;
var ......

H JTAG V0.9.2 烧录nand flash的方法

  H-JTAG V0.9.2 烧录nand flash的方法
说明:
      本文以S3C2410的开发板说明用H-JTAG烧录程序到nand flash的方法。
      本文烧录K9F1208的8bit nand flash。
1. 到http://www.hjtag.com/download.html下载H-JTAG V0.9.2
2. 安装H-JTAG V0.9.2
3. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号