Flash AS制作一個鉛筆畫圖程序_Flash教程
推薦:Flash使用Transitions類制作動畫實(shí)例使用FlashMX2004以上版本中的Transitions類來制作動畫,引入一幅圖片。轉(zhuǎn)變?yōu)橛捌糨嬙�。給出實(shí)例名。然后打開動作面板添加指令。指令。效果。
先看效果:
制作非常簡單,新建立文檔,然后按Ctrl J修改屬性。

按Ctrl R導(dǎo)入一幅圖片,或者自己繪制一幅鉛筆圖。

按F8轉(zhuǎn)變?yōu)樵?/P>

為該元件設(shè)置實(shí)例名。

選擇第一幀,添加如下Action。
this.attachMovie("cursor_id", "cursor_mc", this.getNextHighestDepth(),
{_x:_xmouse, _y:_ymouse});
Mouse.hide();
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
pencil._x = _xmouse;
pencil._y = _ymouse;
updateAfterEvent();
};//建立一個鉛筆圖標(biāo)
Mouse.addListener(mouseListener);//和鉛筆圖片聯(lián)系在一起
this.createEmptyMovieClip("drawing_mc", this.getNextHighestDepth());
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
this.drawing = true;
drawing_mc.moveTo(_xmouse, _ymouse);
drawing_mc.lineStyle(3, 0x99CC00, 100);
};
mouseListener.onMouseUp = function() {
this.drawing = false;
};
mouseListener.onMouseMove = function() {
if (this.drawing) {
drawing_mc.lineTo(_xmouse, _ymouse);
}
updateAfterEvent();
};
Mouse.addListener(mouseListener);
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.DELETEKEY) || Key.isDown(Key.BACKSPACE)) {
drawing_mc.clear();
}
};
Key.addListener(keyListener);
分享:用Flash制作動態(tài)放大鏡畫面效果本文中我們用Flash來制作動態(tài)放大鏡,當(dāng)這個放大鏡在畫面上移動時,放大鏡下面的圖片部分會放大顯示,很有意思!http://www.68design.net/download/flash/1pp0b
- 相關(guān)鏈接:
- 教程說明:
Flash教程-Flash AS制作一個鉛筆畫圖程序
。