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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

component button actions 1

Status
Not open for further replies.

flashbbeb

MIS
Mar 29, 2005
106
US
I've added a pill button to a scene ("getting_started") whose actions are supposed to go to another scene ("main_menu"). I've tried a number of things with no luck:

1. In the pill button's properties in the library -
The onRelease function (one of a few in the component):

this.onRelease = function() {
_root.gotoAndStop("main_menu", 1);
pressing = false;

No result, but I did add a trace("clicked!") to debug, and saw output when clicked.

2. added the above code to the frame of the button

3. added the above code to the movie clip in the frame

4. added the name of the instance of the button (I called it "main") to the previous attempts code

I've been trying to figure this out through other sites and similar posts, but found no luck. Any suggestions?

Thanks



There's a post on here that was of no help to me
 
Those are buttons within movie clips, if I remember well...
And you can't target scene names from movie clips. In fact you should never target a scene name in your Flash life again. Label the targeted frame in the targeted scene with an unique label, add _root or _level0 to target the main timeline, and only target the labeled frame on your button's script...

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

Put the script on the button itself, inside the movie clip.
No number only labels, or at least not starting off with a number, no caps, no spaces, no special character other than the underscore.

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
Excellent! The actual action worked - took me right to the main menu. The button component's functions threw me off. I'm getting actionscript errors about not putting mouse actions in a movie clip, but they don't affect or show up in the published swf.

And thanks for the advice on directing to scene names - I've been reading a lot of posts and the consensus is to not direct to scene names. I've always used frame labels when making navigation in the same scene, and didn't know I could direct to another scene.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top