Apply effects with ActionScript and not use styles : Style « Style « Flex






Apply effects with ActionScript and not use styles

Apply effects with ActionScript and not use styles
         
<!--
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/

-->
<!-- charts/ApplyEffectsWithActionScript.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
        import mx.collections.ArrayCollection;
        import mx.charts.effects.SeriesInterpolate;
        [Bindable]
        public var items:ArrayCollection = new ArrayCollection([
            {item: 2000},
            {item: 3300},
            {item: 3000},
            {item: 2100},
            {item: 3200}
            ]);
        public var rearrangeData:SeriesInterpolate;
        public function init():void {
            // Specify the effect's target in the constructor.
            rearrangeData = new SeriesInterpolate(mySeries);
            rearrangeData.duration = 1000;
            rearrangeData.minimumElementDuration = 200;
            rearrangeData.elementOffset = 0;
        }
        public function addDataItem():void {
            // Add a randomly generated value to the data provider.
            var n:Number = Math.random() * 3000;
            var o:Object = {item: n};
            items.addItem(o);
        }
      </mx:Script>
    <mx:Panel title="Column Chart with Series Interpolate Effect">
        <mx:ColumnChart id="myChart" dataProvider="{items}">
            <mx:series>
                <mx:ColumnSeries id="mySeries" yField="item"
                    displayName="Quantity" showDataEffect="rearrangeData" />
            </mx:series>
        </mx:ColumnChart>
    </mx:Panel>
    <mx:Button id="b1" click="addDataItem()" label="Add Data Item" />
</mx:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Alternate WipeRight and WipeLeft effects for the mouseDownEffect style of a Button controlAlternate WipeRight and WipeLeft effects for the mouseDownEffect style of a Button control
2.Using a local stylesheet to decouple the style implementationUsing a local stylesheet to decouple the style implementation
3.Using the plain style
4.Applying behaviors in MXML using stylesApplying behaviors in MXML using styles
5.Applying behaviors in ActionScript using stylesApplying behaviors in ActionScript using styles
6.Local style definitionsLocal style definitions
7.Inline stylesInline styles
8.Get style declaration for control
9.Flex Style with namespaceFlex Style with namespace
10.Flex supports both camel-case and hyphenated syntax in style sheetsFlex supports both camel-case and hyphenated syntax in style sheets
11.Set style declaration for multiple componentSet style declaration for multiple component
12.Basic Inheritance for styleBasic Inheritance for style
13.Extensible style propertiesExtensible style properties
14.Get style and convert style value to stringGet style and convert style value to string
15.Using inline stylesUsing inline styles
16.Call a method when the style sheet finishes loadingCall a method when the style sheet finishes loading
17.Applying skins by using the Style ManagerApplying skins by using the Style Manager
18.Apply style to globalApply style to global
19.Unload style declaration
20.Use style from style option
21.Compare the style of controlsCompare the style of controls
22.Set all styles in MXML as tag attributes.Set all styles in MXML as tag attributes.
23.Applying styles by binding tag definitionsApplying styles by binding tag definitions
24.setting the values of the gutterLeft, gutterRight, and gutterBottom style properties. It also sets the paddingTop property to 20.setting the values of the gutterLeft, gutterRight, and gutterBottom style properties. It also sets the paddingTop property to 20.
25.Apply axisTitleStyleName property without specifying itApply axisTitleStyleName property without specifying it
26.Override Base Style PropertiesOverride Base Style Properties
27.Component styles
28.Click to change styleClick to change style
29.Compiled stylesCompiled styles
30.Setting And Getting StylesSetting And Getting Styles
31.Customize Styles at RuntimeCustomize Styles at Runtime
32.Styles SubComponentsStyles SubComponents
33.Set various styles on the textSet various styles on the text
34.Styled Link ElementStyled Link Element
35.Use ActionScript to set StylesUse ActionScript to set Styles
36.To make development easier, however, Flex supports both the camel-case and hyphenated syntax in style sheetsTo make development easier, however, Flex supports both the camel-case and hyphenated syntax in style sheets
37.Data Tip StylesData Tip Styles
38.Inheritable StyleInheritable Style
39.Define MyStyle style and applies that style to the elements on the horizontal axisDefine MyStyle style and applies that style to the elements on the horizontal axis