Im new to prototypes…
im using attachMovie to generate some buttons. And setting the prototype when it is created.
Problem is when I call the prototype (which just traces the instance name) it always traces the last instance created. None of the others.
in the first frame the code is this…
feedback.text += "FEEDBACK:
";
for (n = 1; n<8; n++) {
// mt is an emptyclip
clip = mt.attachMovie("b", "b"+n, mt.getNextHighestDepth());
yoffset = clip._height*n;
clip._y = yoffset;
clip.txt.text = "b" + n; // name on button
clip.onRelease = function() {
clip.myProto();
};
}
MovieClip.prototype.myProto = function() {
// trace instance name
feedback.text += this._name+"
";
};
any help would be much appreciated
EDIT::: Im using Flash MX 2004