西西软件园多重安全检测下载网站、值得信赖的软件下载站!
软件
软件
文章
搜索

首页编程开发php教程 → FLEX3学习点滴

FLEX3学习点滴

相关软件相关文章发表评论 来源:本站整理时间:2010/8/9 0:16:42字体大小:A-A+

作者:佚名点击:169次评论:2次标签: 学习

  • 类型:学生模板大小:1.8M语言:中文 评分:10.0
  • 标签:
立即下载

我可能永远没有机会用FLEX,但我还是要坚持学习它,这是我的一个兴趣
组件可以设置minWidth等值,这样子在拖到大小时,不能小于这个值

Flex 不支持使用层叠样式表 (CSS) 来控制组件的所有可视方面。属性, 比如 x, y, width 和 height 是 UIComponent 类的属性

用StyleManager设置样式
var css:CSSStyleDeclaration = new CSSStyleDeclaration('mystyle');
css.setStyle('fontSize','30');
css.setStyle('color','blue');
StyleManager.setStyleDeclaration('.panel',css,true);


NavBar及其子类,不接受XMLList做为数据源,我也不知道为什么
<mx:Button label="Button">
<mx:icon>@Embed(source='file:///C|/Users/terry/Desktop/20066162321370.jpg')</mx:icon>
</mx:Button>
以下效果一样
<mx:Image id="loader1" source="@Embed(source='logo.jpg')"/>
<mx:Image id="loader1" source="@Embed('logo.jpg')"/>

HScrollBar
其值在Design中填不上,主要有下列值
<mx:HScrollBar
minScrollPosition="0" maxScrollPosition="100"
lineScrollSize="5" pageScrollSize="10" />

LinkBar数据源是对象数组时,获得对象的属性
var o:LinkBar = LinkBar(evt.target) ;
race(o.dataProvider[evt.index].data)

RadioButtonGroup EventDispatcher Object

NavBar及其子类,事件
mx.events.ItemClickEvent
可以用event.index event.label获得数据

有as代码定义XMLList是外边用一个空的<>为什么呢

private var a:XMLList =
<>
<a>aa</a>
<a>bb</a>
</>

Menu菜单等相关的东西,数据可以在事件中用
event.item获得


数据验证
提示的样式
.errorTip
{
fontSize: 12;
}

基本的:指定source property,trigger,triggerEvent

正测验证是的,事件
public function validResult(evt:ValidationResultEvent):void{
if(evt.type == ValidationResultEvent.VALID ){
var re:RegExpValidationResult;
for(var i:int=0;i<evt.results.length;i++){
re = evt.results[i];
result.text += "\n" + re.matchedString;
}
else{
result.text = 'not find';
}
}

Vresult = Text.validate();
if(Vresult.type = ValidationResultEvent.VALID


如何裁入这体并使用
[Embed("../assets/STXINWEI.TTF",fontName="myfont")]
[Bindable]
private var f:Class;

<mx:Label text="我要转" width="245" fontFamily="myfont"/>

自定义下载bar
继承自DownloadProgressBar,重写几个属性及方法
构造函数中:
downloadingLabel="downing";
要重写的方法:
showDisplayForInit
showDisplayForDownloading

应用程序本身用Application.application为访问

ModuleManager加载模块
ModuleManager.getModule()其返回IModuleInfo
要把模块加到主程序中,必须类型转换一下
IModuleInfo.factory.create() as 模块

光标管理
CursorManager.setBusyCursor();

ToolTipManager 提示管理器
可以使用其它容器,象Panel等来实现
其要实现<mx:Panel implements="mx.core.IToolTip" IToolTip这个接口才可以
使用时
public function onshow(evt:ToolTipEvent):void{
var p:ppp = new ppp();
evt.toolTip = p;
}

BrowserManager和浏览器交互
BrowserManager.getInstance();其返回一个
IBrowserManager对象,其完成具体功能,

如何给图片表背景线?
<mx:backgroundElements>
<mx:GridLines direction="horizontal">
mx:horizontalStroke>
<mx:Stroke weight="2" color="#ff0000" alpha="0.5" />
</mx:horizontalStroke>
<mx:horizontalFill>
<mx:SolidColor color="#cccccc" alpha="0.8" />
</mx:horizontalFill>
</mx:GridLines>
</mx:backgroundElements>

ajaxBridge
要在服务器中访问,不能直接打开,那样子会报错

mx.utils.ObjectUtil
有字符串或数字比较的方法

低数据量通信
Webservice
<mx:opertaion>
resultformat
result
fault
<mx:request>
指定参数
</mx:request>
</mx:opertion>

备注:在yii中写的webservice返回的虽然是xml,flex认成是一段String需要格式转换
var s:String = evt.result as String;
var shopxml:XML = new XML(s);
shops = shopxml.shop;
上边这咱做法是先转成xml,再转成xmllist


AMFPHP
一:用Responder
二:remoteObject
1:编译中加上 -services "services-config.xml"
2:从serices中复制上边的文件,并改其中的gateway为正确的路径
3:配置source destination
<mx:RemoteObject source="Hello" destination="amfphp" id="service">
<mx:method name="sayHello" result="getsay(event)" />
</mx:RemoteObject>
4:调用service.getOperation('sayHello').send(参数)

对象映射是[RemoteClass(alias="Project.Students")]中的alias是指定Flex对应的类的路径,而不是php中的
就是说其写php中的public $_explicitType = "Project.Students";指到同一个地方

得到的数据虽然为数组,想有还是要转换一下new ArrayCollection(ArrayUtil.toArray(evt.result));

    相关评论

    阅读本文后您有什么感想? 已有人给出评价!

    • 8 喜欢喜欢
    • 3 顶
    • 1 难过难过
    • 5 囧
    • 3 围观围观
    • 2 无聊无聊

    热门评论

    最新评论

    发表评论 查看所有评论(2)

    昵称:
    表情: 高兴 可 汗 我不要 害羞 好 下下下 送花 屎 亲亲
    字数: 0/500 (您的评论需要经过审核才能显示)