I am creating a custom class “CardboardBox”. This extends Cube from the Away3D library, this allows me to give it an x, y, z values, and utilize all of the Cube functions.
But I also want to use bindable variables in my class (no flex here, just AS3), so I found Bumpslide:
http://bumpslide.com/blog/2009/03/04/data-binding-for-flash/
The only issue I have is that to make my class have bindable variables, it needs to extend BindableModel. Since it already extends Cube, the only solution I can see to this is to have my CardboardBox class have a property of cube. So to access the x value of myCardboardBox, I would have to write:
myCardboardBox.cube.x
This seems cluttered and like there should be a better way. Am I missing a step to have a clean MVC approach to this? Should the data for the CardboardBox be separate from the visual representation of it, the Cube? Or should I stick with using a cube property inside my class?
Thanks for any help on this.