9 Replies Latest reply on Jan 25, 2008 5:39 AM by jrosenhaft

    Please Help - Flex Component Kit for Flash AS3

      I've tried several examples of using the flex component kit for Flash AS3 and none of them are working for me. Whenever I run the "Convert Symbol to Flex Component Command," I get the following output:

      Command made the following changes to the FLA:
      Turned on Permit Debugging
      Turned on Export SWC
      Set frame rate to 24
      Imported FlexComponentBase component to library
      Symbol "BallComponent" can be used as a Flex component.
      Select File > Publish to create the SWC file for use in Flex.

      This appears to be correct but after adding the SWC to the flex library, my flex application does not seem to "see" the new component. I've managed to pull in components that others have made with Flash AS3 and the component kit so I don't think I'm doing anything wrong on the flex side.

      I noticed that in Flash, FlexComponentBase does not show up in my library after converting my symbol to a flex component. Additionally, nothing happens when I drag FlexComponentBase into my library. It just doesn't show up. When I go to the properties dialog for my exported component and try to validate mx.flash.UIMovieClip, I get the following message:

      A definition for the base class could not be found in the classpath. Please enter the name of a class that is defined in the classpath, or enter the default base class 'flash.display.MovieClip'.

      I suspected there was something wrong with my installation of Flash CS3 or the Component Kit so I just uninstalled and reinstalled Flash CS3, Flex Builder, and the component kit with the same results.

      I've now seen the same behavior with Flash CS3 9.0.2, Flex Builder 3 (tried both beta 2 and beta 3), and component kit 1.1.2.

      Has anyone seen this behavior before?

      Thanks in advance,
        • 1. Re: Please Help - Flex Component Kit for Flash AS3
          It sounds that you are doing all the right things. I have done exactly the same and successfully used Custom Flash components that I created and exported.
          One issue ( a bug with Flex 3 http://bugs.adobe.com/jira/browse/FB-11351 )
          is that you can't see the component in the Custom folder in design mode.
          However, you can still use it in the application by inserting it in the source mode, e.g.
          <local:RoundedBCKButton id="FwdBtn" click="vidPlayer.seekBwd();"/>
          <local:RoundedFFButton id="BckBtn" click="vidPlayer.seekFwd();"/>
          make sure you provided the proper namespace, e.g.
          xmlns:local="*" in the top container.
          I don't fully understand what you mean by "...validate mx.flash.UIMovieClip"
          is it in the properties panel in Flash or you try to import it into FB via an import mx.flash.UIMovieClip in Actionscript ?
          Let me know how you tried to " Validate" and I'll see what results I get on my system.


          • 2. Re: Please Help - Flex Component Kit for Flash AS3
            jrosenhaft Level 1
            Thanks for the response Yoav. In Flash, try right clicking on your component in the library and selecting "Properties..." In the Linkage section, next to the Base Class Field (which has the value mx.flash.UIMovieClip), click on the green check mark to validate the base class.

            Two questions for you...
            1) After converting your symbol to a flex component, do you see FlexComponentBase in your library? (I don't but I think I should.)
            2) If you just create a new .fla project and drag FlexComponentBase from your components panel into your library, does it then show up in your library (It doesn't for me).

            • 3. Re: Please Help - Flex Component Kit for Flash AS3
              yoav@cyteam.com Level 1
              OK, when validating mx.flash.UIMovieClip in FL properties panel I get the verification that it was found in FlexComponnetBase .

              1.) Upon the initial conversion the FlexComponnetBase is imported into my Library, as well as the symbol's linkage changes to "mx.flash.UIMovieClip"
              2.) Yes it does show !! ( I guess then something in you environment is missing)

              Just to clarify for you the trivial sequence.
              1.) new fla
              2.) create some object (rectangular) on stage and convert to symbol
              3.) select the symbol in the library , and from command convert to Flex component.
              4.) Then, the FlexComponnetBase is imported, the linkage is changed to mx.flash.UIMovieClip and the Publishing setting is changed for the generation of SWC.

              Now, I'm trying to recall how I installed the Kit ? however I'm a bit foggy as it may have been via the FlashC3 AIR extension plug in ? I'll try to verify later :)
              • 4. Re: Please Help - Flex Component Kit for Flash AS3
                jrosenhaft Level 1
                Hmm... so at least my theory is confirmed that there is something wrong with my Flash/Component Kit environment.

                I'm going through the exact steps that you describe in your sequence and the result is identical except that FlexComponentBase does not get added to my library (despite the output message to the contrary).

                I installed the component kit from the MXB file that was included with Flex Builder 3 beta 3 although I see the same behavior with the component kit included with Builder 3 beta 2 and the standalone component kit for Flex 2.0.1.

                If you get a chance, let me know if you can determine which version you're using and where it came from. That might be a clue.
                • 5. Re: Please Help - Flex Component Kit for Flash AS3
                  yoav@cyteam.com Level 1
                  Oops, to verify and find solution I generated some new Custom Flash components, basically repeated the same steps I did before. On the Flash side all appears OK and normal.
                  However, when I copied over the SWC file to the library and tried to use the new custom components, tehy were not identified and an error:
                  1046: Type was not found or was not a compile-time constant: for the component was generated.
                  I also have several SWC that I generated ( exactly the same way) several days ago, and the components in them are recognized and work fine.
                  Hmm ..., so I realized that last night I Oked an Adobe update of several CS3 elements include FlashCS3.
                  I'll investigate further and inform...
                  • 6. Re: Please Help - Flex Component Kit for Flash AS3
                    yoav@cyteam.com Level 1
                    OK, some results, good news/bad news, :(
                    Bottom line I was able to generate Flash components, import them into FB3 and use them in an application. However, the environment seems to be flaky on the FL side, sometimes it generates a good SWC file and sometimes a bad one. The only visual difference is the size, in my simple case ( 2 components, a graphic and a button) size 28K for the good the bad was 3K. Nothing noticeable in the actual generation process, once I noticed a "bad" SWC I just deleted it and repeated the publishing process ...
                    Quite disturbing, need to get to the bottom of this ...
                    • 7. Re: Please Help - Flex Component Kit for Flash AS3
                      jrosenhaft Level 1
                      Disturbing indeed...

                      To be clear, though, FlexComponentBase successfully showed up in the library panel in all cases, right? I'd consider it a minor "win" if I could just get that to happen. I reinstalled again and still no luck :(
                      • 8. Re: Please Help - Flex Component Kit for Flash AS3
                        yoav@cyteam.com Level 1
                        Yes, in all cases the FlexComponentBase compiled-Clip item appears and is used. I verified that I use the latest extension ( Via the Adobe extension manager tool);
                        My recommendation is to check issues on the FlashCS3 side, make sure you have the latest version / updates / Player9 / JRE/JVM etc.
                        Good luck
                        • 9. Re: Please Help - Flex Component Kit for Flash AS3
                          jrosenhaft Level 1

                          Thanks so much for your help. Your validation that I was doing stuff right and results from testing in your environment really made a difference.

                          Turns out my problem wasn't about the versions of Flash/Flex/Component Kit, etc... it was my java classpath. I had a reference to an old version of xalan.jar (version 2.6.0) in my system classpath and the problem was fixed when I removed it.

                          Rock on!