# Please help... Animated, clickable mc that opens a new window

**URL:** <https://forum.kirupa.com/t/please-help-animated-clickable-mc-that-opens-a-new-window/276247>\
**Category:** Uncategorized\
**Created:** [November 24, 2008, 10:39pm UTC](https://forum.kirupa.com/t/please-help-animated-clickable-mc-that-opens-a-new-window/276247 "2008-11-24T22:39:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wuzzi2ya](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wuzzi2ya](https://forum.kirupa.com/u/wuzzi2ya)\
**Post date:** [November 24, 2008, 10:39pm UTC](https://forum.kirupa.com/t/please-help-animated-clickable-mc-that-opens-a-new-window/276247/1 "2008-11-24T22:39:33Z")

</div>

the goal: [http://www.gmc.com/acadia/acadia/index.jsp?evar10=hp\_mast\_acadia](http://www.gmc.com/acadia/acadia/index.jsp?evar10=hp_mast_acadia)

I have some movie clips that I would like to have an animated rollover. I have that, now I need to add some more. I would like to be able to click opn the button and open a new window, yet I would like the window to appear in the same spot each time a new button(mc) is clicked. Cant I just do something like:

function newPage(e:MouseEvent):void {  
new Tween(e.currentTarget.buttonbg\_mc, “width”, Back.easeOut,e.currentTarget.buttonbg\_mc.x,300,10,true);

```
e.currentTarget.buttonbg_mc.alpha=1;

```

}

and add in the position where I need my x and y coordinates? Also I will need the new open box to stay and no longer be clickable… Can anyone give me some pointers. Trying to get this on my own yet I am at a stand still… Thanks

the code thus far:

stop();

import fl.transitions.Tween;  
import fl.transitions.easing.\*;

var startWidth:Number = hotSpot\_mc.buttonbg\_mc.width;

hotSpot\_mc.buttonMode = true;  
hotSpot\_mc.addEventListener(MouseEvent.ROLL\_OVER, buttonOver);  
hotSpot\_mc.addEventListener(MouseEvent.ROLL\_OUT, buttonOut);  
/_home\_mc.addEventListener(MouseEvent.CLICK, newPage);_/  
hotSpot2\_mc.buttonMode = true;  
hotSpot2\_mc.addEventListener(MouseEvent.ROLL\_OVER, buttonOver);  
hotSpot2\_mc.addEventListener(MouseEvent.ROLL\_OUT, buttonOut);  
/_home\_mc.addEventListener(MouseEvent.CLICK, newPage);_/  
hotSpot3\_mc.buttonMode = true;  
hotSpot3\_mc.addEventListener(MouseEvent.ROLL\_OVER, buttonOver);  
hotSpot3\_mc.addEventListener(MouseEvent.ROLL\_OUT, buttonOut);  
/_home\_mc.addEventListener(MouseEvent.CLICK, newPage);_/  
hotSpot4\_mc.buttonMode = true;  
hotSpot4\_mc.addEventListener(MouseEvent.ROLL\_OVER, buttonOver);  
hotSpot4\_mc.addEventListener(MouseEvent.ROLL\_OUT, buttonOut);  
/_home\_mc.addEventListener(MouseEvent.CLICK, newPage);_/  
hotSpot5\_mc.buttonMode = true;  
hotSpot5\_mc.addEventListener(MouseEvent.ROLL\_OVER, buttonOver);  
hotSpot5\_mc.addEventListener(MouseEvent.ROLL\_OUT, buttonOut);  
/_home\_mc.addEventListener(MouseEvent.CLICK, newPage);_/  
hotSpot6\_mc.buttonMode = true;  
hotSpot6\_mc.addEventListener(MouseEvent.ROLL\_OVER, buttonOver);  
hotSpot6\_mc.addEventListener(MouseEvent.ROLL\_OUT, buttonOut);  
/_home\_mc.addEventListener(MouseEvent.CLICK, newPage);_/

function buttonOver(e:MouseEvent):void  
{  
new Tween(e.currentTarget.buttonbg\_mc, “width”, Elastic.easeOut,startWidth,startWidth+180,15,false);  
e.currentTarget.buttonbg\_mc.alpha=1;

}

function buttonOut(e:MouseEvent):void  
{  
new Tween(e.currentTarget.buttonbg\_mc, “width”, Strong.easeOut,e.currentTarget.buttonbg\_mc.width,startWidth,15,false);

```
e.currentTarget.buttonbg_mc.alpha=0.5;

```

}
