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