Hola, perdona estaba medio dormido creo.
Lo resuelto ... aquí va código por si alguien se atascaba con esta tontería
cod en base de
http://www.gotoandlearn.com/play?id=92funciona como menú rotativo en eje X del mismo xml
algunos modificaciones le hacen más accesible
Código ActionScript :
package
{
import com.gskinner.motion.GTween;
import com.leebrimelow.utils.Math2;
import com.theflashblog.fp10.SimpleZSorter;
import fl.motion.easing.Exponential;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class Carousel extends Sprite
{
private var container:Sprite;
private var loader:URLLoader;
private var anglePer:Number;
private const STAGE_WIDTH:Number = stage.stageWidth;
private const STAGE_HEIGHT:Number = stage.stageHeight ;
public function Carousel()
{
init();
loadXML();
}
private function loadXML():void
{
loader = new URLLoader(new URLRequest("menu.xml"));
loader.addEventListener(Event.COMPLETE, createCarousel);
}
private function createCarousel(e:Event):void
{
var xml:XML = new XML(e.target.data);
var list:XMLList = xml.image;
var num:Number=list.length()
var anglePer = (Math.PI*2) / num
var baseDegree:Number = 360 / num;
for(var i:int=0; i<list.length(); i++)
{
var imc:imCon = new imCon();
imc.buttonMode = true;
imc.addEventListener(MouseEvent.CLICK, onClick);
imc.AS3.text=list[i].@src
imc.scaleX = imc.scaleY = 0.5;
imc.angle = (i*anglePer) - Math.PI/2;
imc.y = Math.cos(imc.angle) * -360;
imc.z = Math.sin(imc.angle) * 360;
imc.x=0
imc.rotationX = baseDegree* - i;
container.addChild(imc);
}
}
private function onClick(e:MouseEvent):void
{
var tw:GTween = new GTween(container, 0.8, {rotationY:Math2.toDeg(e.currentTarget.angle+Math.PI/2), z:200},
{ease:Exponential.easeInOut});
}
private function init():void
{
container = new Sprite();
container.x = 350;
container.y = 250;
container.z = 900;
addChild(container);
cover.addEventListener(MouseEvent.CLICK, stageClick);
this.addEventListener(Event.ENTER_FRAME, loop);
}
private function stageClick(e:MouseEvent):void
{
var tw:GTween = new GTween(container, 0.8, {z:400}, {ease:Exponential.easeInOut});
}
private function loop(e:Event):void
{
var mx:Number = mouseX - STAGE_WIDTH / 2;
var my:Number = mouseY - STAGE_HEIGHT / 2;
container.rotationX += my * 0.01;
//container.rotationY += mx * 0.01;
SimpleZSorter.sortClips(container);
}
}
}