FLEX 杂
发布时间:2020-12-15 04:26:19 所属栏目:百科 来源:网络整理
导读:Flex 编译慢 1. 不要使用Automatically Build,使用Ctrl+B快捷键手动编译. 2. 关闭所有当前不用的Project,最好只剩一个.? 更改界面语言: 右键打开图标属性,在目标路径中加了“-clean -nl en_US” 如下所示: "D:Program FilesAdobeAdobe Flash Builder 4
Flex 编译慢
更改界面语言:
右键打开图标属性,在目标路径中加了“-clean -nl en_US”
-clean-nlZH_CN-vmargs-Xms512m-Xmx512m-XX:MaxPermSize=256m-XX:PermSize=64m-Djava.net.preferIPv4Stack=true.
de_DEfr_FRja_JPru_RUzh_CNen_US?
ColorPicker?
???????
<s:Button?
x="
597?
" y="
118
" label="?
Button
" baseColor="
{
col.selectedColor
}?
"
/>
???????
<mx:ColorPicker?
id="
col?
" x="
517
" y="?
175
" selectedColor="
#916E6E?
"
/>
ComboBox
? ? ? ??
dataProvider=
"
[The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog]
"
??????? symbolColor="?
{
colorPicker.selectedColor?
}
"
??????? horizontalCenter="?
0
" top="?
60
"?
? ? ? selectedIndex
="?
0
"
/>
? ??
<fx:Declarations>?
?????
????????
<!-- Place non-visual elements (e.g.,services,value objects) here -->
?????
????????
<fx:Array?
id="
arr?
"
>
?????
????????????
<fx:Object?
dataField="
宋?
"? headerText="
宋体
"?
/>
?????
????????????
<fx:Object?
dataField="
楷?
"? headerText="
楷体
"?
/>
?????
????????????
<fx:Object?
dataField="
黑?
" headerText="
黑体
"?
/>
?????
????????
</fx:Array>
?????
????????
<s:ArrayList?
id="
arr1?
"
>
?????
????????????
<fx:Object?
dataField="
宋体?
"? headerText="
宋体
"?
/>
?????
????????????
<fx:Object?
dataField="
楷体?
"? headerText="
楷体
"?
/>
?????
????????????
<fx:Object?
dataField="
黑体?
" headerText="
黑体
"?
/>
?????
????????
</s:ArrayList>
?????
????
</fx:Declarations>
?????
????
<s:Panel?
x="?
448
" y="
159?
" width="
250
" height="?
200
"
>?
?????
????????
<mx:ComboBox?
x="
73?
" y="
10
" dataProvider="?
{
arr?
}
" labelField="
headerText?
" selectedIndex="
0
"
/>
?????
????????
<s:DropDownList?
x="
73?
" y="
50
" dataProvider="?
{
arr1?
}
" labelField="
headerText?
" selectedIndex="
0
"
/>
?????
????
</s:Panel>
? ? ??
?1)DropDownList的DataProvider不能是Array类型的
2)DropDownList默认显示时与ComboBox不一样,需要手动指定 selectedIndex的值?
给一个button或text添加链接
? ? ???
<fx:Script>
????????????<![CDATA[
????????? ???
private?
function?
linkURL():
void?
{?
??????????????????
var?
request:URLRequest =?
new?
URLRequest(
"http://www.renrenwei.com"?
);?
? ? ? ? ? ? ? initApp();
????????????????? navigateToURL(request,?
"_blank"
);?
????????????? }?
???????????????????????
??????????????
private?
function?
initApp():
void
{????
??????????????????
var?
str:String =?
"<a target='_blank' href='http://www.renrenwei.com'>aa</a>"
;????
????????????????? linkUrl.htmlText = str;?
????????????? }? ?
????????????]]>
???????
</fx:Script>
???????
<s:Button?
x="?
237
" y="
7?
" label="
按钮
" buttonMode="?
true
"? click="linkURL()"
/>
???????
<mx:Text?
text="
aa?
"?x?="
140?
" y="
10
" id="?
linkUrl
" fontSize="
13?
" buttonMode="
true
"
/>
PopUpButton
==============有问题=============== ? ? ?
????????????<![CDATA[
? ? ? ? ? ?
[
Bindable]
??????????????
private?
var?
menu:Menu;??????
??????????????
private?
function?
init():
void
{
????????????? ????menu =?
new?
Menu();
????????????? ????menu.dataProvider = arr;
????????????? ????menu.width = 200;
????????????? }
? ?
????????????]]>
???????
</fx:Script>
? ? ???
<fx:Declarations>
?????????????
<fx:Array?
id="
arr?
"
>
???????????????????
<fx:Object?
label="
Donec sit amet dui nec pede aliquam auctor.
"?
/>
??????????????
<fx:Object?
label="
Integer vestibulum sodales dui.?
"?
/>
??????????????
<fx:Object?
label="
Sed nonummy ligula et tortor.?
"?
/>
?????????????
</fx:Array>
???????
</fx:Declarations>
???????
<mx:PopUpButton?
x="
452
" y="?
34
" initialize="init();" popUp="?
{
menu?
}
" label="
PopUpButton?
"
/>
弹出窗口(flex 4 Air):
弹出对象 dd.mxml
主程序 cc.mxml
第一个参数是Flex弹出窗口的父窗体,这个相信大家都明白。第二个参数是Flex弹出窗口的类名,也就是组件的文件名,在Flex中一个MXML文件也对应一个类。PopUpManager是根据这个类来创建弹出对话框。第三个参数是模态标记。如果是true,就创建一个模态对话框;否则创建的就是一个非模态的对话框。PopUpManager还有一个参数,不过不常用,具体请参考帮助文档。
Flex 弹出窗口居中
PopUpManager.addPopUp(?window,?this,?true?); ?
弹出对话框: <?xml version="1.0" encoding="utf-8"?> 字符间距: letterSpacing="20"
换行:
<mx:DataGridColumn headerText="会員 No." dataField="MemberCode"/> DataGrid flex 代码触发 button.click
FLEX通过事件获取当前组件属性,在FLEX中,使用this只能获取当前整个窗体的对象,无法获取当前组件的属性,但可以通过currentTarget方法获取当前组件,如通过Label的双击事件获取Label的值。
[plain]?
view plain
copy
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |