SlideShare une entreprise Scribd logo
1  sur  39
Flex 3:Developing Rich Internet
Applications - Day 2




                    Shyamala Prayaga
Reviewing course outline
•   Application Navigation
•   Styling your Application with CSS
•   Working with data (DataGrid)
Application navigation
In this section, you will learn how to implement and manipulate navigation
 containers individually and relative to one another. You will also learn how
 navigator and layout containers interact
Application navigation
Objectives
After completing this unit, you shall be able to:

•   Understand what navigator container are and how to create them
•   Navigate the ViewStack container with LinkBar, TabBar controls
Application navigation
Topics
In this unit, you will learn the following:

•   Understanding navigator containers and controls
•   Using the LinkBar control
•   Using the TabBar control
•   Using the ViewStack container
•   Using the TabNavigator container
•   Using the Accordion container
Understanding navigator containers
and controls


There are two types of containers

•   Layout container - Control the sizing and positioning of the child element
    within them
•   Navigator container – Control user movement, or navigation among multiple
    child containers
Understanding navigator containers
and controls
Navigator container basics

•   The direct children of a navigator container must be containers, either layout
    or navigator container
•   Typical properties of a container tag include id, width and height.
•   Navigator container and their children
•   Only ViewStack, TabNavigator and Accordion containers have child
    containers that you can layout.
•   LinkBar, ButtonBar, TabBar navigator controls do not have child containers.
    Instead they enable users and code to control the currently active child
    container of ViewStack container.
Using the LinkBar control


•   The LinkBar control
•   Defines a horizontal row of linkButton controls
•   Is a navigator container with built-in logic to switch between children of a
    ViewStack container
•   Has a width that is wide enough to contain all label text plus separators and
    necessary padding
•   Has a height that accommodate the tallest child element
•   Has default padding value of 2 pixels on all sides
•   Is represented in MXML with the <mx:LinkBar> tag
Using the LinkBar control



 <mx:LinkBar>
 <mx:dataProvider>
 <mx:String>Home</mx:String>
 <mx:String>Contact Us</mx:String>
 <mx:String>Special Events</mx:String>
 <mx:String>Restaurant Menu</mx:String>
 </mx:dataProvider>
 </mx:LinkBar>
Using the TabBar control


•   The TabBar control
•   Defines a horizontal (default) or vertical rows of tabs
•   Has default padding value of 0 pixels on all sides
•   Is represented in MXML using <mx:TabBar> tag
Using the TabBar control



 <mx:TabBar labelField="menuName">
 <mx:dataProvider>
 <mx:Object menuName="Home" />
 <mx:Object menuName="Contact Us" />
 <mx:Object menuName="Special Events"/>
 <mx:Object menuName="Resturant Menu" />
 </mx:dataProvider>
 </mx:TabBar>
Using the ViewStack control


The ViewStack container
• Is made up of a collection of child containers that are stacked on top of each
   other, with one container visible or active at a time.
• Does not provide user interface for selecting which child container is
   currently visible
• Typically used LinkBar or TabBar controls to switch between child
   containers
• Is represented in MXML with the <mx:ViewStack> tag
Using the ViewStack control
<mx:Panel title="ViewStack Demo" width="100%" height="100%" borderAlpha="1">
<mx:ViewStack id="vs" width="100%" height="100%">
<mx:VBox label="View 1" width="100%" height="100%">
<mx:Label text="This is View 1" color="0xFF0000"/>
</mx:VBox>

<mx:VBox label="View 2" width="100%" height="100%">
<mx:Label text="This is View 2" color="0x0000FF"/>
</mx:VBox>

<mx:VBox label="View 3" width="100%" height="100%">
<mx:Label text="This is View 3" color="0x00AA00"/>
</mx:VBox>

</mx:ViewStack>

<mx:ControlBar>
<mx:ButtonBar itemClick="vs.selectedIndex = ItemClickEvent(event).index">
<mx:dataProvider>
<mx:String>View 1</mx:String>
<mx:String>View 2</mx:String>
<mx:String>View 3</mx:String>
</mx:dataProvider>
</mx:ButtonBar>
</mx:ControlBar>
</mx:Panel>
Walkthrough 11:Create navigation
with TabBar and ViewStack control
Using TabNavigator container
•   The TabNavigator works the same way as ViewStack.
•   Has its own child so no need to provide ViewStack or dataProvider
•   Defines a horizontal row of tabs
•   Display one child at a time, in order they are defined
•   Had default padding value of 2 pixels on all side
•   Is represented in MXML with <mx:TabNavigator> tag
Using TabNavigator container
<mx:TabNavigator borderStyle="solid" >

    <mx:VBox label="Accounts"
      width="300"
      height="150">
      <!-- Accounts view goes here. -->
    </mx:VBox>

    <mx:VBox label="Stocks"
      width="300"
      height="150">
      <!-- Stocks view goes here. -->
    </mx:VBox>

    <mx:VBox label="Futures"
      width="300"
      height="150">
      <!-- Futures view goes here. -->
    </mx:VBox>

  </mx:TabNavigator>
