`
svygh123
  • 浏览: 122027 次
  • 性别: Icon_minigender_1
  • 来自: 广西
社区版块
存档分类
最新评论

Flex4权威指南学习心得

    博客分类:
  • Flex
 
阅读更多

1.Flex项目导入导出:在Flash视图下,点击文件(F)->导入 Flash Builder 项目
2.<s:states>应用:使用includeIn属性控制组件根据状态值可见性

    a. 在Flex4里通过点语法来设定一个组件属于某个状态的属性值。例如:      

<s:Button label="Default State" label.State2="New State"/>

    上述的代码的意思是,这个按钮的lable值在State2状态下是New State,在其他状态下是Default State。
   上述代码也可以这样写:  

 <s:Button >
      <s:label>Default State</s:label>
      <s:label.State2>new State</s:label.State2>
 </s:Button>

         参考:http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf63611-7ffa.html

                  http://shazhifeng.iteye.com/blog/531081

     b. 还有一个有趣的用法:<fx:Reparent target="targetComp" includeIn="stateName">:这个用法是重用组件,代码地址:

      http://huangdonghui.iteye.com/blog/2048195

      c. <s:states>还有一个stateGroups属性,用于在多状态下使用

      d. 如果要在切换states的时候加上过度效果,请参考transitions代码:http://huangdonghui.iteye.com/blog/2048204

3.<s:controlBarLayout>和<s:controlBarContent>应用

4.

<s:Group>
    <s:layout>
        <s:HorizontalLayout />
    </s:layout>
</s:Group> 

相当于<s:HGroup>,垂直控件同理.

5.Image组件或其他组件:可以通过指定scaleContent属性(默认为true),来让所加载的对象,自动适应UILoader容器的比例。

scaleContent=false: 表示让UILoader容器自动适应对象大小。

scaleContent=true:表示让对象自动适应UILoader容器大小。

6.画矩形框,查询条件的包围框: 

<s:Rect width="100%" height="100%">
	<s:stroke>
		<s:SolidColorStroke color="0xd0d0d0" weight="1"/>
	</s:stroke>
</s:Rect>

 7.画分割线: 

<s:Line bottom="40" width="100%">
	<s:stroke>
		<s:SolidColorStroke color="0xd0d0d0" weight="1"/>
	</s:stroke>
</s:Line>

 8.<s:RadioButtonGroup id="radiogroup"/>

     <s:RadioButton groupName="setUpSubjectNoInp" name="ystz" value="ystz"      click="putUpTotal0.setUpSubjectNo='ystz';putUpTotal0.setUpSubject='项目预算调整';currentState='ystz'" label="项目预算调整" width="103" />

9.<s:ComboBox>静态数据用法:

 

[Bindable] 
public var types:ArrayCollection = new ArrayCollection( 
	[  {label:"全部", 			value:'all'},
	{label:"项目预算调整", 		value:'项目预算调整'},
	{label:"项目年度预算调整", 	value:'项目年度预算调整'},
	{label:"项目间调整", 		value:'项目间调整'},
	{label:"项目内部科目调整", 	value:'项目内部科目调整'},
	{label:"月度计划外调整", 	value:'月度计划外调整'}
]);

<s:ComboBox id="typesCb" dataProvider="{types}" labelField="label" requireSelection="true" />

if (typesCb.selectedItem==null || typesCb.selectedItem.value.toString()=='all') {
	query.busiTypeName = null;
} else {
	query.busiTypeName = typesCb.selectedItem.value.toString();
}

 10.Flex prompt 字体设置(正常,不是斜体):

 

s|TextInput:normalWithPrompt {
    fontStyle: normal;
}

 11.Flex画竖线分隔符:

<s:Line id="line" width="0" height="100%">
	<s:stroke>
		<s:SolidColorStroke id="lineStroke" color="blue"/>
	</s:stroke>
</s:Line>

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics