.
( ). . , . jzayka !
1. 550400
2. . - 15835, , , . , , , . " ".
![4 - 3 (266x344, 46Kb)](//img1.liveinternet.ru/images/attach/c/0/113/350/113350601_4__3.jpg)
, 5 , 10, . . .
3. MovieCLip, F8 ( , " ") “Menu Item”. .
4. , 2
. -.
![8 (198x122, 20Kb)](//img1.liveinternet.ru/images/attach/c/0/113/313/113313155_8.jpg)
5. instance = “menuItemText“- .
![10 -1 (382x470, 61Kb)](//img1.liveinternet.ru/images/attach/c/0/113/351/113351391_10_1.jpg)
. , . ( )
![11 - 1 (672x394, 42Kb)](//img1.liveinternet.ru/images/attach/c/0/113/352/113352007_11__1.jpg)
7. ( , ), .
![14 (692x504, 59Kb)](//img1.liveinternet.ru/images/attach/c/0/113/352/113352289_14.jpg)
8. F9 :
//
const NUMBER_OF_ITEMS:uint = 16;
//
var menuItems:Array = new Array();
var menuText:Array=new Array();
var menuUrl:Array=new Array();
menuText=["Preriy "," jzayka "," Sabine Astana "," "," "," "," _","novprospekt","","MariYnina","_","","","SvetlanaT","Mademoiselle Viv","-"];
menuUrl=[" http://www.liveinternet.ru/users/preriy/profile/"," http://www.liveinternet.ru/users/jzayka/profile/"," http://www.liveinternet.ru/users/3111237/profile/"," http://www.liveinternet.ru/users/5093970/profile "," http://www.liveinternet.ru/users/4747147/profile/"," http://www.liveinternet.ru/users/5022732/profile/"," http://www.liveinternet.ru/users/3354683/profile/"," http://www.liveinternet.ru/users/novprospekt/profile/"," http://www.liveinternet.ru/users/4955107/profile/"," http://www.liveinternet.ru/users/mariynina/profile/"," http://www.liveinternet.ru/users/mariflash/profile/"," http://www.liveinternet.ru/users/4958866/profile/"," http://www.egorovatatiana.ru/profile?upd"," http://www.liveinternet.ru/users/svetlanat/profile"," http://www.liveinternet.ru/users/lady_de/profile/"," http://www.liveinternet.ru/users/4394467/profile/"];
// focal length
var focalLength:Number = 350;
//
var vanishingPointX:Number = stage.stageWidth / 2;
var vanishingPointY:Number = stage.stageHeight / 2;
// ngleSpeed ENTER_FRAME
var angleSpeed:Number = 0;
//
var radius:Number = 128;
// - ( )
var angleDifference:Number = Math.PI * (360 / NUMBER_OF_ITEMS) / 180;
// setBG();
//
for (var i:uint = 0; i < NUMBER_OF_ITEMS; i++) {
//
var menuItem:MenuItem = new MenuItem();
//
var startingAngle:Number = angleDifference * i;
menuItem.name=String(i);
// "currentAngle" -
menuItem.currentAngle = startingAngle;
//
menuItem.xpos3D = - radius * Math.cos(menuItem.currentAngle) * 0.5;
menuItem.ypos3D = radius * Math.sin(startingAngle);
menuItem.zpos3D = radius * Math.cos(startingAngle);
// ( -> )
var scaleRatio = focalLength/(focalLength + menuItem.zpos3D);
//
menuItem.scaleX = menuItem.scaleY = scaleRatio;
// ( 3D 2D )
menuItem.x = vanishingPointX + menuItem.xpos3D * scaleRatio;
menuItem.y = vanishingPointY + menuItem.ypos3D * scaleRatio;
//
menuItem.alpha = 0.3;
//
menuItem.menuItemText.text = menuText[i];
// ,
menuItem.mouseChildren = false;
// MOUSE_OVER, MOUSE_OUT CLICK
menuItem.addEventListener(MouseEvent.MOUSE_OVER, mouseOverItem);
menuItem.addEventListener(MouseEvent.MOUSE_OUT, mouseOutItem);
menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
//
menuItems.push(menuItem);
//
addChild(menuItem);
}
// ENTER_FRAME
addEventListener(Event.ENTER_FRAME, moveCarousel);
//
function moveCarousel(e:Event):void {
// mouseY
angleSpeed = (mouseY - stage.stageHeight / 2) * 0.0002;
//
for (var i:uint = 0; i < NUMBER_OF_ITEMS; i++) {
//
var menuItem:MenuItem = (MenuItem)(menuItems[i]);
//
menuItem.currentAngle += angleSpeed;
//
var scaleRatio = focalLength/(focalLength + menuItem.zpos3D);
//
menuItem.scaleX=menuItem.scaleY=scaleRatio;
// 3D
menuItem.xpos3D=- radius*Math.cos(menuItem.currentAngle)*0.5;
menuItem.ypos3D=radius*Math.sin(menuItem.currentAngle);
menuItem.zpos3D=radius*Math.cos(menuItem.currentAngle);
// .
menuItem.x=vanishingPointX+menuItem.xpos3D*scaleRatio;
menuItem.y=vanishingPointY+menuItem.ypos3D*scaleRatio;
}
// , ,
sortZ();
}
// ,
function sortZ():void {
// , ,
//z (= )
menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
//
for (var i:uint = 0; i < NUMBER_OF_ITEMS; i++) {
setChildIndex(menuItems[i], i);
}
}
// ,
function mouseOverItem(e:Event):void {
// 1
e.target.alpha=1;
}
// ,
function mouseOutItem(e:Event):void {
// 0.3
e.target.alpha=0.3;
}
// ,
function itemClicked(e:Event):void {
var curInd:uint;
curInd=uint(e.target.name);
var request:URLRequest = new URLRequest(menuUrl[curInd]);
navigateToURL(request);
}
function setBG() {
var w:Number=stage.stageWidth;
var h:Number=stage.stageHeight;
graphics.lineStyle(0,0);
graphics.beginFill(0);
graphics.lineTo(w,0);
graphics.lineTo(w,h);
graphics.lineTo(0,h);
graphics.lineTo(0,0);
graphics.endFill();
}
, , 16 - , , - .
![13 (592x382, 71Kb)](//img0.liveinternet.ru/images/attach/c/0/113/351/113351844_13.jpg)
. . !