Novice trying OOP for the first time

I’m trying to build my first class based on what I’ve read so far, and off to an ok start. However,…

I’m starting a Portfolio class, and I am having a snag on a prototype method that I would like to trace back an array set. I was able to create a simple prototype findArray(), which worked to return the correct results. However, the prototype rightButton() returns a proper trace with “I work”, but it returns an “undefined” for the ‘_parent.theItems’.

I’m sure this is a targeting problem, and I have also tried ‘_parent._parent.theItems’, and that didn’t seem to work. I was wondering if anyone knew what I’m doing wrong, or if I’m going about this the completely wrong way. :wink:

Thanks. The following is the code:

_global.Portfolio = function(itemsArray) {
this.theItems = itemsArray;
}

Portfolio.prototype.findArray = function() {
trace (this.theItems);
}

Portfolio.prototype.rightButton = function(clip) {
clip.onRelease = function() {
trace(“I work”);
trace (_parent.theItems);
}
}

boxes = [ “box1”, “box2”, “box3”, “box4”, “box5” ];
portfolio1 = new Portfolio(boxes);
portfolio1.findArray();
portfolio1.rightButton(rightMovieClip); // returns “I work” and “undefined”