Hi guys. I’m having a problem related to prototypes:
In the main timeline of the 1st scene I have this:
#include "files_as/prototypes/proto_multiprop.as"
#include "files_as/prototypes/barra_nav/bt_press.as"
the proto_multiprop.as file goes like this:
MovieClip.prototype.multiProp = function(proper, targetv, smooth) {
this[proper] -= (this[proper]-targetv)/smooth;
};
and the bt_press.as file:
Button.prototype.bt_press = function() {
_root.NAV_BASE.cursor.cursor_red.onEnterFrame = function() {
this.multiProp("_alpha", 0, 5);
};
rollover.onEnterFrame = function() {
this.multiProp("_x", -472, 5);
};
lnha_up.onEnterFrame = function() {
this.multiProp("_y", -35, 5);
this.multiProp("_alpha", 0, 5);
};
lnha_down.onEnterFrame = function() {
this.multiProp("_y", 45.9, 5);
this.multiProp("_alpha", 0, 5);
};
};
Now in the 3rd scene, in a MC timeline I’ve got this button, bt_form, and several MC’s referenced in the bt_press.as file, like for ex: lnha_up and lnha_down.
The button I use to activate the proto bt_press, has the following:
on (press) {
bt_form.bt_press();
}
What I’m trying to do is to call the multiProp prototype on to multiple movie clips(lnha_up, lnha_down, etc) using the other prototype bt_press.
The multiProp prototype seems to work on all movie clips on all scenes on the swf, if I call the prototype directly, but if I call it using the bt_press prototype, it doesn’t work.
It works if I put this on the MC timeline where the button and the MC’s are:
#include "files_as/prototypes/barra_nav/bt_press.as"
But I would have to call this again and again since I have An infinit number of MC’s that I want to use the bt_press prototype.
Can someone give a hand on this, perhaps the solution maybe pretty simple, but it’s cracking my head… to pieces.
Thank you.