FORUMS: list search recent posts

HEEEEELPP!! simple btn>goto actiosncript problem

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Elin grome
HEEEEELPP!! simple btn>goto actiosncript problem
on Feb 25, 2009 at 5:36:45 pm

Hi People,

Havent used flash in years - and wasnt a great coder when i did, but have been using Cs4 to put together a simple linear animation.

At the end of the animation i want to it to stop, with a button available for the user to restart.

This used to be easy - but in AS3 im lost.

Now, ive figured out that i have to put the code on the frame, not the button, but still having problems, can anyone help?

Heres my code;


stop();

ENDBTN.addEventListener(MouseEvent.CLICK,MouseClick);

function MouseClick(e:MouseEvent):void{
root.gotoAndPlay("start");
}


Where ENDBTN is my button instance and "start" is a frame label at frame 1.

The problems are;

• When i test it the animation doesnt stop :s - must be something to do with the code that follows cos the stop() funciton alone works fine.


I get a compiler error "call to a possibly undefined method GotoAndPlay..." blah blah...


god, this used to be easy.. please help . quite urgent.:(

Elin







It's all the those pesky details :p


Return to posts index

Elin grome
Re: HEEEEELPP!! simple btn>goto actiosncript problem
on Feb 25, 2009 at 5:46:27 pm

ha! so dont know how/why - but just removed "root" and now it works.

:s

It's all the those pesky details :p


Return to posts index

demetri tashie
Re: HEEEEELPP!! simple btn>goto actiosncript problem
on Feb 25, 2009 at 5:56:37 pm

some possible things to look at:
1) make sure that your ENDBTN is actually called that as it's Instance name ( you can set this in the Properties Inspector) this is probably an overlooked issue.

2) is this all on happening on just a main timeline? then i don't think you need 'root.gotoAndPlay' . try just gotoAndPlay("start") . also - make sure there is a Frame Label called "start"

3) try also evt:MouseEvent rather than e:MouseEvent

try those ( one at a time) and get back if it works - let us know and learn from this example too !


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]