set styles to the Selected ItemRenderer

February 8th, 2010

Some times the item render selection can’t changes when we select it .So we must to over ride the updateDisplayList function.

override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {

super.updateDisplayList(unscaledWidth, unscaledHeight);

if(ListBase(owner).isItemSelected(data)) {

imageBox.setStyle(”styleName”,”thumbnailBoxSelect”);

} else {

imageBox.setStyle(”styleName”,”thumbnailBox”);

}

}

Report This Post

Apply style for text area in Adobe flex using filters.

February 8th, 2010

For change the style of a text area we can use filters. the example is give below .

<mx:filters>

<filters:DropShadowFilter inner=”true” distance=”0″ blurX=”10″ blurY=”10″ color=”#D2D2D2″ />

</mx:filters>

Report This Post

Cairngorm Architecture

There is 3 folder occurred.

1.control
2.model
3.view

view
—————————————————————————————————————

folder contain the UI part of the project.
like custom components

add thes file in main mxml file

model
—————————————————————————————————————
modules

it contain each component model locater
utils
it contain some utils files
vo
Data Transfer Objects are called vo
then the main application model locater

control

————————————————————————————————————————————————————

Controller.as file is main file

public class Controller extends FrontController
{
public function Controller()
{
addCommand(Controller.LOOKUP,LookUpCommand);
}
public static const LOOKUP:String = “lookUp”;
}

commands

——————————————————————————————————————————-

it contain all command files

public class LookUpCommand implements IResponder, ICommand
{

public function execute(event:CairngormEvent):void
{
reqEvent = event as LookupEvent;
var delegate:LookUpDelegate = new LookUpDelegate (this);
requestType = reqEvent.reqString;

switch(requestType)
{
case LookupEvent.GET_PROGRESS_MAP_INFO :
delegate.getProgressMapInfo();
break

}
}

public function result(data:Object):void
{
switch(requestType)
{
case LookupEvent.GET_PROGRESS_MAP_INFO :
model.pointOfInterest = data.result.pointOfInterest;
model.plotPoints = data.result.plotPoints;
break

}
}

public function fault(info:Object):void
{
Alert.show(info.message.faultDetail);
}

delegates

——————————————————————————————————————————————-

it contain main service.mxml and other delegate pages

service

Delegate
file contain

public class LookUpDelegate
{
private var responder:IResponder;
private var roCategory:RemoteObject;

[Bindable]private var model:AdminModelLocator = AdminModelLocator.getInstance();

public function LookUpDelegate(responder:IResponder)
{
this.roCategory= ServiceLocator.getInstance().getRemoteObject(’kcaeService’);
this.responder = responder;
}
public function getProgressMapInfo():void
{
var token:AsyncToken = roCategory.getProgressMapInfo();
token.resultHandler = responder.result;
token.faultHandler = responder.fault;
}

}
Event

————————————————————————————————————————————————–

public class LookupEvent extends CairngormEvent
{
/**
* @private // request type
* */
private var _eventType:String;

/**
* static event type constants
* */
public static const GET:String = ‘get’;

/**
* constructor
* */
public function LookupEvent(type:String)
{
super(Controller.LOOKUP);
this._eventType = type;
}

public function get reqString():String
{
return _eventType;
}

}

Report This Post