最新flash课件源码下载范文模板 16页Word文档下载推荐.docx
- 文档编号:14549731
- 上传时间:2022-10-23
- 格式:DOCX
- 页数:13
- 大小:23.90KB
最新flash课件源码下载范文模板 16页Word文档下载推荐.docx
《最新flash课件源码下载范文模板 16页Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《最新flash课件源码下载范文模板 16页Word文档下载推荐.docx(13页珍藏版)》请在冰豆网上搜索。
也可以用记事本,保存为UTF-8编码,名为ShapeTool.as即可。
3.在flash文件或已经做好的课件的第一帧加入代码:
if(shapetool==null){
importShapeTool;
varshapetool:
ShapeTool;
shapetool=newShapeTool(stage);
stage.addChildAt(shapetool,stage.numChildren);
}
4.导出生成swf文件即可。
三、要复制的代码:
package{
importflash.display.Sprite;
importflash.display.Shape;
importflash.display.SimpleButton;
importflash.geom.Matrix;
importflash.display.GradientType;
importflash.display.SpreadMethod;
importflash.text.TextField;
importflash.text.TextFormat;
importflash.text.TextFieldAutoSize;
importflash.text.TextFieldType;
importflash.display.DisplayObject;
importflash.display.Bitmap;
importflash.display.BitmapData;
importflash.events.MouseEvent;
importflash.events.Event;
importflash.geom.Point;
importflash.ui.Mouse;
importflash.display.CapsStyle;
importflash.utils.setTimeout;
publicclassShapeToolextendsSprite{privatevarclock:
Boolean=false;
privatevarshapeToolBar:
Sprite;
//按钮相关privatevararrTools:
Array=newArray(9);
privatevartoolButtons:
privatevarcurrentButton:
String="
"
;
privatevartmpCurrentButton:
//舞台和画布privatevar_stage;
privatevarcanvas:
Sprite=newSprite();
privatevarcountSprite:
Array=newArray();
privatevarcountNumber:
uint;
//定位点、Shift钮、鼠标、统计绘图数、撤销统计privatevarpoint:
Point=newPoint();
privatevarshiftdown:
privatevar_mouse:
privatevartotalDraw:
uint=0;
privatevarcancleCount:
privatevarnewCancle:
//颜色privatevarcolordb:
privatevarcolor:
uint=0xFF0000;
privatevar_examples:
//线大小privatevar_linesize:
uint=2;
privatevarlineBox:
//打开关闭privatevaropenbutton:
SimpleButton;
privatevarclosebutton:
varmaskbg:
//暂停控制privatevar_pause:
//帮助varhelpBar:
//******************程序开始***************************************************publicfunctionShapeTool(_Stage:
DisplayObject):
void{_stage=_Stage;
_stage.addEventListener(KeyboardEvent.KEY_UP,shiftDown);
init();
}privatefunctioninit(){//添加工具箱shapeToolBar=newSprite();
shapeToolBar.graphics.beginFill(0xCFCCEA,.8);
shapeToolBar.graphics.lineStyle(1,0xCFCCFA);
shapeToolBar.graphics.moveTo(0,0);
shapeToolBar.graphics.lineTo(400,0);
shapeToolBar.graphics.moveTo(400,0);
shapeToolBar.graphics.curveTo(415,0,430,27);
shapeToolBar.graphics.lineTo(0,27);
shapeToolBar.graphics.lineTo(0,0);
shapeToolBar.graphics.endFill();
this.addChild(shapeToolBar);
shapeToolBar.x=-398;
shapeToolBar.y=_stage.stageHeight-shapeToolBar.height;
//添加按钮vari:
vartoolbutton:
for(i=0;
i<
12;
i++){vartool=ToolSprite();
shapeToolBar.addChild(tool);
tool.x=25*i;
tool.x+=i>
10?
100:
(i>
8?
90:
=7?
80:
=5?
70:
60)));
tool.y=4;
arrTools[i]=tool;
}for(i=0;
i++){toolButtons[i]=toolbutton=toolButton(i);
arrTools[i].addChild(toolButtons[i]);
toolButtons[i].x=toolButtons[i].y=2;
}//添加侦听toolButtons[0].name="
line"
toolButtons[0].addEventListener(MouseEvent.CLICK,setButtonState);
toolButtons[1].name="
curveline"
toolButtons[1].addEventListener(MouseEvent.CLICK,setButtonState);
toolButtons[2].name="
rect"
toolButtons[2].addEventListener(MouseEvent.CLICK,setButtonState);
toolButtons[3].name="
circle"
toolButtons[4].name="
text"
toolButtons[4].addEventListener(MouseEvent.CLICK,setButtonState);
toolButtons[5].addEventListener(MouseEvent.CLICK,showColorBox);
toolButtons[6].addEventListener(MouseEvent.CLICK,showLineSize);
toolButtons[7].addEventListener(MouseEvent.CLICK,cancelDraw);
toolButtons[8].addEventListener(MouseEvent.CLICK,reDraw);
toolButtons[9].addEventListener(MouseEvent.CLICK,clearDraw);
toolButtons[10].addEventListener(MouseEvent.CLICK,pauseDraw);
toolButtons[11].addEventListener(MouseEvent.CLICK,showHelpBar);
////////shapeToolBar.addEventListener(MouseEvent.MOUSE_OVER,shapeToolBarEvent);
shapeToolBar.addEventListener(MouseEvent.MOUSE_OUT,shapeToolBarEvent);
////色选择colordb=getColor();
colordb.name="
colordb"
colordb.addChild(_examples);
//线选择addLineBox();
///帮助面板helpBarStyle();
//打开关闭按钮openbutton=openButton("
open"
);
openbutton.addEventListener(MouseEvent.CLICK,opentool);
shapeToolBar.addChild(openbutton);
openbutton.x=shapeToolBar.width-27;
openbutton.y=8;
openbutton.name="
openbutton"
//closebutton=openButton("
close"
closebutton.addEventListener(MouseEvent.CLICK,opentool);
sh
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新flash课件源码下载范文模板 16页 最新 flash 课件 源码 下载 范文 模板 16