Don't use on (release) {}, use btn.onRelease = function() {} in the frame.

Putting on (action) {} methods on button and movieclip instances is for
designers who don't know how to code.

When you assign button actions to movieclips or buttons, unless you use
"this", it's going to refer to the movieclip it resides in.

Example:

// Tells BTN_Foo's timeline to go to frame 2
BTN_Foo.onRelease = function() {
        this.gotoAndStop(2);
};

// Tells the timeline of the clip containing BTN_Foo to go to frame 2
BTN_Foo.onRelease = function() {
        gotoAndStop(2);
};
// Or you can write it like this
BTN_Foo.onRelease = function() {
        this._parent.gotoAndStop(2);
};

Same thing goes for variables. 

You can assign the clip to the button.

BTN_Foo.clipToControl = _level0.MC_Clip;
BTN_Foo.onRelease = function() {
        this.clipToControl._x = 100;
};

HTH,
Steven

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to