1 Reply Latest reply on Apr 20, 2007 10:23 AM by cluebcke

    Newbie: Structure of a complex flex application


      at first sorry for my bad english, I hope, you'll understand my question anyway.

      I have started to develop flex application just a few days ago, so I don't know much about it. I have some experiences in Flash, AS and PHP.

      I want to develop a webshop in flex. So there are over ten different pages (startpage, overview, shopping cart, ...) and so on. Reading the tutorials I have learned that there should only be one <mx:Application> in the whole project. So I have to put most of my code in other mxml files an import them, when I need them. Okay?

      My question: How can I embed or import a mxml file in my main application? How can I use a function in such an external mxml file? Is it possible to create an external mxml file only with functions in it without any class or component? If yes, how?

      Thanks for your help and again sorry for my bad english!
        • 1. Re: Newbie: Structure of a complex flex application
          Have you worked through any of the Quick Starts? I think doing so, with the developer's guide ready at hand, would clear up a lot of your questions.

          On importing a file (it would actually be .as, not .mxml) with only functions, yes you can (via the "include" statement), but you're generally recommended not to. It's not a very OO way of programming. Common functions can simply be put into a class that's imported and, if they can't be static, instantiated in the MXML component or AS class you're working with.