# How convert this rollOver to AS3?

**URL:** <https://forum.kirupa.com/t/how-convert-this-rollover-to-as3/267352>\
**Category:** Uncategorized\
**Created:** [July 31, 2008, 2:38am UTC](https://forum.kirupa.com/t/how-convert-this-rollover-to-as3/267352 "2008-07-31T02:38:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sank](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@sank](https://forum.kirupa.com/u/sank)\
**Post date:** [July 31, 2008, 2:38am UTC](https://forum.kirupa.com/t/how-convert-this-rollover-to-as3/267352/1 "2008-07-31T02:38:46Z")

</div>

been trying to crack this one - it’s just a simple rollover, but my AS3 attempt (below the AS2 version here) only plays the first frame when it should roll…

// AS2:

```
    function startRoll() {
        this.nextFrame();
    }
    function stopRoll() {
        this.prevFrame();
    }

```

// button:  
bttn.onRollOver = function() {  
this.onEnterFrame = startRoll;  
};  
bttn.onRollOut = function() {  
this.onEnterFrame = stopRoll;  
};  
bttn.onPress = function() {  
getURL(“[http://www.site.com](http://www.site.com)”,"\_blank");  
}

// AS3:

```
bttn.addEventListener(MouseEvent.MOUSE_OVER, startRoll);
bttn.addEventListener(MouseEvent.MOUSE_OUT, stopRoll);
  
function startRoll(event:MouseEvent):void{
  MovieClip(this).bttn.nextFrame();
}
function stopRoll(event:MouseEvent):void{
  MovieClip(this).bttn.prevFrame();
}
bttn.addEventListener(MouseEvent.CLICK,enter_url);
function enter_url(evt:Event):void
{
var enter_site:URLRequest = new URLRequest("http://www.site.com");
  navigateToURL(enter_site,"_blank");
}
```
