Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scene Linking Through Button Actionscript Help

Status
Not open for further replies.

BlazinVES

Technical User
Aug 30, 2006
6
US
I have a problem where I have a menu, I want one of the buttons to link to another scene. 2 probblems occur, 1 is that it says "on (release)" can only be used on button instances ( which it is) and primarely it doesn't link to the new scene.

Here is the action script I am using :

on (release) {
nextScene();
}

Your help is appreciated. Thanks.
 
You didn't give the action to the buton. You putted on the timeline. If you want it to work there give the button an instance name like myBtn and type:

myBtn.onRelease = function() {
nextScene();
}

 
IMHO, you shouldn't be using nextScene()... Nor targeting a scene name in any manner...
Label the targeted frame in the targeted scene with an unique frame label, and use the appropriate gotoAndPlay or gotoAndStop, targeting the labeled frame, and adding _root or _level0 to your path...

On the button symbol itself...

on(release){
_level0.gotoAndPlay("frame_label");
}

Or on a frame action button's handler...

myBtn.onRelease = function() {
_level0.gotoAndStop("frame_label");

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top