Transcript
  • 1. http://feathersui.com/download/
  • 2. button1.styleProvider = buttonStyles; button2.styleProvider = buttonStyles;
  • 3. Button.globalStyleProvider = new FunctionStyleProvider( skinButton );
  • 4. Theme Passes global style provider to component class. Component Defaults to global style provider in constructor. Component Initializes when added to stage. Component Calls applyStyles() on style provider. Style Provider Sets properties on component.
  • 5. var button1:Button = new Button(); button1.label = "Cancel"; // no style name this.addChild( button1 ); var button2:Button = new Button(); button2.label = "Delete"; // the style provider will see the style name and call // a different function button2.styleNameList.add( "warning-button" ); button2.y = 100; this.addChild( button2 );
  • 6. Call component constructor. Add "warning-button" string to styleNameList property. Component initializes and applyStyles() is called on style provider. StyleNameFunction style provider checks styleNameList for values. If styleNameList contains "warning-button", call skinWarningButton() If no style names match a function, fall back to calling skinNormalButton()
  • 7. button.styleProvider = null; // no theme!
  • 8. button.styleProvider = new AddOnFunctionStyleProvider( button.styleProvider, setExtraStyles );
  • 9. http://feathersui.com http://twitter.com/feathersui http://facebook.com/feathersui http://plus.google.com/+Feathersui http://twitter.com/joshtynjala http://joshblog.net/

Top Related