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

Tuesday, July 31, 2007

Why Flex ?

World is recognising flex day by day so come up and have your hands with me in flex.
I have list of flex components which can be customised according to your needs ,
just pass your quieres to my mail and i would surely help you with your problems on flex.
The best combination is of tomcat +mysql+flex .

Monday, July 23, 2007

Welcome to Varun's Technical knowledge Base

I hope there is something for you.

About Me