AIR for Mobile Tutorials, Mobile Math Apps
Good news! Doug Ensley and Barbara Kaskosz of Flash and Math have been awarded a 3-year National Science Foundation grant for the project Math Mobile Apps. As we work on the apps and overcome technical challenges, we will continue to share with mobile developers tutorials about AIR for Android as well as for iOS.
Mobile AIR: Loading an External
SWF as a Scrollable Help File
Our goals are to bundle help files with a mobile app so they can easily be accessed
without Internet connection, will not be trying on the memory, and will
scroll smoothly. Our help files contain text and graphics. We find that
bundling and loading at runtime AS3-free SWF files is a good way. We provide a custom SWFScroller
AS3 class. All Flash and AS3 source files are available for download.
Display Web Content within AIR Mobile
App - StageWebView Tutorial
There is a couple of ways to display web pages in your AIR mobile app: the navigateToURL method and the AS3 StageWebView class.
We discuss both, but focus on StageWebView as it displays web content without leaving your app.
We explain the finer points of using the class, e.g. disabling and enabling zooming in StageWebView instance.
Complete Flash CS5.5 and CS5 code ready for download.
BitmapData.draw or cacheAsBitmapMatrix
or Vector Content - AIR Mobile Experiments
You want to zoom and pan a MovieClip with static but otherwise complex vector content.
From the point of view of performance - memory and frame rate - is it better to leave it
in the vector form, draw a scaled up version into a BitmapData or use cacheAsBitmapMatrix
AS3 method available in mobile AIR? We compare these three techniques and provide Flash source
files and AS3 code which make it easy to test. Also, we show how to create
one-finger panning effect.
Zoom In on a Point in an Image and Pan
with Gestures - AIR Mobile Tutorial
We examine two important AS3 gesture events: GESTURE_ZOOM and GESTURE_PAN. We show how to use the AS3 MatrixTransformer
class to zoom around a specific point in an image rather than around the registration point. We make panning smooth
by removing GESTURE_ZOOM listener in the BEGIN phase of GESTURE_PAN. Complete source code ready for download.
Loading Images from and Saving Images
to Camera Roll - AIR for Android Tutorial
We discuss loading images from the Camera Roll on your phone into an app and saving images of the screen or a part
of the screen to the Camera Roll. Many new AS3 classes specific to AIR on mobile come into consideration. In particular,
the CameraRoll class and its methods: browseForImage and addBitmapData. We provide here complete, commented source code.
AIR for Android Simple Function Grapher App
We present our Simple Grapher - a free Android app that you can download and install from the Android Market.
Simple Grapher graphs, zooms, pans, and traces functions of one variable. Any function of a single variable can be entered and graphed.
Tapping arrows can zoom in/out on the graph or move a cursor left/right along the curve. An easy tap toggles between the zoom mode
and the trace mode. Panning is accomplished using a standard swipe gesture.
AIR for Android Angle of Elevation - Source Code
This simple app illustrates a mathematics tool implemented using Accelerometer events on your mobile device. Stand 20 meters away from a tree, point your phone at the top, and read the angle of elevation from the screen. Calculating the height of the tree becomes part of an active lesson in trigonometry. The interface is kept simple so the mathematics involved is crystal clear, and of course our code is commented diligently.
AIR for Android PeekAMaze Game - Complete Source Code
This app is a new twist on the classical maze puzzle. The purpose is to find an exit out
of a maze but at each point you can see only a portion of a maze. You have an option of 'peeking' at the
maze by dragging it in a view window. You can peek and try to remember your way out but the number of 'peeks'
is limited. At each level of difficulty, a practically unlimited number of mazes can be generated
using our custom AS3 classes, including a perfect maze generator.
AIR for Android Traffic Lights Game - Source Code
Complete source code to dowload and discussion for our TafficLightsFM Android app. Traffic Lights is
a very challenging variation and extension of the classic 'Lights Out'
puzzle. The goal of the game is to click on the lights until you can get them all to be green.
Clicking on a light will change its color, but also the color of all of the neighbor
lights attached to it. The light colors cycle through green, yellow, and red,
just like a traffic light. The puzzles are made from a grid of lights
(of varying sizes depending on the settings) which are connected in randomized configurations.
AIR for Android Rolling Cubes 3D Puzzle - Source Code
A new 3D rendition of the classic Rolling Cubes puzzle. The puzzle is very challenging
and takes a minimum of 36 moves to solve. A 'move' consists of rolling a 3D cube to the only
empty space on a grid. Initially all cubes have their black sides facing up. The goal is to invert
them so their red sides face up. We provide several simpler versions as a 'warm-up' for the main puzzle.
The post contains complete source code, including a Flash CS5 file and custom AS3 classes.
Flash CS5 AIR for Android GraphSlider
Application - Saving Puzzle State
The post contains complete source code for our GraphSlider Android AIR app that you
can download and install from the Android Market. We comment the code with special
emphasis on saving the state of the game. The app contains 30 different puzzles
at different levels of difficulty. The purpose is to solve the puzzles and to do so
in as few moves as possible to earn a three-star rating.
AIR for Android MazeFM Application, Cool Control Wheel!
We provide complete source code for our Android app, MazeFM.
The app is a new rendition of the classic maze game. Generate a new perfect
maze at a touch of a button. Steer the ball through the maze by moving your finger
around a cool and easy to use steering wheel. Choose a level of difficulty you want to play.
AIR for Android Application KaleidoscopeFM - Source Code
We provide complete source code and comments for our Android AIR app, KaleidoscopeFM, that you
can download and install from the Android Market. This simple but entertaining application uses the live feed from your phone's camera to create beautiful, dynamically changing kaleidoscopic images. Just launch the app, point your camera, and move your phone. The image on your screen keeps changing. We also provide useful links and tips how to start Flash CS5 AIR for Android development.