Thursday, May 15, 2008

Flex 4 (Gumbo)

Flex 4, codenamed Gumbo, is now beginning active development. The product plan is not yet complete, but a few themes are under consideration:

Design in Mind: provide a framework meant for continuous collaboration between designer and developer. Probably involves an additional component model that integrates with the existing Halo components.
Accelerated Development: take application development from concept to reality quickly. Features could include application templates, architectural framework integration, binding improvements.
Horizontal Platform Improvements: features that benefit all application and user types. Features could include compiler performance, language enhancements, BiDi components, enhanced text.
Broadening Horizons: expand the range of applications and use-cases that can leverage Flex. Features could include finding a way to make the framework lighter, supporting more deployment runtimes, runtime MXML.

Download Flex 4 build

Cheers

Varun Rathore

Flex Development Frameworks

1. Puremvc Framework

PureMVC is a lightweight framework for creating applications based upon the classic Model-View-Controller design meta-pattern.

2. Cairngorm Framework
Cairngorm Framework is the most widely accepeted framework with Flex development.

3. Prana Framework
Prana Framework is runtime control framework and made on the basis of spring framework.

4. Foundry
Foundry ( sbasfoundry ) is an ActionScript 3 / Java framework designed for Flex 2 applications development.

5. Guasax Flex Framework
Guasax is an ease of use programming framework to provide ordered and scalable Flex applications.
Life cycle of guasax framework is based in the MVC pattern to take on our program actions .

Wednesday, May 14, 2008

AIR Aplication Work Offline With Sqllite

We can make the AIR application work offline and synch with the database.

We can use sqllite databse for the offline display of data.
sqllite is just like mysql but it would create a *.db file in ur application folder
from where we can access the data.

A sample code for creating and executing the sqllite queries.

on creation complete we create a database contacts.

private function creationComplete():void
{
connection = new SQLConnection();
connection.open(File.applicationDirectory.resolvePath('contacts.db'));


var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS contacts (ID INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT, outputXML TEXT)" ;
statement.sqlConnection=connection;
statement.execute();

var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS offlineRequest (ID INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT)" ;
statement.sqlConnection=connection;
statement.execute();

}


This is very fast and effective too.

Cheers

Varun Rathore

Tuesday, February 26, 2008

Set "Loading" screen background color on Flex

Check out the compiler arguments line in the Flex properties and add
-default-background-color #PUTYOURCOLORHERE

Check the complete list compiler aurguments at :-
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=compilers_123_24.html

Monday, February 25, 2008

Granite Data Services

Its free data service provided for the flex users which is alternative to
Life Cycle data service. I have tried remoting service and it runs with good
compatibility without much code change. It also support the data push by the flex.
we can download the binary from www.graniteds.org/ .

Cheers

Varun Rathore

Tuesday, February 12, 2008

Localising And Resource Bundles in Flex 3.0

Handling resource bundles in flex 3.0 has improved a lot from the previous version.

you just need to add loacale{locale} folder in the source path of the application and have to keep the en_US or ja_JP (which ever language refrence you want to add)

then you will have to make sample.properties file in each of the language refrence folder

in properties file you will have to add
hello=Hello World

the properties which you need to access from the application(here i used hello property)

in the application we will use


we can make the mapping of the resource bundle dynamic with the following code.

add the code in the script of the application





[ResourceBundle("sample")]


[Bindable]
private var locales:Array = [ "en_US" , "fr_FR" ];

private function localeComboBox_initializeHandler(event:Event):void
{
localeComboBox.selectedIndex =
locales.indexOf(resourceManager.localeChain[0]);
}

private function localeComboBox_changeHandler(event:Event):void
{
// Set the localeChain to either the one-element Array
// [ "en_US" ] or the one-element Array [ "fr_FR" ].
resourceManager.localeChain = [ localeComboBox.selectedItem ];
}


initialize="localeComboBox_initializeHandler(event)"
change="localeComboBox_changeHandler(event)"/>




Change the -locale option to be

-locale=en_US,fr_FR

Thursday, February 7, 2008

Ant Scripting, Junit ,Flex

If you have any query regarding any of the flex data services , ant targets and Junit test cases
please feel free to contact me .

Thursday, November 29, 2007

Remoting Object Flex

In mxml this code would be used








For every method defined in the remote object there should be fault and result function


//result function
private function getFullDetailsSuccessfull(evt:ResultEvent):void
{
PopUpManager.removePopUp(initial);
CursorManager.removeAllCursors();

jobMaster.removeAll();
jobMaster = ArrayCollection(evt.result);

}

// fault function
private function getFullDetailsFailed(evt:FaultEvent):void
{
this.enabled =true;
Alert.show("There was an error communicating to theserver:"+evt.fault.faultCode);
}


Corresponding to this there should be entry in remoting-config.xml
the destination should be same defined in the mxml file



com.apnatek.business.remoting.ListJobs
request

Thursday, November 1, 2007

Flex Custom Resizable and Min-Max Panel

Here a snipplet of code which would help you to make a resizable panel which can be minimised when its not in use.




creationComplete="initComp()" >



[DefaultProperty("subComponents")]

[Event("minimized")]
[Event("maximized")]
[Event("normalized")]




















// the title property
private var _title:String;
public function set title(t:String) : void
{
_title = t;
}
[Bindable]
public function get title() : String
{
return _title;
}

// the subComponents property (default)
private var _myChildren:Array;
public function set subComponents(a:Array) : void
{
_myChildren = a;
}
public function get subComponents() : Array
{
return _myChildren;
}

private function addSubComponents() : void
{
if( _myChildren == null ) return;
for(var i:int=0; i < _myChildren.length; i++) {
panel.addChild( _myChildren[i] );
}
}

// the controlComponents property
private var _myControlChildren:Array;
public function set controlComponents(a:Array) : void
{
_myControlChildren = a;
}
public function get controlComponents() : Array
{
return _myControlChildren;
}

private function addControls() : void
{
if( _myControlChildren == null ) return;
for(var i:int=0; i < _myControlChildren.length; i++) {
controlBar.addChild( _myControlChildren[i] );
}
}

// display minimize button property
[Bindable]
public var showMinimize:Boolean = true;

// display maximize button property
[Bindable]
public var showMaximize:Boolean = true;

private function initComp() : void
{
if( !showMinimize ) minButton.width=0;
if( !showMaximize ) maxButton.width=0;
}

// minimizes (or restores) this control
public function minimize(fireEvent:Boolean=true) : void
{
if( currentState == 'minimized' ) {
currentState = '';
if( fireEvent ) dispatchEvent( new Event("normalized") );
}
else {
currentState = 'minimized';
if( fireEvent ) dispatchEvent( new Event("minimized") );
}
}

// maximizes (or restores) this control
public function maximize(fireEvent:Boolean=true) : void
{
if( currentState == 'maximized' ) {
currentState = '';
if( fireEvent ) dispatchEvent( new Event("normalized") );
}
else {
currentState = 'maximized';
if( fireEvent ) dispatchEvent( new Event("minimized") );
}
}

public function normalize(fireEvent:Boolean=true) : void
{
currentState = '';
if( fireEvent ) dispatchEvent( new Event("normalized") );
}
]]>


layout="absolute"
left="0" top="0" bottom="0" right="0"
creationComplete="addSubComponents(); addControls()">








id="minButton"
icon="@Embed('minimize_icon.gif')"
visible="{showMinimize}"
click="minimize()"/>
id="maxButton"
icon="@Embed('maximize_icon.gif')"
visible="{showMaximize}"
click="maximize()"/>






you can accesss it any where in your application using tag

Wednesday, August 1, 2007

About Me