Adobe Flash Lite

June 28, 2011

Flash Tip: How to Handle Hardware Keyboard Events in Flex Mobile Applications

Filed under: Flash Tip — Tags: , , — Li YongFei @ 10:12 pm

Stephen Gilson has posted a new article in his Adobe blog:  Handle Hardware Keyboard Events in A Flex Mobile Application. In a mobile application built in Flex, you can detect when the user presses a hardware key on a mobile device. For example, on an Android device you can detect when the user presses the Home button, Back button, or Menu button.

To detect when the user presses a hardware key, create an event handlers for the KEY_UP or KEY_DOWN event. Typically, you attach the event handlers to the application object as defined by the Application, ViewNavigatorApplication, or TabbedViewNavigatorApplication containers.

The Stage object defines the drawing area of a Flex application. Each application has one Stage object. Therefore, an application container is actually a child container of the Stage object.

On a mobile device, your application can be interrupted by another application. For example, the mobile device can receive a phone call while your application is running, or the user can switch to a different application.  When the user switches back to your application, the Stage.focus property is set to null. Therefore, event handlers assigned to the application object do not respond to the keyboard.

June 24, 2011

Flash Tip: How to Get Rid of the Action Bar in Flex 4.5

Filed under: Flash Tip, Flex 4.5 — Tags: , , , — Li YongFei @ 1:26 am

Terrence Ryan has posted a new Flash tip: Flex Mobile – Getting Rid of the Action Bar, in this article you can use the Flex 4.5's viewNavigatorApplication framework.The ability to manage the various screens of your application is really useful and powerful. But one part of it doesn't make sense in all applications.

ActionBar is the UI chrome at the top of the app that contains the screen title and any application navigator features you use. This make a lot of sense in iOS or PlayBook apps, where the entire UI is software based, but in Android, you should use the hardware buttons. If all of the controls move off of the ActionBar, then depending on your needs it might make sense to get rid of it completely.

If you want to get the complete of this article, you can visit Terrence Ryan's blog.

June 13, 2011

Flash Tip: Overriding the BACK key press in AIR mobile Apps

Filed under: Flash Tip — Tags: , , — Li YongFei @ 8:29 am

Via PolyGeek, here is a Flash tip,  he default transition between Views in Hero is to slide the next view in from the right when changing Views via navigator.pushView( NextView ); and then if you set navigator.popView();, or if the user hits the back-key, then the transition will be the new screen sliding in from the left. It’s very good for back and forth transitions. If that’s all you need then your set.

But you can see in my navigation layout that I want some of the screens to slide in from the top or bottom. It’s very easy to set up a custom transition to handle that. The problem comes when the user hits the back-key because the default transition is to slide left.

Here’s a layout of the app navigation

December 16, 2010

Flash Tips: Six Flex mobile application Tips

Filed under: Flash Lite Tips — Tags: , — Li YongFei @ 11:39 pm

Michaël CHAIZE has posted 6 Flex mobile application tips, Michaël shared us some tips to improve the behavior of your native apps. Flash Builder Burrito (still in beta) lets you develop native applications for Android devices and the BlackBerry PlayBook.

The following is the tips list:

  1. TIP #1: Kill your application
  2. TIP #2: Load your data before pushing a view
  3. TIP #3: Display a custom label
  4. TIP #4: Always declare a splash screen
  5. TIP #5: Check the orientation of the screen
  6. TIP #6: Use custom layouts

http://www.adobe-flashlite.com/wp-content/uploads/2010/12/2139253cy.jpg

[image from RIA groa]

December 8, 2010

Flash Tip: How to add swipe gestures to you mobile Flex application

Filed under: Flash Lite Tips — Tags: , — Li YongFei @ 5:48 am

Steven Peeters has posted a new flash tip on his blog: Adding swipe gestures to you mobile Flex application, Steven said you can choose 2 options to use the gesture to move things around or go from screen to screen etc.

1. Using ActionScript to attach an event listener

private function initView():void {
   addEventListener(TransformGestureEvent.GESTURE_SWIPE, onSwipe);
}

2. capture the gestureSwipe event on the View tag

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            gestureSwipe="onSwipe(event)"/>

http://www.adobe-flashlite.com/wp-content/uploads/2010/12/034821ht9.jpg

Via Flexpert

November 4, 2010

Flash Tip: How to Optimize Flash Content for Mobile Devices

Filed under: Flash Lite Reviews — Tags: , — Li YongFei @ 10:08 pm

Ben Stucki has posted a new article "Optimizing Flash Content for Mobile Devices", the article was broken up into four main areas: optimizing graphics and media, Flash rendering optimizations (which made up the bulk of my talk), memory use and code execution, and benchmarking.

Here are a list of quick fixes for reference.

Rendering Optimizations

  • FrameRate – sometimes reducing framerate results in smoother playback.
  • Change StageQuality (Low, Medium, High, Best).
  • Use the appropriate DisplayObject (Shape, Sprite, MovieClip).
  • Flatten the DisplayList tree.
  • Avoid using the alpha property.
  • Avoid using blendmodes or filters.
  • Stop running MovieClips.
  • Avoid off-stage objects.
  • Set visibility to false or removeChild (depending on reuse etc.).

Memory use and CPU

  • Focus on perceived performance first (progressive loading, avoid screen freezes, etc).
  • SQLite database and query optimizations can go a long way in data intensive apps.
  • Use data-chunking across frames to avoid screen freezes.
  • Are you using asynchronous calls? Should you be? (Synchronous locking vs. Asynchronous overhead)
  • Don’t trigger unnecessary rendering. (Don’t set TextField text inside of loops, etc.)
  • Avoid RegEx when you can use String functions (indexOf, lastIndexOf, search).
  • Avoid timers (consider using a single, global instance when needed).
  • Vector is faster than Array, multiplication is faster than division, etc – but only in very high iteration!

If you want to get the details, you can visit Ben Stucki's blog.

Adobe Flash Lite 2008-2011 All rights reserved.