Using Accordion container
•   The Accordion works the same way as ViewStack.
•   Has its own child so no need to provide ViewStack or dataProvider
•   Defines vertically stacked panels that animate as they open and close
•   has its own child content
•   Has default padding value of 2 pixels on all side
•   Is represented in MXML with the <mx:Accordion> tag
Using Accordion container
<mx:Accordion borderStyle="solid" >

    <mx:VBox label="Accounts"
      width="300"
      height="150">
      <!-- Accounts view goes here. -->
    </mx:VBox>

    <mx:VBox label="Stocks"
      width="300"
      height="150">
      <!-- Stocks view goes here. -->
    </mx:VBox>

    <mx:VBox label="Futures"
      width="300"
      height="150">
      <!-- Futures view goes here. -->
    </mx:VBox>

  </mx:Accordion>
Walkthrough 12:creating navigation
using Accordion and TabNavigator
Summary
Styling your Application with CSS
In this section, you will learn to customize the look and feel of flex applications
 with styles, behaviors and transitions. You will also learn to use different types
 of themes.
Styling your Application with CSS
Objectives
After completing this unit, you shall be able to:

•   Modifying the default Flex application style
•   Add animations to components using triggers and effects
•   Add animation to view state transitions
Styling your Application with CSS
Topics
In this unit, you will learn the following:

•   Customizing Flex application look and feel
•   Modifying Flex styles to change the look and feel
•   Using themes
•   Applying behaviors to components
•   Applying transitions to view state changes
Customizing Flex application look
and feel


•   You can modify almost every aspect of the look and feel and user
    interaction of your application by using these features of flex
•   Component sizes- height and width.
•   Graphical display – characteristic like color, font size, border, width, text
    alignment, corner radius setting etc
•   Dynamic effects – animations or sound
•   Fonts – default embedded text character sets
Customizing Flex application look
and feel
Changing flex control style defaults – skins and styles

•   Skins are graphics displayed on components
     – for example, the down arrow of the ScrollBar component is made up of
        three skins – ScrollDownArrowDisabled, ScrollDownArrowUp,
        ScrollDownArrowDown
     – Some components share skins. For example components that use scroll
        bars – including all containers share their skin with the ScrollBar
        component

•   Styles are defined on components. You can customize these styles
Customizing Flex application look
and feel
•   There are three ways to change the appearance of components

     – Use the Styles API to the programmatically modify styles
     – Physically modify or replace
     – Apply a theme made up of styles
Modifying styles to change the look
and feel
•   Flex provides several ways of setting component styles
•   Using MXML component properties
•   Calling the setStyle() method in ActionScript
•   Using Cascading style sheets (CSS)
•   Setting global styles
•   Implementing built in theme styles
Modifying styles to change the look
and feel
Setting styles inline using MXML component attributes

•   You have already set some styles for components by specifying values for
    attributes in MXML components

•   <mx:Text text=“Appetizers” color=“#dd7142” />
Modifying styles to change the look
and feel
Setting style in ActionScript for individual components using the setStyle()
method

  emailButton.setStyle(“ontSize”, 15);
Modifying styles to change the look
and feel
Setting style using Cascading style sheets (CSS)

•   Creating CSS type selectors
     – Type selectors assign styles to all instances of a particular type
     – Within the Style container, name MXML component and define its styles
     – Use a comma-separated list of components to set the same style to all
       specified components types

