I'm building a Flash project where it needs to handle some math, like an acceleration formula. My director has recommended a design patt开发者_如何学Cern where I include the calculations directly in the flash object, but that doesn't seem like it's very good OOP.
What's the best practice for calculations in Flash? Should it be a separate object, so I can keep the "non-Flash" parts together and out of the way? What are people's experiences with including it inline vs. keeping it separate?
On the contrary.
A flash object which accelerates should have its motion equations implemented in flash. It should have a class handling it, encapsulating the math. This way, it isn't stuck there, it is just in the right place.
If you take the math out of flash, you'll have to update the objects' positions by yourself, thus loosing a lot of flash's abilities.
精彩评论