Using StageWebView as background for your app in Flex.

January 23, 2013

Basic thing about StageWebView class is that it is used to display html content in your app. To be more clear on that it is ‘rendered above all display list content’. Now having said that you cannot place/put other content like flex controls/components like a Button or List on above it.

Read the rest of this entry »


Packaging a native extension (Example batch file with all the options necessary to make one)

January 5, 2013

There has been a lot of questions and confusion on actually writing your batch file to compile/package your ANE file. Well i have decided to create a prototype of the batch file and share it here on my blog.

Your .bat file contents are as below.

set adt_directory=C:Program FilesAdobeAdobe Flash Builder 4.6sdks4.6.0bin
set root_directory=C:Projects
set library_directory=%root_directory%NativeExtLibrary
set native_directory=%root_directory%NativeExt
set signing_options=-storetype pkcs12 -keystore "C:Projectsp12key.p12" -tsa none
set dest_ANE=%root_directory%nativeExtPackagingANE.ane
set extension_XML=%library_directory%srcextension.xml
set library_SWC=%library_directory%binNativeExtLibrary.swc
set SWF_directory=%library_directory%binNativeExtLibrary
"%adt_directory%"/adt -package %signing_options% -target ane "%dest_ANE%" "%extension_XML%" -swc "%library_SWC%" -platform Android-ARM -C "%SWF_directory%" library.swf -C "%native_directory%" NativeExt.jar

Below explaining the variables in your bat file.

root_directory – root folder of your flex projects.
library_directory – location of your Native extension wrapper Flex library project.
native_directory – location of your native extension project(for Android-ARM it will be android project location).
signing_options – signed certificate for your extension and its options (-tsa none option to discard timestamp).
dest_ANE – location to create your ane file.
extension_XML – location of Native extension wrapper Flex library project extension descriptor file.
library_SWC – location of your Native extension wrapper Flex library project compilation file.
SWF_directory – location of your library.swf file.
Android-ARM – packaging ane for Android

Read the rest of this entry »


Interaction Mode in Flex

December 28, 2012

Interaction mode defines how you allow your app to interact with an app user. Interaction mode is again based on Theme you choose for your app, namely Halo, Spark, Modile. Default Interaction mode for Halo, Spark is mouse and for Mobile its touch.

But what if you want a different interaction mode rather than the default one, well its simple to change by using ‘interactionMode’ property and its usage is given below.

Read the rest of this entry »


Load schema and access the loaded schema of database in SQLite, AIR.

December 21, 2012

As always lets do things in steps.

  1. Create necessary variables.
  2. Open connection to database file already created.
  3. Read schema from opened connection to database.

1. Create necessary variables

private var sqlConnection:SQLConnection;
private var dbFile:File;
private var sqlStatement:SQLStatement;

2. Open connection to database file already created

dbFile=new File();
dbFile=File.applicationStorageDirectory.resolvePath("myDatabase.db");

sqlConnection = new SQLConnection();
sqlConnection.addEventListener(SQLEvent.OPEN, onDBOpened);
sqlConnection.addEventListener(SQLErrorEvent.ERROR, onDBError);
sqlConnection.open(dbFile);

3. Read schema from opened connection to database
Read the rest of this entry »


December 13, 2012

Hi All,

I have moved my blog from www.flexonblog.wordpress.com to www.99thoughts.com/flex_blog.

Sorry for any inconvenience, please update your links and such.

Hope to look forward to your support.


Tips on Spark List control and Spark DataGrid control

May 30, 2011

In Halo DataGrid control and Halo List control you would use the property scrollToIndex(index:int)  to specify to make the item at that index visible.But in Spark List control and Spark DataGrid control you should use different properties like below.

For Spark List

ensureIndexIsVisible(index:int);

For Spark DataGrid (version 4.5)

ensureCellIsVisible(index:int); 

and then there’s also setSelectedIndex(index:int); for Spark DataGrid

Enjoy the tip.


Image Cropping in Flex

January 31, 2011

Even though there are many posts on this particular topic still there are many ???, then i thought may be i can write about it, so lets get started.

Lets do things in steps.

  1. Load Image in to Flex App
  2. Convert it to Bitmap and BitmapData objects.
  3. Crop Image using BitmapData object

1.Load Image in to Flex App

private var imageLoader:Loader = new Loader();

private function fnInit():void
{
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadImageComplete);
imageLoader.load(new URLRequest(“assets/flower.png”));
}

2.Convert it to Bitmap and BitmapData objects

private var bitmapImage:Bitmap;
private var bitmapDataImage:BitmapData;

//Event.COMPLETE eventHandler for Loader

private function loadImageComplete(e:Event):void
{
bitmapImage = Bitmap(e.target.loader.content);
bitmapDataImage = Bitmap(bitmapImage).bitmapData.clone();
}

3.Crop Image using BitmapData object
Read the rest of this entry »


Follow

Get every new post delivered to your Inbox.