Help with rotating circular menu
Hi there. With help from a few tutorials, I've made a menu with 5 buttons that rotate around a central Clip. So far so good.
Except I need to add a lightning that will point toward the center whenever a button is activated. Much like picture below:

Everything I've tried so far has produced unexpected results ![]()
So I would really appreciate any suggestions as to how I might fix my code (AS2) and get the lightning to position itself where it must be. Thanks!
var rotX:Number = 290; var rotY:Number = 140; var Centre:Number = Stage.height/2; var vitesse:Number = 0.1; var sceneW:Number =Stage.width; var sceneH:Number = Stage.height; var nbI:Number=5; var angle:Number=1; var i:Number; var lightning:MovieClip = this.attachMovie("lightning", "lightning", 1000); lightning._alpha = 0; var videostopped:Boolean = false; for(i=0;i<nbI;i++) { //_____________________ var button:MovieClip = this.attachMovie('Icone'+i,'Ic'+i,i); //_____________________ button.onRelease= onRelease; button.onRollOut = onRollOut; button.onRollOver = onRollOver; button._y = sceneH /2; } //_____________________test function onRollOver():Void { //I want to add a "lightning" movieClip between the center and the button that is rolled over lightning._alpha = 100; videostopped = true; } function onRollOut():Void { //then remove it. lightning._alpha = 0; videostopped = false; } onEnterFrame=function(){ if (!videostopped) { //_____ if (angle > (2*Math.PI)) { angle = 0; }else{ for(i=0; i<nbI; i++){ //_____________________angle on x axis this['Ic'+i]._x=rotX*Math.cos(angle+2*Math.PI*i/nbI)+sceneW/2; //_____________________angle on y axis this['Ic'+i]._y=rotY*Math.sin(angle+2*Math.PI*i/nbI)+sceneH/2; //_____________________Speed angle=angle+(sceneW/180)/sceneH*vitesse; } } } }