Setting a Default Skin


/ Published in: ActionScript 3
Save to your folder(s)

This is an example of how to define a default skin in a component written in ActionScript 3 that extends a spark component.


Copy this code and paste it in your HTML
  1. package components {
  2.  
  3. import skins.MyComponent;
  4. import spark.components.supportClasses.Component;
  5.  
  6. public class MyComponent extends Component {
  7.  
  8. public function MyComponent() {
  9. super();
  10. var t:* = getStyle('skinClass');
  11. if(t == undefined){
  12. setStyle("skinClass", skins.MyComponent);
  13. }
  14. }
  15. }
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.