1 Reply Latest reply on Aug 18, 2009 1:52 PM by rfrishbe

    Best Practice with Spark, display an animated loading screen

    watern Level 1

      In the past I would use Flash to create assests and then write the actionscript to interact with those assets.  So if I wanted to show an animated loading screen, I would create it in flash with the animation tools, set up it up to be a class of "LoadingScreen", then whenever I wanted to show a loading screen I would just create a new instance of LoadingScreen and add it to the stage.  When I eventually get a responce from my server I would remove the LoadingScreen.


      I want to do this in Flash Builder using the latest tools (states, spark, skinning, etc).  How would you do this?


      I imagine I won't have to create a seperate state for my various pages plus an extra state for each page showing the loading screen, correct? (page1, page1Loading, page2, page2Loading, etc)


      I have created the animated loading screen in Flash and exported the file out as a swc, so I have access to it in Builder, but what do I do from there, I can't do an addChild.


      Any ideas?  I am still trying to get my head around how to work with all of these new tools.

        • 1. Re: Best Practice with Spark, display an animated loading screen
          rfrishbe Level 3

          I'm not really sure what you were doing before, but you can use the Flash Component Kit to export your Flash content and bring it in to Flex.  Flash Builder exposes this more readily today as you can create a Flash component, and it'll open up Flash Authoring and automatically use the Flash Component Kit for Flex behind the scenes.  If you dont' care much about getting the sizing of your Flash content correct in Flex, you could just addChild() your Flash content to a UIComponent, which is what I assume you were doing before.


          In terms of Spark states and skins, I'm not really sure what your question is.  You can drop your Flash component in to a skin if you want and use states to control when it is visible just like another other component in Spark.