Wednesday, April 7, 2010

Clock in Flex

Hi The way you want to develop digital clock in flex is
private var timer:Timer;

private function init():void {
this.timer = new Timer(1000);
this.timer.addEventListener(TimerEvent.TIMER, this.resetNow);
this.timer.start();
}


private function resetNow(event:TimerEvent):void {
this.clock.text = new Date().toLocaleTimeString();
}

]]>



Wednesday, March 10, 2010

Storing in ArrayCollection if the result is only one object

if(flash.utils.getQualifiedClassName(acSubcatTemp[j].product).toString()=="mx.collections::ArrayCollection")
{
arraycollection = arraycollectiondemo[i]
}
else
{
arraycollection = new ArrayCollection(ArrayUtil.toArray(acSubcatTemp[j].product));
} }

Tuesday, March 9, 2010

Image resize in Flash

var disp:DisplayObject = leftImageLoader.content as DisplayObject;
var thumbBMD:BitmapData = new BitmapData( 240, 149, false, 0xffffff );
var area3:Rectangle = new Rectangle( 0, 0, 240, 149);
var matrix:Matrix = DisplayUtils.fitIntoRect( disp, area3, true, Alignment.MIDDLE, false );
thumbBMD.draw( disp, matrix, null, null, null, true );
var thumb:Bitmap = new Bitmap( thumbBMD, "auto", true );
thumb.smoothing = true;
expandedImageLeft_mc.addChild(thumb);

Monday, March 8, 2010

Calculating Number of Days between two dates

private function calcuateDays( start:Date, end:Date ) :int
{
var daysInMilliseconds:int = 1000*60*60*24
return ( (end.time - start.time) / daysInMilliseconds );

Wednesday, March 25, 2009

actionscriptspring is in blaaaaaaaa

actionscript now with spring has came so the programming of actionscript now we can do with spring frame work that is IOC DEPENDENCY INJECTION all these will be now with
springactionscript
i will update shortly

Saturday, February 28, 2009

RED 5 SERVER

HI all

Red5 server is for streaming live videos and it is totally coded based on java
so for java developers who are experienced it is quite easy and the way it streams.
It is also coded based on spring frame work and there are some configuration files for configuring the permissions and some client code for getting streaming from server

cairngorm vs pureMVC frame works

pure mvc
pros:
- it is lightweight framework
- it is written as an Flash, Flex and AIR framework so you can use it everywhere
- it is very well documented
- samples you can find on the official site are enough to get you started
- Cliff Hall (author) is actively working on it and working on educating people

cairngorm framework
pros:
- it is developed and used by Adobe consulting
- it has a lot of resources on the internet
- probably most developers are familiar with it

cons:
-
singletons are referenced everywhere
- it doesn't follow don't repeat yourself pattern


Thursday, February 26, 2009

links for cairngorm

www.davidtucker.net/presentationFiles/360FlexPresentation.pdf

about cairngorm architecture

Hi all

For RIA developers the new architecture from adobe is cairngorm. cairngorm is implementing multiple design patterns and it is light weight architecture for developing large applications.
It is not best suit for developing small scale applications and the seperation is very fine and event handling also very neat