/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?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="Second View" viewActivate="viewActivateHandler(event)" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <![CDATA[ import mx.events.FlexEvent; import qnx.ui.buttons.BackButton; import qnx.ui.skins.buttons.BackButtonSkinBlack; import qnx.ui.skins.buttons.BackButtonSkinWhite; private function viewActivateHandler(event:FlexEvent):void { var backBtn:BackButton = new BackButton(); backBtn.x = 10; backBtn.y = 20; backBtn.setSkin(BackButtonSkinBlack); backBtn.label = "Go Back"; backBtn.addEventListener(MouseEvent.CLICK, onClick, false, 0, true); wrapper.addChild(backBtn); } private function onClick(e:MouseEvent):void { navigator.popView(); } ]]> </fx:Script> <s:navigationContent> <mx:UIComponent id="wrapper" width="120" height="100%"/> </s:navigationContent> </s:View>
URL: http://corlan.org/2011/03/28/creating-playbook-apps-with-flex-and-qnx-ui-components/