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[/SIZE]
// 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.