hi guys,
i’m using a componet that make a cool effect, but it won’t let me add more function to the buttons, like loading external swf’s.
i have 3 buttons:
-button1 (with instance name ‘button1’ that calls button1.swf)
-button2 (with instance name ‘button2’ that calls button2.swf)
-button3 (with instance name ‘button3’ that calls button3.swf)
and the component get the button target with a function +/- like this:
this.btnTarget = this._parent[this._targetInstanceName]
and i wanna determine wich swf to load with a similar function.
the component code is:
[AS]
#initclip
moveBtnClass = function () {
this.init();
};
moveBtnClass.prototype.init = function() {
this.btnTarget = this._parent[this._targetInstanceName];
this.cpnt_name = “cpnt_move_btn”;
this._visible = false;
if (_global.cpnt_move_position_arrayX == undefined) {
_global.cpnt_move_position_arrayX = new Array();
_global.cpnt_move_position_arrayX.push(this.btnTarget._x);
_global.cpnt_move_position_arrayY = new Array();
_global.cpnt_move_position_arrayY.push(this.btnTarget._y);
} else {
_global.cpnt_move_position_arrayX.push(this.btnTarget._x);
_global.cpnt_move_position_arrayY.push(this.btnTarget._y);
}
this.btnTarget.onRelease = function() {
this.positionArray = _global.is_btn_horizontal ? _global.cpnt_move_position_arrayX : _global.cpnt_move_position_arrayY;
for (i=0; !_global.isOk && i<_global.cpnt_move_position_arrayX.length; i++) {
if (Math.abs(this.positionArray*-this._x)<1) {
_global.isOk = true;
_global.targetP = i;
}
}
_global.isOk = false;
};
};
Object.registerClass(“moveBtn”, moveBtnClass);
#endinitclip
[/AS]
and i wanna add something like this:
[AS]
this.btnTarget.onPress=function(){
loadMovie([color=red][function that get de instancename][/color]+ ‘.swf’,"_root.contents_mc");
}
[/AS]
help with the function that get the instancename, plz :beam: