Flash Aciont制作伪3D旋转菜单_Flash教程
教程Tag:暂无Tag,欢迎添加,赚取U币!
推荐:Flash:80行AS代码打造奇幻光影//////////////////////////////////////////////////author:chenlangeer///////////msn:[email=chenlangeer@hotmail.com]chenlangeer@hotmail.com[/emai
点击图标观看效果--伪3D旋转菜单:http://i.6to23.com/aawing/flash8/rotate3dMenu.swf
import flash.geom.Point;var total:Number = 11;
var center:Point = new Point(Stage.width/2, Stage.height/2);
var rx:Number = 180;
var ry:Number = 80;
var step:Number = 0;
var entity:MovieClip = _root.createEmptyMovieClip("entity", 10);
for (var i:Number = 0; i<total; i ) {
var image:MovieClip = entity.attachMovie("image1", "image" i, i);
image.txt.text = i;
align(0);
rotate(image);
}
function rotate(mc:MovieClip):Void {
mc.onPress = function() {
if (_root._xmouse-center.x>0) {
var num:Number = 5;
} else {
var num:Number = -5;
}
this.onEnterFrame = function() {
align(num);
if (num>0 && this._x<center.x) {
delete this.onEnterFrame;
} else if (num<0 && this._x>center.x) {
delete this.onEnterFrame;
}
};
};
}
function align(num):Void {
var radian:Number = Math.PI/180;
for (var i:Number = 0; i<total; i ) {
var image:MovieClip = entity["image" i];
var angle:Number = 90 360/total*i;
image._x = center.x rx*Math.cos((angle step)*radian);
image._y = center.y ry*Math.sin((angle step)*radian);
image._alpha = image._y-115;
image._xscale = image._yscale=(image._y-70)*.5;
image.swapDepths(image._y);
}
step = num;
updateAfterEvent();
}
分享:用Flash的beginBitmapFill平铺背景之前写过在flashmx2004中平铺背景的方法,虽然它也是有效果的,但相对使用flash8时还是显得有些复杂.这次介绍的是flash8中的MovieClip的新方法MovieClip.beginBit
/所属分类:Flash教程/更新时间:2008-03-05
相关Flash教程:
- 相关链接:
- 教程说明:
Flash教程-Flash Aciont制作伪3D旋转菜单。