<mx:Style>
TextArea { backgroundColor: “#cccccc”}
Button, TextInput, Label { font-style: Italic}
</mx:Style>

<mx:TextArea id=“message” />
Using themes
•   Flex provides several themes that can be applied to the overall application
•   Use the themeColor style to set the theme color to any color or to a halo
    color (haloGreen, haloBlue, haloSilver, haloOrange)

<mx:Application themeColor=“haloBlue” >
Walkthrough 13:Styling your
Application
Applying behaviors to components



•   Behaviors let you add animation and motion to your application components
    in response to some user or programmatic action.
Applying behaviors to components
Understanding behaviors basics

•   Behavior has two parts

     – A trigger – an action, such as user clicking on a button, a component
       gaining focus or becoming invisible
     – An effect – a visible or audible change to the component occurring over
       a period of time such as fade effect

•   Components have triggers, but they do not do anything until you associate
    them with an event
Applying behaviors to components
•   Apply a simple behavior by setting the trigger name property of the
    component to the name of the effect class

<mx:Button id=“sendButton” label=“Send Message”
  mouseDownEffect=“Fade” />
Adobe Flex - Developing Rich Internet Application Workshop Day 2

Contenu connexe

Similaire à Adobe Flex - Developing Rich Internet Application Workshop Day 2

Exploring Adobe Flex
Exploring Adobe Flex Exploring Adobe Flex
Exploring Adobe Flex senthil0809
 
Supplement web design
Supplement web designSupplement web design
Supplement web designshelly3160
 
Tailwind Navbar A Complete Guide for Stunning User Experience.pdf
Tailwind Navbar A Complete Guide for Stunning User Experience.pdfTailwind Navbar A Complete Guide for Stunning User Experience.pdf
Tailwind Navbar A Complete Guide for Stunning User Experience.pdfRonDosh
 
The New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceThe New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceRachel Andrew
 
DSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI ThemingDSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI ThemingDuraSpace
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to VisualforceSujit Kumar
 
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented DesignCSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented DesignKate Travers
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web DevelopmentNikhil Baby
 
Adobe Flex Introduction
Adobe Flex IntroductionAdobe Flex Introduction
Adobe Flex IntroductionAmal Biswas
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Michael Shrove
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)Rajat Pratap Singh
 

Similaire à Adobe Flex - Developing Rich Internet Application Workshop Day 2 (20)

Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
 
Exploring Adobe Flex
Exploring Adobe Flex Exploring Adobe Flex
Exploring Adobe Flex
 
Introduction to flex
Introduction to flexIntroduction to flex
Introduction to flex
 
Supplement web design
Supplement web designSupplement web design
Supplement web design
 
slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Tailwind Navbar A Complete Guide for Stunning User Experience.pdf
Tailwind Navbar A Complete Guide for Stunning User Experience.pdfTailwind Navbar A Complete Guide for Stunning User Experience.pdf
Tailwind Navbar A Complete Guide for Stunning User Experience.pdf
 
Bootstrap
Bootstrap Bootstrap
Bootstrap
 
The New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceThe New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP Conference
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
 
WPF - An introduction
WPF - An introductionWPF - An introduction
WPF - An introduction
 
Unit 2 - Data Binding.pptx
Unit 2 - Data Binding.pptxUnit 2 - Data Binding.pptx
Unit 2 - Data Binding.pptx
 
Bootstrap [part 1]
Bootstrap [part 1]Bootstrap [part 1]
Bootstrap [part 1]
 
DSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI ThemingDSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI Theming
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
 
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented DesignCSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web Development
 
Adobe Flex Introduction
Adobe Flex IntroductionAdobe Flex Introduction
Adobe Flex Introduction
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 

Plus de Shyamala Prayaga

Leveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experienceLeveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experienceShyamala Prayaga
 
My Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android DesignMy Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android DesignShyamala Prayaga
 
Interaction design workshop
Interaction design workshopInteraction design workshop
Interaction design workshopShyamala Prayaga
 
Mobile accessibility challenges and best practices v2
Mobile accessibility   challenges and best practices v2Mobile accessibility   challenges and best practices v2
Mobile accessibility challenges and best practices v2Shyamala Prayaga
 
Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1Shyamala Prayaga
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1Shyamala Prayaga
 

Plus de Shyamala Prayaga (17)

HealthyCodeMay2014
HealthyCodeMay2014HealthyCodeMay2014
HealthyCodeMay2014
 
Leveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experienceLeveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experience
 
My Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android DesignMy Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android Design
 
Ticketing Application
Ticketing ApplicationTicketing Application
Ticketing Application
 
Interaction design workshop
Interaction design workshopInteraction design workshop
Interaction design workshop
 
Mobile accessibility challenges and best practices v2
Mobile accessibility   challenges and best practices v2Mobile accessibility   challenges and best practices v2
Mobile accessibility challenges and best practices v2
 
Mobile Prototyping
Mobile PrototypingMobile Prototyping
Mobile Prototyping
 
Accessibility and ucd
Accessibility and ucdAccessibility and ucd
Accessibility and ucd
 
Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1
 
Usability Testing
Usability TestingUsability Testing
Usability Testing
 
Json
JsonJson
Json
 
Ethenographic research
Ethenographic researchEthenographic research
Ethenographic research
 
Universal Design
Universal DesignUniversal Design
Universal Design
 
