• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Huh?

CSSStyleDeclaration defines a set of style rules. The first line creates a CSSStyleDeclaration object and associates it with ComboBox. Since we have ComboBox in our Library, Flash can say, “Aha! Here's a set of style rules that applies to ComboBox (which I see in the Library).” So, when we set a style on ComboBox, it immediately is applied to all instances of ComboBox in our movie.

FAQ

Why do we use _global? Why can't we just use ComboBox.setStyle()? Simple answer: ActionScript doesn't work that way. When we set styles on components that we want to apply over the whole movie, we use _global.styles. That's actually the job of _global.styles—that's its purpose in life: to set global styles for components.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint