0

My original code enables me to play another frame once the user has clicked on the object-as seen in the code;

stop();
btn1.addEventListener 
	(MouseEvent.CLICK, onClick); 

function onClick
( event:MouseEvent):void 

{
gotoAndPlay("8") 
}

However, when i replace gotoAndPlay with 'gotoAndStop' it doesnt work?

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by snitch321
0

My original code enables me to play another frame once the user has clicked on the object-as seen in the code;

stop();
btn1.addEventListener 
	(MouseEvent.CLICK, onClick); 

function onClick
( event:MouseEvent):void 

{
gotoAndPlay("8") 
}

However, when i replace gotoAndPlay with 'gotoAndStop' it doesnt work?

Do you have a call to play() in the actionscript in the timeline on frame 8 of your clip? (click on frame 8 and look in the actionscript window)
That is the most likely cause of this problem......

Changing the gotoAndPlay in the code you posted to a gotoAndStop should cause your clip to go to frame 8 and stop.
But an explicit call to play() in the AS on the timeline of your clip at frame 8 would cause playback to continue..

Remove any call to Play() from the AS for frame 8. Don't replace it with a stop() as that would cause any gotoAndPlay(8) calls to fail....

Give that a go and let me know how you get on.

Cheers for now,
Jas.

0

I must say your very helpful and i really appreciate your response to my problem m8. But very silly of me, i made a simple mistake. What happen was i was playing frame 8 which i thought was the last frame but was actually playing the frame that i was currently on. Therefore it appear not to change when i clicked the button since it was playing the same frame i was on .
so thanks anyway m8.

But i counted wrongly for a reason, this is because in the preview it doesnt play the first frame, so i believed that all the other frames became a previous frame.(just so you think im not retarded hehe).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.