Notice
Recent Posts
Recent Comments
SNOWFLAKES DRAWING PAPER
[Android :: Flex Mobile] 살~짝 건드려보기 본문
MXML
<?xml version="1.0" encoding="utf-8"?>
<s:MobileApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.SampleHome">
</s:MobileApplication>
SampleHome.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="fzOo Flex Mobile TEST"
creationComplete="configure()" initialize="init()" addedToStage="addedToStage()">
<fx:Script>
<![CDATA[
import mx.collections.ArrayList;
private function addedToStage():void
{
}
private function init():void
{
_listData = new ArrayList();
list.dataProvider = _listData;
}
private function configure():void
{
setListData();
}
private var _listData:ArrayList;
private function setListData():void
{
var len:int = 20;
for (var i:int=0; i<len; i++)
{
var obj:Object = {};
obj.label = "TEST"+i;
_listData.addItem( obj );
}
}
//EventHandlers
private function onTouchEnd(evt:Event):void
{
navigator.pushView(views.TestView,{text:list.selectedItem.label});
}
]]>
</fx:Script>
<s:List id="list" width="100%" height="100%" click="onTouchEnd(event)" touchEnd="onTouchEnd(event)"/>
</s:View>
TestView.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="TestView"
creationComplete="configure()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
private function configure():void
{
lbl.text = data.text;
}
// event handlers
private function onBackClick(evt:Event):void
{
navigator.backKeyHandler();
}
]]>
</fx:Script>
<s:VGroup width="100%" height="100%"
horizontalAlign="center" verticalAlign="middle">
<s:Label id="lbl" fontSize="20" color="#FF8000"/>
<s:Button label="back" click="onBackClick(event)"/>
</s:VGroup>
</s:View>
'개발 > Andriod' 카테고리의 다른 글
구글 태블릿 OS 허니콤 동영상 (0) | 2011.01.08 |
---|---|
프로페셔널 안드로이드2 애플리케이션개발 (0) | 2010.09.24 |
Comments