9 Replies Latest reply on Jun 20, 2011 2:29 AM by ChristophFlex

    Skinning with ActionScript

    ChristophFlex

      Hi everyone,

       

      im looking for good Skinning examples in Actionscript for mobile projects. Adobe recommends to do skinning for this purpose only in actionscript but most of the examples on this website and most of the code in the provided example flex mobile apps are in MXML.

      Are their anywhere more examples and/or tutorials besides (http://www.adobe.com/devnet/flex/articles/mobile-skinning-part1.html) about skinning, or do you know good blogs about this topic?

       

      Beside that i have the problem that i cant import "spark.skins.mobile.*;"  in my project, because its a libary project. It only works in a mobile project, how can i fix this?

       

      Regards,

       

      Christoph

        • 1. Re: Skinning with ActionScript
          Shongrunden Adobe Employee

          I think you'll want to keep an eye on this 4 part series: http://www.adobe.com/devnet/flex/articles/mobile-skinning-part1.html

           

          You may need to add the mobile theme swc at //path_to_sdk/frameworks/themes/Mobile/mobile.swc

          • 2. Re: Skinning with ActionScript
            CleanCoder

            Any chance Adobe has some plans on standardizing pure Actionscript skinning in general, not just for mobile? Cleary MXML skinning is not efficient, so why is it still being pushed as the standard non-mobile skinning mechanism? Everybody jumped on the MXML skinning bandwagon, but now for mobile we are back to pure AS3, so it seems that the sacrifice of speed was not worth the luxury of making it easier for visual designers to create skins...

            • 3. Re: Skinning with ActionScript
              michaelhenley

              Are you just after a general idea of what can be achieved or are you looking to put together some examples yourself?

               

              Here is a short example of what can be achieved with actiionscript only skinning in Flex 3

               

              http://michaelhenley.info/2011/04/programmatic-skin-theory-intro/

               

              If you are after some more complex examples I have some lying around somewhere.

              1 person found this helpful
              • 4. Re: Skinning with ActionScript
                drkstr_1 Level 4

                Cleary MXML skinning is not efficient, so why is it still being pushed as the standard non-mobile skinning mechanism?

                 

                Why not just use assembly language?

                • 5. Re: Skinning with ActionScript
                  CleanCoder Level 2

                  I caught your sarcasm, but not your point...

                  • 6. Re: Skinning with ActionScript
                    drkstr_1 Level 4
                    I caught your sarcasm, but not your point...

                     

                    My apologies. Points are better understood when in your own head.

                     

                    My point was that MXML skins are used for the same reason we are not all still programming in assembler (except of course in those instances where it makes to use assembly, such as embeded systems). Yes, it is slightly less efficient to use a declarative language like MXML for skinning than it would be to write a highly optimized version in Actionscript (or assembler, if you want to follow that same logic).

                     

                    However, in most cases the preformance impact is negligable compared to the advantage gained through rapid development and easy work flows between designers and engineers. As long as the preformance loss is not noticble to the end user, who cares if it is slightly less efficient? Since the preformance loss IS somewhat noticable on mobile devices, then perhaps a different strategy that takes longer to implement could be justified. Although, it is possible to use MXML in a way that is pretty damned efficient... after all, it's nothing more than a factory pattern applied at compile time...

                    • 7. Re: Skinning with ActionScript
                      CleanCoder Level 2

                      I think MXML is great for mockups and simple projects but beyond that as projects grow, you run the risk of eventually running into some kind of performance hit (itemRenderers...). For example, the default Spark PanelSkin.mxml requires 10 Groups just to create a simple border chrome and content box, not to mention a few Horizontal/VerticalLayout classes just to position everything. Seems pretty inefficient and expensive to me, but if you can afford it, go for it. My thinking was that if there was a standard way of creating skins in Actionscript perhaps people wouldn't have to wait for a 4 part series on how to skin without sacrificing performance, regardless of their targeted platform. 

                      • 8. Re: Skinning with ActionScript
                        drkstr_1 Level 4

                        I definitly understand your point that it is less efficient, and I whole-heartedly agree. My point is that the preformance loss is negligble (in most cases) when compared to the benefit of a streamlined designer/developer workflow. Most designers dont want to write a bunch of code to make something look pretty, and most devlopers dont want to have to think about boring UI stuff. Skinning with MXML bridges that gap.

                        • 9. Re: Skinning with ActionScript
                          ChristophFlex Level 1

                          Thanks for that link.

                           

                          Im working on a big mobile project. currently i am working primary on the backend and logic-stuff but soon i will have to deal with the UI & design and than some resources would be really helpful. (for example how to skin the NumericStepper or i would like to make my own slider skin, etc...)