Copy link to clipboard
Copied
i have used the code snippets to move from keyframe 1 to 2 with this code it is a button.
/* Stop at This Frame
The Flash timeline will stop/pause at the frame where you insert this code.
Can also be used to stop/pause the timeline of movieclips.
*/
stop();
/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
*/
Playbtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_6);
function fl_ClickToGoToAndStopAtFrame_6(event:MouseEvent):void
{
gotoAndStop(2); |
}
but i get this error, can anyone help?
the error i get if i change the name in the code to the class name instead
1120:Access of undefined property Playbutton
(the instance name is Playbtn)
Thanks for your concern!
As I said, it is not an uncommon error to start mixing up naming between "btn" and "button"... you've already demonstrated doing it between your first two postings. If "Playbutton" is the class name, then you cannot assign an event listener to it as you just showed in response 3
Copy link to clipboard
Copied
there's code, other than what you showed, causing at least the 1120 error.
use movie explorer to find all your code.
also, click file>publish settings>swf and tick "permit debugging" to see the line number (and frame) triggering the error messages.
Copy link to clipboard
Copied
Playbutton.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_6);
the problem is with this line for 1120
and where is movie explorer?
Copy link to clipboard
Copied
As I said, it is not an uncommon error to start mixing up naming between "btn" and "button"... you've already demonstrated doing it between your first two postings. If "Playbutton" is the class name, then you cannot assign an event listener to it as you just showed in response 3
Copy link to clipboard
Copied
Thanks alot ned!! now i have to figure out 1120 error
Copy link to clipboard
Copied
The error is indicating you are trying to assign a method to a Class object rather than a button or movieclip object. Where is the name "Playbtn" assigned to the button in question? In the library, do you see that name to the far right of the button under the AS Linkage heading?
If Playbutton is coming up as an undefined property, then it exists somewhere in your code. It is not an uncommon error to start mixing up naming between "btn" and "button" for object names.
Copy link to clipboard
Copied
Playbtn is the instance name
Playbutton is the Class name and the top one in properties
So which error is easier to fix, im still not sure which is the better error if their is such a thing
Copy link to clipboard
Copied
https://skydrive.live.com/?cid=714a9d9c67cfbfdc#cid=714A9D9C67CFBFDC&id=714A9D9C67CFBFDC%211
here are the files if its easier
Find more inspiration, events, and resources on the new Adobe Community
Explore Now