Flex可视化组件开发

Flex可视化组件都继承自UIComponent类

继承结构:

UIComponent

Sprite

DisplayObjectContainer 显示对象容器

InteractiveObject 交互对象

DisplayObject 显示对象

EventDispatcher 事件分发器

Object 通用对象

可视化组建属性:

doubleClickEnabled、Enabled、Height、Width、Id、percentHeight、percentWidth、styleName、toolTip、visible、x、y

数据绑定:

方式一:

<s:TextInput id="it" text="数据绑定" x="10" y="10"/>
<s:TextArea id="xt" text="{it.text}" x="10" y="30"/>

方式二:

<s:TextInput id="at" text="绑定数据"/>
<s:TextArea id="bt"/>
<fx:Binding source="at.text" destination="bt.text"/>

 

 

 

ActionScript:

BindingUtils.bindProperty(at,"text",bt,"text");

Bindable数据标签:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
<fx:Script>
   <![CDATA[
    [Bindable]
    public var myDATA1:Number=20;
    [Bindable]
    public var myDATA2:Number=12;
   ]]>
</fx:Script>
<s:TextArea text="{ myDATA1}" height="25"/>
<s:TextArea text="{ myDATA2}" y="50" height="25"/>
</s:Application>

 

 

 

CSS使用:

引入外部CSS:

<fx:Style source="myStyle.css"/>

AS中改变CSS样式:

StyleManager.getStyleDeclaration(".mystyle").setStyle("color",0xccff00);

Flex同样包含Form组建。

你可能感兴趣的:(数据结构,css,Flex,Adobe,actionscript)