hi,
I am stuck trying to create a vertical 3d menu that acts a bit like a 3d carousel.
Basically it would be like the list component wrapped around a horizontal cylinder. Minus the scrollbar but with a down and up button, which scroll the list to the back or to the front.
I am adding an example code here. Which does not work, but gives you the general idea.
You need to have a library item that has the class set to “NavItem”. In my library that item consists of a textfield and a rollover movieclip. that shows up when user rolls over and out.
package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
public class CircleMovement extends Sprite
{
private var _square:Sprite;
private var _angle:Number;
private var _navItem:MovieClip;
private var _naviArray:Array;
public function CircleMovement()
{
_naviArray = new Array();
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;
var rotationN:Number = 90;
var angleN:Number = 90;
for(var i:uint=0; i<6; i++)
{
var navi:NavItem = new NavItem();
navi.name = "navi" + i;
_naviArray.push(navi);
var angleRadians:Number = angleN * (Math.PI/180);
navi.x = sw/2 - (navi.width/2);
navi.y = sh/2 - (navi.height/2);
navi.y = Math.sin(angleRadians) * 65 + 200;
navi.z = Math.cos(angleRadians) * 65 + 200;
navi.rotationX = rotationN;
rotationN -= 30;
angleN += 30;
navi.addEventListener(MouseEvent.CLICK, clickHandler);
navi.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
navi.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
addChild(navi);
}
}
private function clickHandler(e:MouseEvent):void
{
trace(e.currentTarget.name);
}
private function overHandler(e:MouseEvent):void
{
e.currentTarget.gotoAndStop("over");
}
private function outHandler(e:MouseEvent):void
{
e.currentTarget.gotoAndStop("out");
}
}
}
Any help is appreciated.