특별한딸기이야기
커스텀 프로퍼티 본문
MyTextInput.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml" initialize="strBackup=''">
<mx:Script>
<![CDATA[
public var strBackup : String;
public function backup() : void
{
strBackup = this.text
}
public function rollback() : void
{
this.text = strBackup;
}
]]>
</mx:Script>
</mx:TextInput>
Study.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:nsl="*">
<mx:Button x="197" y="144" label="Rollback" click="myText.rollback()" />
<mx:Button x="197" y="114" label="Backup" click="myText.backup()" width="74"/>
<nsl:MyTextInput x="154" y="84" id="myText" />
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml" initialize="strBackup=''">
<mx:Script>
<![CDATA[
public var strBackup : String;
public function backup() : void
{
strBackup = this.text
}
public function rollback() : void
{
this.text = strBackup;
}
]]>
</mx:Script>
</mx:TextInput>
Study.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:nsl="*">
<mx:Button x="197" y="144" label="Rollback" click="myText.rollback()" />
<mx:Button x="197" y="114" label="Backup" click="myText.backup()" width="74"/>
<nsl:MyTextInput x="154" y="84" id="myText" />
</mx:Application>
'딸기 공부방 > flex' 카테고리의 다른 글
액션스크립트 컴포넌트 (0) | 2008.12.27 |
---|---|
커스텀 이벤트 (0) | 2008.12.27 |
컴포넌트를 이용한 비디오 플레이어 (0) | 2008.12.27 |
컴포넌트 만들기 (1) | 2008.12.27 |
http로 서버에 정보 전달하기 (0) | 2008.12.27 |