I´m making my first steps with OOP so I´m still in the darkness.
I placed a MC instance called “clip” at coordinates 0,0.
then I wrote this code
function Square(x, y) {
this._x = x;
this._y = y;
}
clip = new Square(200, 200);
trace(clip._x);
trace(clip._y);
Square.prototype.moveTheClip = move;
function move() {
this._x += 20;
}
button.onPress = function() {
clip.moveTheClip();
};
Nothing is working here (especially my brain, I know).
Although the trace command returns 200,200 the clip is still in 0,0 and moveTheClip just moves nothing…
:puzzle: