Defines myName and myHometown variables and binds them to the text of Label controls in the initVars() method : Label « Components « Flex






Defines myName and myHometown variables and binds them to the text of Label controls in the initVars() method

Defines myName and myHometown variables and binds them to the text of Label controls in the initVars() method
           


<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<!-- wrapper/ApplicationParameters.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="initVars()">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
    <fx:Script> 
        import mx.core.FlexGlobals; 
        /* Declare bindable properties in Application scope. */ 
        [Bindable] 
        public var myName:String; 
        [Bindable] 
        public var myHometown:String; 
        /* Assign values to new properties. */ 
        private function initVars():void { 
            myName = FlexGlobals.topLevelApplication.parameters.myName; 
            myHometown = FlexGlobals.topLevelApplication.parameters.myHometown; 
        } 
      </fx:Script>
    <s:HGroup>
        <s:Label text="Name: " />
        <s:Label text="{myName}" fontWeight="bold" />
    </s:HGroup>
    <s:HGroup>
        <s:Label text="Hometown: " />
        <s:Label text="{myHometown}" fontWeight="bold" />
    </s:HGroup>
</s:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Set Labels for VSliderSet Labels for VSlider
2.TextField CSS ClassTextField CSS Class
3. tag represents a Label control<mx:Label> tag represents a Label control
4.Label with Label with <mx:Label>
5.Set all Label components to use the Blue colorSet all Label components to use the Blue color
6.Apply a drop shadow to a Label control by using expanded MXML syntax and inline syntaxApply a drop shadow to a Label control by using expanded MXML syntax and inline syntax
7.Styling LabelStyling Label
8. represents a Label control<s:Label> represents a Label control
9.Use ActionScript to declare two Label controlsUse ActionScript to declare two Label controls
10.Use bindable string variable to set the Label textUse bindable string variable to set the Label text
11.Binds variables to LabelBinds variables to Label
12.Create a region that is 50 pixels wide for the axis labels, titles, and tick marksCreate a region that is 50 pixels wide for the axis labels, titles, and tick marks
13.Set the labelGap property of a chart's axesSet the labelGap property of a chart's axes
14.Binding ActionScript variable to Label controlBinding ActionScript variable to Label control
15.Set Label text with attribute and nested tagSet Label text with attribute and nested tag
16.Define a Label tagDefine a Label tag
17.Selectable LabelSelectable Label
18.Truncate Label To Fit the widthTruncate Label To Fit the width
19.Label with ConstraintsLabel with Constraints
20.Format float number for LabelFormat float number for Label
21.Label ControlLabel Control
22.Label Control Link EventLabel Control Link Event
23.Apply a drop shadow to Label controls by using expanded MXML syntax and inline syntaxApply a drop shadow to Label controls by using expanded MXML syntax and inline syntax
24.Specify the value of the labelFunction property for one of the vertical axis renderers.Specify the value of the labelFunction property for one of the vertical axis renderers.
25.Use ActionScript to change value of Button's label property when button clickedUse ActionScript to change value of Button's label property when button clicked
26.Creates a Button control with a label and an icon:Creates a Button control with a label and an icon:
27.Block changes Button's label property when the user clicks the buttonBlock changes Button's label property when the user clicks the button
28.Button labelButton label
29.Set label for a Button with child tagSet label for a Button with child tag
30.label for check box and buttonlabel for check box and button
31.A Button control with the label "Hello world!":A Button control with the label
32.Truncate To Fit by setting truncateToFit to trueTruncate To Fit by setting truncateToFit to true
33.Celsius and Fahrenheit converterCelsius and Fahrenheit converter
34.Inline Celsius and Fahrenheit converterInline Celsius and Fahrenheit converter
35.without an explicit function callwithout an explicit function call