Hi All,
when i apply perspective projection to the movieclip container it breaks or removes event-listeners from the child movie clips. i m basically creating a carousel in FLASH CS4(AS3) any one have any idea to sort out or reslove this problem, here is my code…
init();
private function createCarousel(e:Event):void
{
var xml:XML = new XML(e.target.data);
var list:XMLList = xml.image;
anglePer = (Math.PI*2) / list.length();
for(var i:int=0; i<list.length(); i++)
{
var imc:imCon = new imCon();
imc.buttonMode = true;
imc.addEventListener(MouseEvent.CLICK, onClick);
var l:Loader = new Loader();
l.x = -250;
l.y = -167;
l.load(new URLRequest(list*.@src));
imc.addChild(l);
imc.scaleX = imc.scaleY = 0.25;
imc.angle = (i*anglePer) - Math.PI/2;
imc.x = Math.cos(imc.angle) * 300;
imc.z = Math.sin(imc.angle) * 300;
imc.rotationY = (360/10) * -i;
container.addChild(imc);
}
}
private function init():void
{
var pp:PerspectiveProjection = new PerspectiveProjection();
pp.projectionCenter = new Point(380,240);
container = new MovieClip();
container.x = 380;
container.y = 240;
container.z = 300;
stagemc.addChild(container);
container.buttonMode = true;
container.transform.perspectiveProjection = pp;
container.addEventListener(MouseEvent.ROLL_OVER, On_Hover);
container.addEventListener(MouseEvent.ROLL_OUT, On_Hover);
stagemc.main_mc.addEventListener(MouseEvent.CLICK, stageClick);
}