Extending Air to system Level (Idea :) )

March 10, 2008 at 7:44 am (Air) (, , )

The Air frameword does not provide  wide functionality in respect of system utilities.

So we can extend the functionality of Air App to system level using any other supportive language liken , VB, .net , java, php or any othe as per the OS. we can make a socket server from any native langauge and communicate to the system using that server.

we just have to have awrapper exe which will first start the socketserver and then launch the Air App,

the air app can communicate to the server using socket soncetion and server onthe other hand can communicate to the system for any system level fucntionality.

this is just a proof of concet which even i have not yet tried.

a very good Example

Permalink Leave a Comment

swf version 9 decompiler is out

March 8, 2008 at 2:17 pm (news)

The Flash 9 player Swf decompiler is released from sothink
for now it supports on swf generated from cs3 and not the flex based swf may be because of the flex framework classes embede in it (just a guess)

http://www.sothink.com/product/flashdecompiler/index.htm

Permalink Leave a Comment

nokia launches SoulOfTheNight for N82

March 8, 2008 at 9:08 am (news)

Permalink Leave a Comment

know network status in Air ::

March 8, 2008 at 5:07 am (Air)

Check this a Usefull tip for Air apps connecting to web

import air.net.SocketMonitor;
import air.net.ServiceMonitor;
import flash.events.StatusEvent;
var socketMonitor:SocketMonitor;
function onInit():void
{
NativeApplication.nativeApplication.addEventListener(Event.NETWORK_CHANGE, onNetworkChange);
socketMonitor = new SocketMonitor(‘192.168.2.56′,80);
socketMonitor.addEventListener(StatusEvent.STATUS, socketStatusChange);
socketMonitor.start();
}
function onNetworkChange(e:Event):void {
trace(e+” Status change. Current status: ” );
}

function socketStatusChange(e:StatusEvent):void {
trace(“Status change. Current status: ” + socketMonitor.available);
}

Permalink Leave a Comment

:: ArrayCollection To XML ::

March 5, 2008 at 12:02 pm (Flex)

var images_arr = new ArrayCollection()
images_arr.addItem(new testVO(obj))
images_arr.addItem(new testVO({labelA:4,labelB:1}))
images_arr.addItem([new testVO({labelA:4,labelB:2}),new testVO({labelA:4,labelB:2})])
images_arr.addItem(new testVO({labelA:4,labelB:3}))
images_arr.addItem(new testVO({labelA:4,labelB:4}))
images_arr.addItem(new testVO({labelA:4,labelB:5}))

var str:String = “<Data name=’”+ClipsName+”‘></Data>”
var dpXml = new XML(str);
Alert.show(parse(images_arr,dpXml,false).toXMLString());

private function parse(refArrayE:ArrayCollection, str:XML,arributes:Boolean = false):XML
{
var refArray:ArrayCollection = refArrayE;
var newnode:XML = str;
var newnodeI:XML;
var i:int=0;
while (i<refArray.length)
{
var nodeName:String = String(“clip”);
if( ! ( refArray.getItemAt(i) is Array ) ){
if(arributes){
newnodeI = <slide> </slide>
for( var j:String in refArray.getItemAt(i))
{
newnodeI.@[j] = refArray.getItemAt(i).labelA;
}
newnode = newnode.appendChild(newnodeI);
}else{
newnodeI = <slide> </slide>
for( var j:String in refArray.getItemAt(i))
{
newnodeI = newnodeI.appendChild(<{j}>{refArray.getItemAt(i)[j]}</{j}>);
}
newnode = newnode.appendChild(newnodeI);
}
}else if((refArray.getItemAt(i)).length > 0)
{
newnodeI = <slide> </slide>
newnode = newnode.appendChild(newnodeI);
newnodeI = parse( new ArrayCollection((refArray.getItemAt(i)) as Array) ,newnodeI,arributes);
}
i++;
}
return newnode;
}
The Only importent thing is that the testVO to be a dyanmic class and all propeties of this should be added dyanmically :)

Permalink Leave a Comment

simple search Component

March 4, 2008 at 5:37 pm (Flex)

use ::
<component:searchComp dataProvider=”{ArrayCollection}” filterProperty=”type”  width=”200″ />

This is how we can create a dyanmic filter funtion to work on different properties of object

private function filterFunc(item:Object):Boolean
{
if(String(item[filterProperty]).indexOf(searchTxt) >= 0)
return true;
else
return false;
}

Component Code ::

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Canvas xmlns:mx=”http://www.adobe.com/2006/mxml” creationComplete=”onInit()”>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;

private var searchTxt:String;
public var filterProperty:String = "label";

[Bindable]
public var dataProvider:ArrayCollection;

private function onInit():void
{
dataProvider.filterFunction = filterFunc;

}

private function filterFunc(item:Object):Boolean
{
if(String(item[filterProperty]).indexOf(searchTxt) >= 0)
return true;
else
return false;
}

private function onTextChangeHandler(event:Event):void
{
searchTxt = event.target.text;
dataProvider.refresh();
}
]]>
</mx:Script>
<mx:Label id=”serch_lb” text=”Search”  left=”2″ top=”4″/>
<mx:TextInput id=”serch_txt” text=”" right=”2″ top=”4″ left=”50″ change=”onTextChangeHandler(event)”/>
</mx:Canvas>
see here :: http://jasmeetsehgal.googlepages.com/searchCompSample.html

Download the source and rename it to rar and unzip for using it

source

Permalink Leave a Comment