FLEX实践—默认弹出窗口
本例中将实现当应用运行时不进行任何操作就先弹出窗口,点击关闭/点击窗口任一位置 时将关闭窗口
1)创建Component—DefaultWin.mxml (目录结构src/components/DefaultWin.mxml)
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
click="{this.visible=false}"
showCloseButton="true"
close="{this.visible=false}"
width="450"
height="253"
borderAlpha="0.8"
fontWeight="normal"
headerHeight="20"
borderColor="#EED9FB"
backgroundColor="#070707"
color="#FFFFFF"
cornerRadius="8"
creationComplete="init()">
<mx:Script>
<![CDATA[
private function init():void
{
move_up.yfrom=can.height - 6;
move_up.yTo=0 - content.height + 6;
move_up.repeatCount=0; //loop
move_up.repeatDelay=0; //loop time
move_up.duration=6000; //the time of scroll once
move_up.play();
}
private function move_pause():void
{
move_up.pause(); //pause
}
private function move_resume():void
{
move_up.resume(); //start from the pause position
}
]]>
</mx:Script>
<mx:Move id="move_up"
target="{content}"/>
<mx:VBox width="100%"
height="100%"
horizontalAlign="center">
<mx:HBox width="100%"
&n
相关文档:
发现了一个Flex中TextInput的一个比较有用的属性restrict(约束,限定),先看下例子:
1,<mx:TextInput id="test_ti" width="160" maxChars="20" restrict="0-9" text="0"/>
这样,这个输入框最多只能输入20个字符,只能输入0到9之间的数字了,你如果输入别的是输入不进去的
2,<mx:TextInput id="test_ti" width="1 ......
var login:infoChange=infoChange(PopUpManager.createPopUp( this, infoChange , true));
login.x=250;
login.y=150;
login.userid.text=dg.selectedItem.aa;
login.username.text=dg.selectedItem.bb;
......
Flash To EXE
Flex端
Flex创建一个Flex Project命名为Demo1,类型选Web application(runs in Flash Player)
在Demo1.mxml上添加一个按钮,并未按钮添加点击事件
private function ButtonClick(event:MouseEvent):void
{
......
采用Image重复加载图片极大影响性能,并且占用大量内存,下面是我对比验证的代码。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
initialize="loadImage()">
<m ......