欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Flex dynamic 關(guān)鍵字的用法

 更新時(shí)間:2009年05月25日 18:17:50   作者:  
Flex dynamic 關(guān)鍵字使用實(shí)例代碼。對于學(xué)習(xí)flex的朋友也許有所幫助。
EmployeeRecord.as
復(fù)制代碼 代碼如下:

package empty
{
public dynamic class EmployeeRecord
{
}
}

EmptyClass.mxml
復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"

viewSourceURL=""
horizontalAlign="center" verticalAlign="middle"
width="100%" height="100%"
>
<mx:Script>
<!--[CDATA[
import empty.EmployeeRecord;
private function showProperties():void
{
var emp:EmployeeRecord = new EmployeeRecord();
emp.name = "Peter Griffen";
emp.age = 22;
emp.address = "123 St Peter Blvd, #552";
emp.city = "Quahog";
emp.state = "NY";
emp.zip = "02593";

var displayInfo:Function =
function ():String
{
var out:String;
out = "Employee Record:\n";
out += "Name: " + emp.name + "\n";
out += "Age: " + emp.age + "\n";
out += "Address: " + emp.address + "\n";
out += "City: " + emp.city + "\n";
out += "State: " + emp.state + "\n";
out += "Zip: " + emp.zip + "\n";

return out;
}

emp.displayRecord = displayInfo;
panelPropertyArea.text = emp.displayRecord();
}
]]-->
</mx:Script>
<mx:Panel id="panel" title="A Simple Use of Package" status="Active"
height="75%" width="75%"
paddingTop="5" paddingLeft="5" paddingRight="5" paddingBottom="5">
<mx:Label width="100%" color="blue"
text="Program Execution Result: "/>
<mx:TextArea id="panelPropertyArea" width="100%" height="100%"/>
<mx:Button label="Click to Run Program" click="showProperties();"/>
</mx:Panel>
</mx:Application>

相關(guān)文章

最新評論