PlayBook development: Flex and QNX UI component example


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
  3. xmlns:s="library://ns.adobe.com/flex/spark" title="Second View"
  4. viewActivate="viewActivateHandler(event)"
  5. xmlns:mx="library://ns.adobe.com/flex/mx">
  6. <fx:Script>
  7. <![CDATA[
  8. import mx.events.FlexEvent;
  9.  
  10. import qnx.ui.buttons.BackButton;
  11. import qnx.ui.skins.buttons.BackButtonSkinBlack;
  12. import qnx.ui.skins.buttons.BackButtonSkinWhite;
  13.  
  14. private function viewActivateHandler(event:FlexEvent):void {
  15. var backBtn:BackButton = new BackButton();
  16. backBtn.x = 10;
  17. backBtn.y = 20;
  18. backBtn.setSkin(BackButtonSkinBlack);
  19. backBtn.label = "Go Back";
  20. backBtn.addEventListener(MouseEvent.CLICK, onClick, false,
  21. 0, true);
  22. wrapper.addChild(backBtn);
  23. }
  24.  
  25. private function onClick(e:MouseEvent):void {
  26. navigator.popView();
  27. }
  28.  
  29. ]]>
  30. </fx:Script>
  31.  
  32. <s:navigationContent>
  33. <mx:UIComponent id="wrapper" width="120" height="100%"/>
  34. </s:navigationContent>
  35. </s:View>

URL: http://corlan.org/2011/03/28/creating-playbook-apps-with-flex-and-qnx-ui-components/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.