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 »

Advertisements

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 »


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.


Tip on Panel Class in Flex

December 16, 2009

Often hear questions on Alert Control like, remove default Button(OK),add new Button’s and so on.., and on TitleWindow like, re-arrange close Button to top-left,add new Buttons and so on..

One thing we got to notice at first is that TitleWindow and Alert are Classes which are derived from Panel Class, which in turn is derived from Container Class, so Alert and TitleWindow are sub-classes of Panel Class, they are created by addding new functionality[methods and properties] to the Panel Class.And the final tip is that, look in to the code,look in to the Class Diagram and if you dont have one then download it here , make a print and stick to a wall near you.

So, having said that you need to decide an appropriate implementation based of your requirements.Example, if you dont want to show OK(default Button) Button on the Alert Control,then better not to use Alert Control, go for a Panel,which is appropriate.

Below fig shows the Relational Diagram of Container,Panel,Alert and TitleWindow Classes.

Relational Diagram of Panel,Alert,TitleWindow

Enjoy the Post.


A Tip on Alert Control in Flex

July 24, 2009

Question:

How to disable selectivity on Alert control display message?

(or)

Alert control display message should not be selectable.

Solution:

var alert:Alert=Alert.show(“Cannot select this text!!!”);
alert.mx_internal::alertForm.mx_internal::textField.selectable=false;

Enjoy the post.