17 Replies Latest reply on Apr 14, 2010 4:45 PM by wind_surfer

    Flash Builder 4 fails to compile Beta 2 code

    wind_surfer

      I just recently upgraded to FB 4 from Flash Builder 4 Beta 2. All my code worked in the Beta version, but stopped working in the released version.

      I was told to change my namespace declarations to mx from halo. I did this but problems remain.

      Now I'm being told that "The style 'background-color' is only supported by type 'mx.controls.List' with the theme(s) 'halo'.

      Also, despite changing the namespace declaration in the css file, I am still getting errors complaining that namespace qualified type.

      There must be an answer to these problems. Can anyone help please?

        • 1. Re: Flash Builder 4 fails to compile Beta 2 code
          David_F57 Level 5

          Hi,

           

          There were several things discussed with issues relating to beta 2 and updated sdks in the now archived Flashbuilder Flex sdk forum, It may be worth while doing a search through the archive for posts relating to css etc from around mid-january.

           

          David

          • 2. Re: Flash Builder 4 fails to compile Beta 2 code
            wind_surfer Level 1

            Hi,

             

            I looked through the forum you suggested but could find no answer to my problem. Thanks, but I'm not sure what to do next.

            • 3. Re: Flash Builder 4 fails to compile Beta 2 code
              wind_surfer Level 1

              Hi David,

               

              Thanks for your reply. I can't find anything in the forums you mentioned. It

              seems several people are complaining, but there are no solutions offered. Do

              you know how to get this thing to work? Or how to contact someone who might

              know?

               

              Much appreciated,

              Shannon Vance

              Greenlight Development

              • 4. Re: Flash Builder 4 fails to compile Beta 2 code
                Jason San Jose Adobe Employee

                Besides a few API changes, the most common issue is the changed namespace:

                 

                Replace xmlns:mx="library://ns.adobe.com/flex/halo" with xmlns:mx="library://ns.adobe.com/flex/mx

                 

                Jason San Jose

                Software Engineer, Flash Builder

                • 5. Re: Flash Builder 4 fails to compile Beta 2 code
                  wind_surfer Level 1

                  Hi Jason,

                   

                  I have done this. I still get several errors that state something like:  the style 'background-color' is only supported by the type 'mx.controls.List' with the theme(s) 'halo'.

                  I also get 152 warnings that it cannot resolve qualified namespace in CSS for many components.(Button) for instance.

                   

                  What am I to do?

                   

                  This all worked great in Beta 2.

                   

                  I wish I could just get Beta 2 working again and avoid all this heartache. If I didn't have an anxious customer, this wouldn't be so critical.

                  • 6. Re: Flash Builder 4 fails to compile Beta 2 code
                    Jason San Jose Adobe Employee

                    Several things have changed since the Beta 2 build of the Flex SDK. Without seeing your project, it will be hard to diagnose your particular problem.

                     

                    The background-color warning you're seeing has to do with the fact that some CSS styles (in halo) are now properties of the Skin (in Spark). Some properties have CSS equivalents, some don't.

                     

                    For List, use contentBackgroundColor instead of background-color.

                     

                    For more, check out the livedocs at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html?filter_flex= 4&filter_flashplayer=10&filter_air=1.5.

                     

                    Jason San Jose

                    Software Engineer, Flash Builder

                     

                    Jason San Jose

                    Software Engineer, Flash Builder

                    • 7. Re: Flash Builder 4 fails to compile Beta 2 code
                      wind_surfer Level 1

                      Hi Jason,

                       

                      I switched the theme to halo in the Apperance settings, and it made those errors go away. Unfortunately I still get 191 warnings like:

                      Cannot resolve namespace qualified type 'Button' in css selector 'Button'.

                      And it cannot use my embedded fonts either. The failure to include my fonts is fatal since I don't see any text in the runtime that uses these fonts.

                      I looked at the link you provided but I have no idea what you intended me to do with the info on that page. It seems merely to be a reference page with no info on migration issues. Was there something in particular that you had in mind?

                      • 8. Re: Flash Builder 4 fails to compile Beta 2 code
                        Peter deHaan Level 4

                        Re: CSS warnings,

                        Read http://cookbooks.adobe.com/post_How_to_use_the_new_CSS_syntax_in_Flex_4-15726.html

                         

                        You'll need to specify which Button you're trying to style (mx|Button or s|Button):

                         

                        @namespace s "library://ns.adobe.com/flex/spark";
                        @namespace mx "library://ns.adobe.com/flex/mx";
                        
                        mx|Button
                           {
                           color:#ffffff;
                           }
                        s|Button 
                           {
                           color:#000000;
                           }
                        

                         

                         

                        Re: fonts not showing up,

                        If you are using MX controls and your fonts aren't showing up, try adding "embedAsCFF: false;" to the font embeds and see if that solves it. For more information, check out the following docs: http://help.adobe.com/zh_CN/Flex/4.0/UsingSDK/WSda78ed3a750d6b8f-26a13bbf123c441239d-8000. html

                         

                        Peter

                        • 9. Re: Flash Builder 4 fails to compile Beta 2 code
                          wind_surfer Level 1

                          Hi again,

                           

                          I only have one namespace qualified definitions in my css file.

                          mx|ComboBox

                           

                           

                          I am not sure why I am getting all the warnings about all the other components. I don't  even refer to many of these components in my source.

                           

                          I tried setting embedAsCFF to false and the fonts showed up, but the positioning was off. The chars appeared with a vert position several pixels above what they should be.

                           

                          Any ideas?

                          • 10. Re: Flash Builder 4 fails to compile Beta 2 code
                            Peter deHaan Level 4

                            I dont have any other ideas, sorry. If you can reproduce the text positioning issue in a simple test case, please file a bug at http://bugs.adobe.com/flex/.

                             

                            Peter

                            • 11. Re: Flash Builder 4 fails to compile Beta 2 code
                              wind_surfer Level 1

                              OK, so I forgot to mention that at the beginning of this fiasco, I

                              had an error that said: unable to open c:...blah blah/TLFText.css

                               

                              So I found the file in my Beta 2 install dir and copied it to the new 4.0 folder.

                               

                              I suspect that this is where all the css warnings were coming from.

                               

                              So, I deleted the file and no more warnings. But also, I got the original errors again.

                               

                              Why is it looking for this file? Why doesn't it use the correct file?

                               

                              Is there any way I can go back to Beta 2? This would solve my problems.

                              • 12. Re: Flash Builder 4 fails to compile Beta 2 code
                                Peter deHaan Level 4

                                Sorry, i missed this message earlier...

                                 

                                The TLFText.css file was renamed to MXFTEText.css in post beta 2 builds. It should be in the same directory as TLFText.css was, so I'd delete any old beta 2 files you copied over to the the Flex 4.0 release SDK and use the latest CSS file. Or worst case, just delete the Flex 4.0 SDK that came with Flash Builder 4 and redownload it from the Flex 4 download page on opensource.adobe.com and extract it into Builder.

                                 

                                As for going back to beta 2, you could probably dig up the super old SDK build from somewhere, but I'd strongly recommend against it. There have been lots of bug fixes post beta 2 and that 4+ month old SDK build would pretty much be unsupported by Adobe (especially if the bugs are fixed in the latest 4.x builds).

                                I'd either stick with the release Flex 4.0 build, or grab a nightly build from the Flex 4 download page at http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4 and try and work through whatever errors there are one by one. It is generally pretty quick since it is usually the same error(s) over and over.

                                 

                                Peter

                                • 13. Re: Flash Builder 4 fails to compile Beta 2 code
                                  wind_surfer Level 1

                                  Thanks Peter!

                                   

                                  I actually found out that my problems were started by the compiler option

                                  -locale

                                  en_US -theme+=$\projects\spark\TLFText.css -show-unused-type-selector-warnings=false

                                   

                                  that referred to the old css file.

                                  So... when I found and added that file to my 4.0 sdk, I got the warnings

                                  that made us think that I was trying to style every component that was

                                  mentioned in TLFText.css.

                                   

                                  It all makes sense now in retrospect.

                                   

                                  Oddly though, I had to add a 10pixel padding at the bottom to make the font

                                  appear in the correct spot on my button bar. No biggie, but I thought it

                                  might be noteworthy.

                                   

                                  Also, I had to switch to the Halo theme from the default spark theme because

                                  certain styles were no longer supported in spark. (no complaints by Beta 2,

                                  so I assumed that this change occurred in the released version)

                                   

                                  I do have a suggestion... It would make it easier to communicate Flex errors

                                  and warnings if they were able to be copied (ctrl-c or whatever) and

                                  subsequently pasted into discussions.

                                   

                                  For instance, I am getting a warning that states: The style

                                  'dropShadowVisible' is only supported by type 'mx.controls.List' with the

                                  theme 'spark'.

                                   

                                  I had to transcribe this warning because I could not copy it.

                                   

                                  Also, this warning came without a clue as to where in the source it could be

                                  found. Usually you can click on an error or warning and the ide will take

                                  you to the offending line/file. Is this a bug? Or just an unimplemented

                                  feature?

                                   

                                  All in all, though, I'm very happy with your help here since it led me to my

                                  solution. My client is now happy again too!

                                   

                                  You must be inundated with this kind of stuff constantly. I appreciate your

                                  helpful attitude and professional manner in the face of my frantic

                                  communications.

                                   

                                  Best,

                                  Shannon Vance

                                  Greenlight Development

                                  shannon@greenlightdevelopment.com

                                  o. 541.386.6180

                                  m. 541.400.0298

                                  • 14. Re: Flash Builder 4 fails to compile Beta 2 code
                                    Peter deHaan Level 4

                                    Re: "Oddly though, I had to add a 10pixel padding at the bottom to make the font appear in the correct spot on my button bar. No biggie, but I thought it might be noteworthy."

                                     

                                    Please file a bug at http://bugs.adobe.com/flex/ and include a simple test case and we can investigate. I've never seen this before, but it may be a combination of your theme+css+skins, etc. If you file a bug with a test case and some repro steps I can look into it further in case it is a bug.

                                     

                                     

                                    Re: "I do have a suggestion... It would make it easier to communicate Flex errors and warnings if they were able to be copied (ctrl-c or whatever) and subsequently pasted into discussions."

                                     

                                    You should be able to do this currently. If I do something crazy like this:

                                     

                                    <mx:CheckBox id="tgBtn" selected="sausages" />

                                     

                                    I get the following error in Flash Builder 4 (I'm using Standalone on WinXP):

                                     

                                    Description Resource Path Location Type
                                    Initializer for 'selected': cannot parse value of type Boolean from text 'sausages'. sListTEst.mxml /FxCharts/src line 23 Flex Problem

                                     

                                    I can copy that from Builder to my clipboard by going to the Problems tab in code view, highlighting the error row, and then right clicking and select "Copy" from the context menu. You should also be able to select multiple errors/warnings and copy them all at once too.

                                     

                                    OhNooooooooooooAnError.jpg

                                     

                                    Builder isnt always able to determine exactly where each error comes from. It works about 98% of the time for me, but there are odd times (depending on the type of error) where it cant determine the line number.

                                     

                                    Glad to hear you got it all worked out.

                                     

                                    Regards,

                                    Peter

                                    • 15. Re: Flash Builder 4 fails to compile Beta 2 code
                                      wind_surfer Level 1

                                      Hi Peter,

                                       

                                      I will look further into the 10 pixel thing before I post a bug.

                                       

                                      As for the copy issue. I was fooled into thinking I couldn't copy because I

                                      actually wasn't able to select just a part of the text with my mouse.

                                       

                                      When I click on an error or warning, it turns blue and sure enough a right

                                      click DOES bring up the context menu and allow copy.

                                       

                                      Here is the pasted warning verbatim:

                                       

                                      Description Resource Path Location Type

                                      The style 'dropShadowVisible' is only supported by type 'mx.controls.List'

                                      with the theme(s) 'spark'. Flex  line 487 Flex Problem

                                       

                                      Thanks for letting me know that Flex can't always pinpoint the error. It

                                      does a pretty good job as-is and a global search will always find the

                                      problem after the compiler has flagged it.

                                       

                                      Anyway, I've been battling the flu and about half my brain is mired in mucus

                                      (yuck) so I'm sure that I am missing all sorts of obvious things. Please

                                      excuse my dumb-headedness. Plus I'm still learning to be a better Flex

                                      programmer. I appreciate the help.

                                       

                                      Thanks again,

                                      Shannon Vance

                                      Greenlight Development

                                      • 16. Re: Flash Builder 4 fails to compile Beta 2 code
                                        Peter deHaan Level 4

                                        The compiler error/warning sounds very similar to my http://bugs.adobe.com/jira/browse/SDK-25720 bug, "Compiler warning when using an mx:List in Flex 4 app w/ Halo theme". Not sure if that matches your setup or not.

                                         

                                        Peter

                                        • 17. Re: Flash Builder 4 fails to compile Beta 2 code
                                          wind_surfer Level 1

                                          Yes this must be the same bug. I do not reference dropShadowVisible anywhere

                                          in my code.

                                           

                                          Glad you mentioned it. I might have been frustrated trying to run this down.

                                           

                                          Shannon