In my project I’ve defined a Point class to build Point objects.
I also built a Polygon class with a (private) array property, Points. The polygon class contains a method getPoints() which return the current Points array.
My objective is to built one or more Polygon objects and assign several Point objects to the Polygon’s Points array.
Let’s say I’ve created two Polygon objects, plgPolygon01 and plgPolygon02. To both objects I insert three new Point objects into the Points array.
As I call the plgPolygon01.getPoints() method, i expect to get an array with three values. But when I do this, I get an array with six values.
So I conclude: while I was inserting Point objects into the Points array of a Polygon object, this Points array seems to be public instead of private. Otherwise, I’d only get the Points I assigned to the first Polygon object and not all the Points assigned to polygons.
*Erhm, help anyone? *
Would this be a strange bug in ActionScript 2.0 of have I made a stupid error in design/assignment?