Use id to reference control : Spark component « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » Spark componentScreenshots 
Use id to reference control
Use id to reference control
     

<?xml version='1.0' encoding='UTF-8'?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import mx.controls.Alert;
        public function checkValue(inputValue:String):void
        {
            if(inputValue.length < 5)
                Alert.show("Are you sure there's not that much new?");
        }
        public function submitClicked():void
        {
            Alert.show("User says:" + whatsnew.text + " is new.");
        }
      
    </mx:Script>

        <mx:Label text="What's new?" />
        <mx:TextInput valueCommit="checkValue(event.currentTarget.text)" id="whatsnew" />
        <mx:Button label="Submit" click="submitClicked()" />
    
</mx:Application>

   
    
    
    
    
  
Related examples in the same category
1.Basic format of an MXML application that uses the Spark component setBasic format of an MXML application that uses the Spark component set
2.Use MX DataGrid with Spark Application, VerticalLayout, and Button componentsUse MX DataGrid with Spark Application, VerticalLayout, and Button components
3.Id property for ButtonId property for Button
4.Create a Spark Button control in MXML.Create a Spark Button control in MXML.
5.Set control to visibleSet control to visible
6.nonzero padding and gapsnonzero padding and gaps
7.Percetage widthPercetage width
8.Set min widthSet min width
9.Get UI controls's widthGet UI controls's width
10.Visible propertiesVisible properties
11.Percentage-based sizing
12.Using various Alpha propertiesUsing various Alpha properties
13.Using the id property with MXML tagsUsing the id property with MXML tags
14.Set component properties as tag attributesSet component properties as tag attributes
15.Set the property using the value of the static constant
16.Explicitly specify the default propertyExplicitly specify the default property
17.Use ActionScript String to insert a newline characterUse ActionScript String to insert a newline character
18.Convert calculation result to String and set to LabelConvert calculation result to String and set to Label
19.Use this[control label] to reference controls declaredUse this[control label] to reference controls declared
20.Id property for ControlId property for Control
21.Call the initDate() function and writes a message in flexlog.txtCall the initDate() function and writes a message in flexlog.txt
22.Log the component sizes to flashlog.txtLog the component sizes to flashlog.txt
23.Use width and height properties to explicitly set its sizeUse width and height properties to explicitly set its size
24.Convert object to Flex Display ObjectConvert object to Flex Display Object
25.Create Components From DescriptorsCreate Components From Descriptors
26.Use percentage to control the widthUse percentage to control the width
27.Setting enabled to false makes a component unavailable.Setting enabled to false makes a component unavailable.
28.visible controls whether an item is visible on stagevisible controls whether an item is visible on stage
29.Border properties set in MXML mark-upBorder properties set in MXML mark-up
30.Use child tags with the dot notation to define property overridesUse child tags with the dot notation to define property overrides
31.Use the x and y properties to reposition a Button controlUse the x and y properties to reposition a Button control
32.Set Pane and Button propertiesSet Pane and Button properties
33.A linker dependency on the Button controlA linker dependency on the Button control
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.