Skip to content
bustardcelly edited this page Oct 25, 2010 · 22 revisions

as3flobile is a set of ActionScript 3 components targeting the Flash Player on Mobile Devices, whether it be embedded in the browser or in an Adobe AIR application. There is also an extension project for as3flobile (as3flobile-air) that utilizes functionality available from the AIR SDK, such as TouchEvent.

as3flobile aims to provide a set of components that function within the paradigm of a mobile user interface where a mouse and keyboard are not the primary source of interaction.

To view a quick example of the componenets in as3flobile, put your Flash-enabled browser on most popular mobile devices to: http://www.custardbelly.com/android/froyo/as3flobile/

Core

At the core of the controls API is AS3FlobileComponent. AS3FlobileComponent is a base component for all controls that exposes protected methods and handlers for ease in creation of new components as well as properties that pertain to padding and skinning. A few DisplayObject properties are overridden (such as width and height) to manage internally. To read more about *this core component visit AS3FlobileComponent.

Controls

The following is a list of currently available controls within the API.

  • Label – Label displays single and multiline textual content with optional autosizing and truncation.
  • Button and ToggleButton – Button and ToggleButton are touch display controls for click and toggle selection.
  • TextInput – TextInput is a single and multiline input for textual content.
  • CheckBox – CheckBox is a control to toggle the flag value of a model.
  • RadioButton & RadioGroup – RadioButton is a control to toggle the flag value of model, while RagioGroup manages multiple RadioButton instances.
  • ScrollViewport – ScrollViewport is a scrollable viewport area driven by user gestures.
  • ScrollList – ScrollList is a scrollable list driven by user gestures.
  • Picker – PIcker is a multiple scroll list control to manage selection of multiple items.
  • DropDown – DropDown is a multi-button control that manages a list of options to select from.
  • TextArea – TextArea is a scrollable display of textual content.
  • Slider – Slider is a horizontal or vertical control to select a value within a given range.
  • ToggleSwitch – ToggleSwitch is a switch to turn from one value to the other.
  • Menu – Menu is a composite control of submenu panels that display options. ** Menu has been moved to as3flobile-android
  • RangeSlider – coming soon.

Skinning

Skinning has been kept pretty basic. The AS3FlobileComponent core class exposes two properties pertaining to skinning: skin and skinState. It is on the onus of the custom control to provide the default skin and update the skinState property as necessary.

Default skins for the provided controls in the as3flobile package can be found in com.custardbelly.as3flobile.skins.

The base class for all skins is Skin which is an implementation of ISkin. These essentially work with a target (ISkinnable) to update the graphic displays and position of elements within a target control. It is important to note that if you look at the default skins in com.custardbelly.as3flobile.skins that the skins target the associated control directly (unless the properties available on ISkinnable are enough to work with in the context). This was done to lower the overhead of multiple interfaces just to represent a control and its skinnable displays. If you are creating a skin, it is assumed what control you want to work with. ISkinnable (from which AS3FlobileComponent implements) exposes a few simple properties to aid in skinning, but does not try to expose all the display instances that may be available in a control that is being skinned.

But, yes, you can skin your heart away!

You can’t perform that action at this time.