Ajax Backbone
Ajax BackboneAjax Backbone
Ajax Backbone
 
Javascript Library
Javascript LibraryJavascript Library
Javascript Library
 
Web 2.0 Usability
Web 2.0 UsabilityWeb 2.0 Usability
Web 2.0 Usability
 

Adobe Flex - Developing Rich Internet Application Workshop Day 2

  • 1. Flex 3:Developing Rich Internet Applications - Day 2 Shyamala Prayaga
  • 2. Reviewing course outline • Application Navigation • Styling your Application with CSS • Working with data (DataGrid)
  • 3. Application navigation In this section, you will learn how to implement and manipulate navigation containers individually and relative to one another. You will also learn how navigator and layout containers interact
  • 4. Application navigation Objectives After completing this unit, you shall be able to: • Understand what navigator container are and how to create them • Navigate the ViewStack container with LinkBar, TabBar controls
  • 5. Application navigation Topics In this unit, you will learn the following: • Understanding navigator containers and controls • Using the LinkBar control • Using the TabBar control • Using the ViewStack container • Using the TabNavigator container • Using the Accordion container
  • 6. Understanding navigator containers and controls There are two types of containers • Layout container - Control the sizing and positioning of the child element within them • Navigator container – Control user movement, or navigation among multiple child containers
  • 7. Understanding navigator containers and controls Navigator container basics • The direct children of a navigator container must be containers, either layout or navigator container • Typical properties of a container tag include id, width and height. • Navigator container and their children • Only ViewStack, TabNavigator and Accordion containers have child containers that you can layout. • LinkBar, ButtonBar, TabBar navigator controls do not have child containers. Instead they enable users and code to control the currently active child container of ViewStack container.
  • 8. Using the LinkBar control • The LinkBar control • Defines a horizontal row of linkButton controls • Is a navigator container with built-in logic to switch between children of a ViewStack container • Has a width that is wide enough to contain all label text plus separators and necessary padding • Has a height that accommodate the tallest child element • Has default padding value of 2 pixels on all sides • Is represented in MXML with the <mx:LinkBar> tag
  • 9. Using the LinkBar control <mx:LinkBar> <mx:dataProvider> <mx:String>Home</mx:String> <mx:String>Contact Us</mx:String> <mx:String>Special Events</mx:String> <mx:String>Restaurant Menu</mx:String> </mx:dataProvider> </mx:LinkBar>
  • 10. Using the TabBar control • The TabBar control • Defines a horizontal (default) or vertical rows of tabs • Has default padding value of 0 pixels on all sides • Is represented in MXML using <mx:TabBar> tag
  • 11. Using the TabBar control <mx:TabBar labelField="menuName"> <mx:dataProvider> <mx:Object menuName="Home" /> <mx:Object menuName="Contact Us" /> <mx:Object menuName="Special Events"/> <mx:Object menuName="Resturant Menu" /> </mx:dataProvider> </mx:TabBar>
  • 12. Using the ViewStack control The ViewStack container • Is made up of a collection of child containers that are stacked on top of each other, with one container visible or active at a time. • Does not provide user interface for selecting which child container is currently visible • Typically used LinkBar or TabBar controls to switch between child containers • Is represented in MXML with the <mx:ViewStack> tag
  • 14. <mx:Panel title="ViewStack Demo" width="100%" height="100%" borderAlpha="1"> <mx:ViewStack id="vs" width="100%" height="100%"> <mx:VBox label="View 1" width="100%" height="100%"> <mx:Label text="This is View 1" color="0xFF0000"/> </mx:VBox> <mx:VBox label="View 2" width="100%" height="100%"> <mx:Label text="This is View 2" color="0x0000FF"/> </mx:VBox> <mx:VBox label="View 3" width="100%" height="100%"> <mx:Label text="This is View 3" color="0x00AA00"/> </mx:VBox> </mx:ViewStack> <mx:ControlBar> <mx:ButtonBar itemClick="vs.selectedIndex = ItemClickEvent(event).index"> <mx:dataProvider> <mx:String>View 1</mx:String> <mx:String>View 2</mx:String> <mx:String>View 3</mx:String> </mx:dataProvider> </mx:ButtonBar> </mx:ControlBar> </mx:Panel>
  • 15. Walkthrough 11:Create navigation with TabBar and ViewStack control
  • 16. Using TabNavigator container • The TabNavigator works the same way as ViewStack. • Has its own child so no need to provide ViewStack or dataProvider • Defines a horizontal row of tabs • Display one child at a time, in order they are defined • Had default padding value of 2 pixels on all side • Is represented in MXML with <mx:TabNavigator> tag
  • 18. <mx:TabNavigator borderStyle="solid" > <mx:VBox label="Accounts" width="300" height="150"> <!-- Accounts view goes here. --> </mx:VBox> <mx:VBox label="Stocks" width="300" height="150"> <!-- Stocks view goes here. --> </mx:VBox> <mx:VBox label="Futures" width="300" height="150"> <!-- Futures view goes here. --> </mx:VBox> </mx:TabNavigator>
  • 19. Using Accordion container • The Accordion works the same way as ViewStack. • Has its own child so no need to provide ViewStack or dataProvider • Defines vertically stacked panels that animate as they open and close • has its own child content • Has default padding value of 2 pixels on all side • Is represented in MXML with the <mx:Accordion> tag
  • 21. <mx:Accordion borderStyle="solid" > <mx:VBox label="Accounts" width="300" height="150"> <!-- Accounts view goes here. --> </mx:VBox> <mx:VBox label="Stocks" width="300" height="150"> <!-- Stocks view goes here. --> </mx:VBox> <mx:VBox label="Futures" width="300" height="150"> <!-- Futures view goes here. --> </mx:VBox> </mx:Accordion>
  • 22. Walkthrough 12:creating navigation using Accordion and TabNavigator
  • 24. Styling your Application with CSS In this section, you will learn to customize the look and feel of flex applications with styles, behaviors and transitions. You will also learn to use different types of themes.
  • 25. Styling your Application with CSS Objectives After completing this unit, you shall be able to: • Modifying the default Flex application style • Add animations to components using triggers and effects • Add animation to view state transitions
  • 26. Styling your Application with CSS Topics In this unit, you will learn the following: • Customizing Flex application look and feel • Modifying Flex styles to change the look and feel • Using themes • Applying behaviors to components • Applying transitions to view state changes
  • 27. Customizing Flex application look and feel • You can modify almost every aspect of the look and feel and user interaction of your application by using these features of flex • Component sizes- height and width. • Graphical display – characteristic like color, font size, border, width, text alignment, corner radius setting etc • Dynamic effects – animations or sound • Fonts – default embedded text character sets
  • 28. Customizing Flex application look and feel Changing flex control style defaults – skins and styles • Skins are graphics displayed on components – for example, the down arrow of the ScrollBar component is made up of three skins – ScrollDownArrowDisabled, ScrollDownArrowUp, ScrollDownArrowDown – Some components share skins. For example components that use scroll bars – including all containers share their skin with the ScrollBar component • Styles are defined on components. You can customize these styles
  • 29. Customizing Flex application look and feel • There are three ways to change the appearance of components – Use the Styles API to the programmatically modify styles – Physically modify or replace – Apply a theme made up of styles
  • 30. Modifying styles to change the look and feel • Flex provides several ways of setting component styles • Using MXML component properties • Calling the setStyle() method in ActionScript • Using Cascading style sheets (CSS) • Setting global styles • Implementing built in theme styles
  • 31. Modifying styles to change the look and feel Setting styles inline using MXML component attributes • You have already set some styles for components by specifying values for attributes in MXML components • <mx:Text text=“Appetizers” color=“#dd7142” />
  • 32. Modifying styles to change the look and feel Setting style in ActionScript for individual components using the setStyle() method emailButton.setStyle(“ontSize”, 15);
  • 33. Modifying styles to change the look and feel Setting style using Cascading style sheets (CSS) • Creating CSS type selectors – Type selectors assign styles to all instances of a particular type – Within the Style container, name MXML component and define its styles – Use a comma-separated list of components to set the same style to all specified components types <mx:Style> TextArea { backgroundColor: “#cccccc”} Button, TextInput, Label { font-style: Italic} </mx:Style> <mx:TextArea id=“message” />
  • 34. Using themes • Flex provides several themes that can be applied to the overall application • Use the themeColor style to set the theme color to any color or to a halo color (haloGreen, haloBlue, haloSilver, haloOrange) <mx:Application themeColor=“haloBlue” >
  • 36. Applying behaviors to components • Behaviors let you add animation and motion to your application components in response to some user or programmatic action.
  • 37. Applying behaviors to components Understanding behaviors basics • Behavior has two parts – A trigger – an action, such as user clicking on a button, a component gaining focus or becoming invisible – An effect – a visible or audible change to the component occurring over a period of time such as fade effect • Components have triggers, but they do not do anything until you associate them with an event
  • 38. Applying behaviors to components • Apply a simple behavior by setting the trigger name property of the component to the name of the effect class <mx:Button id=“sendButton” label=“Send Message” mouseDownEffect=“Fade” />