flex小错误(常记多做)
1、假如一个自定义控件被用在一个主控件里,在自定义控件里的方法可以转换为主控件的方法,完成调用。
userRulesCanvas.mxml 和 editRulesCanvas.mxml
compent控件代码如下:
private function submitClick():void
{
if((code.length == 0)||(addr.length == 0))
{ //这里可调用主程序的方法editSipAccountHandle()
parentApplication.editSipAccountHandle(code.text,addr.text)
closeHandle()
}
}
主控件代码如下:
public function editSipAccountHandle(sipAccount:String)
{
getUserRuleWs.modifyRulePhone(sipAccount);
}
2、xml格式的string对象的读取
event.result的值等于如下
<?xml version="1.0" encoding="UTF-8"?>
<rule>
<sipAccount>sip:hill@ocp.gz.com</sipAccount>
<extension>sip:8190@ext.protel.com.hk</extension>
<action>
<outgoing>
<sipPhoneAddr code="408">sip:969071526@ext.protel.com.hk</sipPhoneAddr>
<sipPhoneAddr code="404">sip:963306728@ext.protel.com.hk</sipPhoneAddr>
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<s:Application name="Spark_NumericStepper_textInput_editable_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xml ......
We're going to keep this post lean and mean, and get down to
business with 10 Tips that will keep your Flex applications fast, lean,
and responsive.
Rule # 1: Clean up after yourself
In general, it is good practice to maintain clean code. Not only
in the sense of having properly formatted and ......
一、自定义Panel组件
package test
{
import mx.containers.Panel;
import mx.core.UIComponent;
/**
* 自定义Panel
* **/
public class MyPanel extends Panel
......
在Flex里,一般的弹出窗口(除了Alert以外)都可以用TitleWindow组件完成,主窗口和TitleWindow的数据传输可以用以下方法
假设TitleWindow的实例文件为titleWin.mxml,则要在Application中用PopUpManager创建一个titleWin的引用
private var popWin:titleWin = titleWin(PopUpManager.createPopUp(this,titleWin,true) ......