Trying to play a rotating movieclip in the timeline

Hi,

I’m having a few difficulties trying to get my movieclip to play in the timeline when I press a button. For example, i’ve got 3 buttons: Home, Music production & mixes. When I click on any of the buttons I would like it to trigger the same movieclip. Here’s the code:

//Nav buttons

home_Btn.addEventListener(MouseEvent.CLICK, goHome);
prod_Btn.addEventListener(MouseEvent.CLICK, goProd);
mix_Btn.addEventListener(MouseEvent.CLICK, goMix);

function goHome (e:MouseEvent):void
{
gotoAndStop("Home");
}
function goProd (e:MouseEvent):void
{
gotoAndStop("Production");
}
function goMix (e:MouseEvent):void
{
gotoAndStop("Mixes");
}

//rotating circle code 1

stage.addEventListener(Event.ENTER_FRAME, rotate);


function rotate(evt:Event):void
{
    
    var dx:Number = stage.mouseX-myCircle.x;
    var dy:Number = stage.mouseY-myCircle.y;
    var angle:Number = Math.atan2(dy,dx);
    myCircle.rotation = angle*180/Math.PI;
}

I think it’s got something to do with the following line of code:

stage.addEventListener(Event.ENTER_FRAME, rotate);

Which just plays the mc when I publish the swf. If I could play it each time I click a button that would solve my issue, it’s probably something simple, but i’m new to actionscript.

Appreciate any help

Many thanks,
LM

Thanks for your response, I don’t suppose you know how I would do that?

Sorry it’s probably really basic but i’m still learning

Cheers,
LM

//Nav buttons

home_Btn.addEventListener(MouseEvent.CLICK, goHome);
prod_Btn.addEventListener(MouseEvent.CLICK, goProd);
mix_Btn.addEventListener(MouseEvent.CLICK, goMix);

function goHome (e:MouseEvent):void
{
gotoAndStop("Home");
rotate();
}
function goProd (e:MouseEvent):void
{
gotoAndStop("Production");
rotate();
}
function goMix (e:MouseEvent):void
{
gotoAndStop("Mixes");
rotate();
}

//rotating circle code 1




function rotate():void
{
   
    var dx:Number = stage.mouseX-myCircle.x;
    var dy:Number = stage.mouseY-myCircle.y;
    var angle:Number = Math.atan2(dy,dx);
    myCircle.rotation = angle*180/Math.PI;
}

I think this should work.

bump!!haha--------------------------------our wow gold site:buy wow gold, cheap [url=http://www.wowgoldcc.cn/wowgoldworld.htm]wow gold, free [url=http://www.wowgoldcc.cn/Newplayers.htm]wow gold,

Hi Spectator,

Sorry for my late reply. I tried the code but unfortunetly it didn’t work. I guess I’m going to have to try something different.

Thanks for your help,

LM