# Stop(); insufficient? + how do i wait?

**URL:** https://forum.kirupa.com/t/stop-insufficient-how-do-i-wait/246427
**Category:** Uncategorized
**Created:** [December 11, 2007, 3:55am UTC](https://forum.kirupa.com/t/stop-insufficient-how-do-i-wait/246427 "2007-12-11T03:55:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gsquare567](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@gsquare567](https://forum.kirupa.com/u/gsquare567)
#### Post date: [December 11, 2007, 3:55am UTC](https://forum.kirupa.com/t/stop-insufficient-how-do-i-wait/246427/1 "2007-12-11T03:55:45Z")

</div>

heres what SHOULD happen: if you put your mouse on it, it should ease into circling around the main portal. if you click, it should go \*\*faster \*\*and faster until it reaches ~200 fps then stop and **go to my forums page**. it doesnt do the second part. the code and the animation:

[SIZE=4]**[My Current Animation](http://viportals.com/Portal%20Animation%20TEST%20FINAL.swf)**[/SIZE]

```php
// variables
var hasClicked:Boolean = false,
    hasRolledOver:Boolean = false;

// stop animation in the begining
this.stop();

// add listeners
animation_btn.addEventListener(MouseEvent.ROLL_OVER, buttonRollOver);
animation_btn.addEventListener(MouseEvent.MOUSE_UP, buttonMouseUp);
animation_btn.addEventListener(Event.ENTER_FRAME, buttonEnterFrame);

// listener functions

function buttonRollOver(event:MouseEvent):void
{// start animation
    if (!hasRolledOver)
    {
        hasRolledOver = true;
        play();
    }
}

function buttonMouseUp(event:MouseEvent):void
{
    hasClicked = true;
}

function buttonEnterFrame(event:Event):void
{// if clicked, increase frame rate ~ every 10 frames
    if(hasClicked && currentFrame % 10==0 && stage.frameRate < 200)
        stage.frameRate += 5;
    
    if(currentFrame == 250)
    {
        trace("BEFORE rate ate 250 = " + stage.frameRate);
        if(hasClicked && stage.frameRate >= 200)
        {// stop, pause, go to forums *****
            trace("*goes to forums*");
            this.stop();
        }
        gotoAndPlay(151);
        trace("AFTER rate ate 250 = " + stage.frameRate);
    }
}

```

(first AS script ftw!)

i tried using stop(); which works in the begining, but not in the end… how can i make it stop, wait a second, then go to a url??? also, why isnt it going faster, and how can i make it run smoother when i make it gotoAndPlay(151);?

ps - feel free to comment on any of my coding. i know it sucks, i don’t care how you tell me; i love any criticism/tips on improving.
