3 Replies Latest reply on Feb 8, 2007 3:44 AM by peterent

    Using Flash 8 Symbols in Flex


      I am creating some custom controls whose interface is a bit complicated (and hence would be far too much of an effort to create using graphics.draw methods). So I tried building the user interface as Flash 8 symbols. What I do is,

      - Create the symbols in Flash 8
      - Embed them in my Custom Control class
      - Create instances of the embedded class as a SpriteAsset object
      - Add it to the childrens list of my control class so that it is drawn

      So far, so good.
      The slight issue is that I also need to allow the user to modify the custom control interface (line color, fill color etc.) and I cant figure out how I can modify these properties on the Flash Symbol through the SpriteAsset class.

      Any ideas....

        • 1. Re: Using Flash 8 Symbols in Flex
          peterent Level 2
          The short answer is you can't do that. Flash 8 is ActionScript 2 while Flex 2 is ActionScript 3. When ActionScript 2 is loaded into the Flash Player it is put into a separate virtual machine than the ActionScript 3 code. This is how the Flash Player maintains backward compatability. There isn't a way for the AS3 code to reach in and tinker with the AS2 code and vice-versa.

          But all is not lost. You can use LocalConnection to communicate between the two virtual machines. Check my blog, there's an article about doing that: Using ActionScript 2 SWFs with Flex 2
          • 2. Re: Using Flash 8 Symbols in Flex
            faisy78 Level 1

            I am currently downloading Flash 9 Preview from the labs and hopefully that should sort out the ActionScript version differences.

            I was just wondering that is there no way that I can access the underlying vector data of the symbol through the SpriteAsset class, or through any other class in the Flex ActionScript 3 Framework. All I need to do is change the fill color of symbols. Having to open a LocalConnection just to acheive this seems like an overkill.
            • 3. Re: Using Flash 8 Symbols in Flex
              peterent Level 2
              Flash 9 should take care of the problem as that is also ActionScript 3