Home > adobe air > Learning Employee Directory 3.1 Style

Learning Employee Directory 3.1 Style

February 11th, 2008

Return to table of contents
CSS is very convenient to control the appearance of the user interface. Let’s see the following code snippet inside employeedirectory.css too see how to use styling.

.appHelpButton
{
 up-skin: Embed("/embed_assets/titlebar/help_up.png");
 over-skin: Embed("/embed_assets/titlebar/help_over.png");
 down-skin: Embed("/embed_assets/titlebar/help_over.png");
}

This snippet creates a style called appHelpButton. It defines how the button will behavior when the mouse is over or clicked on the button.

To use this style, ED includes the following code in employeedirectory.mxml

<mx:Style source="employeedirectory.css" />

And in TitleControls.mxml where the application help button is defined, style appHelpButton is used:

<mx:Button styleName="appHelpButton" click="dispatchEvent( new Event('showHelp') )" />
Author: Xu Cui Categories: adobe air Tags:
About the author:

Xu Cui is a human brain research scientist in Stanford University. He lives in the Bay Area in the United States. Check out PaperBox and BizGenius he runs.

 

He was born in He'nan province, China. He received education in Beijing University(BS), University of Tennessee (Knoxville) (MS), Baylor College of Medicine (PhD) and Stanford University (PostDoc). Read more ...
  1. No comments yet.
CAPTCHA Image