# Trying to play a rotating movieclip in the timeline

**URL:** <https://forum.kirupa.com/t/trying-to-play-a-rotating-movieclip-in-the-timeline/265853>\
**Category:** flash\
**Created:** [July 13, 2008, 6:20pm UTC](https://forum.kirupa.com/t/trying-to-play-a-rotating-movieclip-in-the-timeline/265853 "2008-07-13T18:20:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![limeman](https://avatars.discourse-cdn.com/v4/letter/l/b487fb/32.png) [@limeman](https://forum.kirupa.com/u/limeman)\
**Post date:** [July 13, 2008, 6:20pm UTC](https://forum.kirupa.com/t/trying-to-play-a-rotating-movieclip-in-the-timeline/265853/1 "2008-07-13T18:20:20Z")

</div>

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:

```auto
//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:

```auto
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

---

<div class="post-metadata">

**Author:** ![limeman](https://avatars.discourse-cdn.com/v4/letter/l/b487fb/32.png) [@limeman](https://forum.kirupa.com/u/limeman)\
**Post date:** [July 13, 2008, 7:53pm UTC](https://forum.kirupa.com/t/trying-to-play-a-rotating-movieclip-in-the-timeline/265853/2 "2008-07-13T19:53:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![spectator](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@spectator](https://forum.kirupa.com/u/spectator)\
**Post date:** [July 13, 2008, 8:06pm UTC](https://forum.kirupa.com/t/trying-to-play-a-rotating-movieclip-in-the-timeline/265853/3 "2008-07-13T20:06:35Z")

</div>

```auto
//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.

---

<div class="post-metadata">

**Author:** ![Easyforpp](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Easyforpp](https://forum.kirupa.com/u/Easyforpp)\
**Post date:** [July 14, 2008, 3:20pm UTC](https://forum.kirupa.com/t/trying-to-play-a-rotating-movieclip-in-the-timeline/265853/4 "2008-07-14T15:20:40Z")

</div>

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](http://www.wowgoldcc.cn),_

---

<div class="post-metadata">

**Author:** ![limeman](https://avatars.discourse-cdn.com/v4/letter/l/b487fb/32.png) [@limeman](https://forum.kirupa.com/u/limeman)\
**Post date:** [July 14, 2008, 7:29pm UTC](https://forum.kirupa.com/t/trying-to-play-a-rotating-movieclip-in-the-timeline/265853/5 "2008-07-14T19:29:04Z")

</div>

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
