5 Replies Latest reply on May 11, 2007 11:53 AM by sneakyimp

    Best way to organize classes to keep size small

    sneakyimp Level 2
      I have Flash MX 2004. I want to write some actionscript classes that i can import into my actionscript. I also want a user using my classes to be able to choose which class might get used to encode data. Is there a way that my main class (let's call it Service) can choose which file to reference for another class? For instance, if I want my Service class to be a communication channel and I want to have it encode data as XML i could choose a class called SerializeXML. If I wanted my data encoded as a PHP object, i would use SerializePHP.

      Ideally using my main Service class in your Flash file would not unnecessarily include classes that do not get used. For instance if I'm developing my Flash project to speak with a PHP server, there would be no need for SerializeXML.

      Is there some easy way to do this? I'm also hoping to make my class very easy to use so the users don't have to write a ton of code to choose SerializeXML vs. SerializePHP.