Flash AS實(shí)例:神奇的數(shù)字魔術(shù)盒子_Flash教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:Flash cs3轉(zhuǎn)換位圖為矢量圖本例為Flash CS3仿真藝術(shù)設(shè)計系列教程,有興趣的朋友請關(guān)注本系列教程,本文我們將學(xué)習(xí)如何在Flash cs3中將位圖轉(zhuǎn)換成矢量圖。 轉(zhuǎn)換位圖為矢量圖 攝影圖片過去習(xí)慣被用于各種flash方案的寫實(shí)措施。他們能在初始階段被導(dǎo)入和使用�;蛘咚麄兡茏鳛橐粋特別的簡
應(yīng)閃友要求制作一個數(shù)學(xué)小實(shí)例,名字好大,其實(shí)很小。/*
神奇的魔盒
by sxl001 QQ:285510591
*/
stop();
mc.t.restrict = ". 0-9";
//限制輸入只能為數(shù)字
//go 出盒數(shù)字控制 i 排列位置用 v 運(yùn)動速度
var go:Boolean = false, i:Number = 0, v:Number = 10;
t1.text = "開始";
btn.onPress = function() {
//開始按鈕
if (mc.t.text != "") {
btn._visible = false;
t1.text = "";
v = 10;
var j:Number = i 1;
//this["m" i] this["m" j] 調(diào)出庫中m作為出盒數(shù)字載體
this["m" i] = attachMovie("m", "m" i, _root.getNextHighestDepth());
this["m" j] = attachMovie("m", "m" j, _root.getNextHighestDepth());
mask.swapDepths(_root.getNextHighestDepth());
//遮隹出盒數(shù)字
this["m" i]._x = 260;
//出盒數(shù)字位置
this["m" j]._x = 260;
this["m" i]._y = 220;
this["m" j]._y = 220;
var num:Number = Number(mc.t.text);
//取得輸入數(shù)字
this["m" i].t.text = num;
this["m" j].t.text = 2*num;
//2倍
run(mc, 240, 190, this["m" i], this["m" j]);
//移動進(jìn)盒數(shù)
go = true;
}
};
function run(target:MovieClip, endx:Number, endy:Number, target1:MovieClip, target2:MovieClip) {
target.onEnterFrame = function() {
var disx:Number = (endx-this._x)/v;
var disy:Number = (endy-this._y)/v;
this._x = disx;
this._y = disy;
if (Math.abs(this._x-endx)<=1) {
this._x = endx;
this._y = endy;
delete this.onEnterFrame;
if (go) {
v = 5;
//移動出盒的兩個數(shù)
run(target1, 410, endy-100 i*30);
run(target2, 480, endy-100 i*30);
go = false;
i ;
} else {
back_btn._visible = true;
t2.text = "再來";
}
}
};
}
back_btn._visible = false;
back_btn.onPress = function() {
this._visible = false;t2.text = "";
mc.t.text = "";
mc._x = 90;
//輸入文本框歸位
mc._y = 192;
btn._visible = true;
t1.text = "開始";
};
神奇的魔盒
by sxl001 QQ:285510591
*/
stop();
mc.t.restrict = ". 0-9";
//限制輸入只能為數(shù)字
//go 出盒數(shù)字控制 i 排列位置用 v 運(yùn)動速度
var go:Boolean = false, i:Number = 0, v:Number = 10;
t1.text = "開始";
btn.onPress = function() {
//開始按鈕
if (mc.t.text != "") {
btn._visible = false;
t1.text = "";
v = 10;
var j:Number = i 1;
//this["m" i] this["m" j] 調(diào)出庫中m作為出盒數(shù)字載體
this["m" i] = attachMovie("m", "m" i, _root.getNextHighestDepth());
this["m" j] = attachMovie("m", "m" j, _root.getNextHighestDepth());
mask.swapDepths(_root.getNextHighestDepth());
//遮隹出盒數(shù)字
this["m" i]._x = 260;
//出盒數(shù)字位置
this["m" j]._x = 260;
this["m" i]._y = 220;
this["m" j]._y = 220;
var num:Number = Number(mc.t.text);
//取得輸入數(shù)字
this["m" i].t.text = num;
this["m" j].t.text = 2*num;
//2倍
run(mc, 240, 190, this["m" i], this["m" j]);
//移動進(jìn)盒數(shù)
go = true;
}
};
function run(target:MovieClip, endx:Number, endy:Number, target1:MovieClip, target2:MovieClip) {
target.onEnterFrame = function() {
var disx:Number = (endx-this._x)/v;
var disy:Number = (endy-this._y)/v;
this._x = disx;
this._y = disy;
if (Math.abs(this._x-endx)<=1) {
this._x = endx;
this._y = endy;
delete this.onEnterFrame;
if (go) {
v = 5;
//移動出盒的兩個數(shù)
run(target1, 410, endy-100 i*30);
run(target2, 480, endy-100 i*30);
go = false;
i ;
} else {
back_btn._visible = true;
t2.text = "再來";
}
}
};
}
back_btn._visible = false;
back_btn.onPress = function() {
this._visible = false;t2.text = "";
mc.t.text = "";
mc._x = 90;
//輸入文本框歸位
mc._y = 192;
btn._visible = true;
t1.text = "開始";
};
分享:Flash CS4教程:3D旋轉(zhuǎn)和3D位移Flash CS4的3D工具很容易上手。在工具欄里有兩個處理3D變形的工具:3D旋轉(zhuǎn)和3D位移。 這兩個工具都可以切換全局坐標(biāo)模式和個體坐標(biāo)模式,上圖為個體坐標(biāo)模式。 另外,也可以通過屬性面板和變形面板來調(diào)整3D變形的參數(shù)。其中值得注意的是滅點(diǎn)(消失點(diǎn))和相機(jī)
相關(guān)Flash教程:
- 相關(guān)鏈接:
- 教程說明:
Flash教程-Flash AS實(shí)例:神奇的數(shù)字魔術(shù)盒子
。