AboutFlex.net

flex,air,flash …

Archive for the ‘AIR’ Category

“Yes, it’s true the Flex camp Italy is now part of the Max Europe that will take place in december! [...]
Moreover I believe that these two events together are like nitro + glycerin, Max is great and the camp is totally user oriented…”

read the full article at http://www.flexcamp.it/2008/10/30/flex-camp-join-the-max-milan/

you can register here

Google Translator Widget

Posted by Fedele Marotti under AIR, ActionScript 3, Flex

This is an application developed using Flex and Air, that uses the power of Google Translate to translate.

If you have suggestions or comments you can write here.

Cheers,
AboutFlex Team


This example shows you how to create an Air application without the classical layout;

A part if the xml config file:

<systemChrome>none</systemChrome>
<transparent>true</transparent>

the Application:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
	xmlns:mx="http://www.adobe.com/2006/mxml"
	backgroundAlpha="0"
	showTitleBar="false"
	showStatusBar="false"
	showGripper="false"
	borderStyle="none"
	layout="vertical" height="136" width="220">
	<mx:Script>
		<![CDATA[
			private function startDragApplication():void{
				stage.nativeWindow.startMove();

			}
		]]>
	</mx:Script>
	<mx:Panel title="Application title" borderAlpha="1" width="100%" height="100%" layout="absolute" />

</mx:WindowedApplication>

The relevant code in the application :

	backgroundAlpha="0"//this sets the alpha of the background of the application to 0
	showTitleBar="false"//this sets the visibility of the titlebar to false
	showStatusBar="false"//this sets the visibility of the statusbar to false
	showGripper="false"//this sets the visibility of the gripper to false
	borderStyle="none"//this sets the style of the border to none

This example shows you how to drag an Air window from its content:

The Application:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
	xmlns:mx="http://www.adobe.com/2006/mxml"
	layout="vertical" height="136" width="220">
	<mx:Script>
		<![CDATA[
			private function startDragApplication():void{
				stage.nativeWindow.startMove();

			}
		]]>
	</mx:Script>
	<mx:Button mouseDown="startDragApplication()" label="Drag Me!!"/>

</mx:WindowedApplication>

the relevant code:

	stage.nativeWindow.startMove();/*tells the nativeWindow to
			follow the mouse;it stops automatically*/


This class uses Google Suggests to fill an array with its suggestions;

Note : this class doesn’t work on a server because of the sandbox violation;
But if you rum the application on your local machine or in an AIR project it works well

The Application:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
	applicationComplete="init()"
	layout="vertical" xmlns:ns1="it.creativesource.*"
	width="380" height="330">
<mx:Script>
	<![CDATA[
		import it.creativesource.GoogleSuggests;

		private var gs:GoogleSuggester ;

		private function init():void{

			gs=new GoogleSuggester ();
			gs.addEventListener(gs.SUGGESTED,displayResults)
		}

		private function findSuggests(e:KeyboardEvent):void{
			output.htmlText='';
			gs.findSuggests(e.currentTarget.text)

		}
		private function displayResults(e:Event):void{

			for(var i:int=0;i<e.currentTarget.dataProvider.length;i++)
			output.htmlText+=e.currentTarget.dataProvider[i]+'\n';
		}
	]]>
</mx:Script>	

	<mx:FormItem label="Write here :">

		<mx:TextInput keyUp="findSuggests(event)"  x="309" y="77"/>
	</mx:FormItem>
	<mx:FormItem label="Responses :">
		<mx:TextArea id="output" x="309" y="105" height="238"/>
	</mx:FormItem>
</mx:WindowedApplication>

The Class : - GoogleSuggester

package it.creativesource
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.EventDispatcher;

	import mx.collections.ArrayCollection;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;

	[Event(name="suggested", type="flash.events.Event")]
	public  class GoogleSuggester extends Sprite
	{

		public const SUGGESTED:String='suggested'
		private var _dataProvider:ArrayCollection=new ArrayCollection();

		public function GoogleSuggester ()
		{

		}
		public function findSuggests(string:String):void{
			var hs:HTTPService=new HTTPService();
			hs.url="http://www.google.com/complete/search?hl=en&client=suggest&js=true&q="+string+"&cp="+string.length;
			hs.addEventListener(ResultEvent.RESULT,parseResults)
			hs.send()
		}

		protected function parseResults(e:ResultEvent):void{
			var tmp:Array=e.result.split('new Array')[1].split(', "');
			_dataProvider=new ArrayCollection();
			for (var i:int=1;i<tmp.length-1;i+=2){

				tmp[i]=tmp[i].replace('"',"");
				tmp[i]=tmp[i].replace('\\x27',"'");
				_dataProvider.addItem(tmp[i]);

			}
			dispatchEvent(new Event('suggested'));
		}

		public function get dataProvider():ArrayCollection{
			return _dataProvider;
		}

	}
}

This is an alpha version of a tool developed using Adobe Flex, Adobe Air that uses Google translator services to make the job;

here is the link where you can find the tool

As I said this is an alpha version and it’s name is not definitive;

If you have suggestions or comments about it’s name or it’s features you can write here,
we will be glad to respond and if it’s possible to fulfill your requests;

Cheers,
AboutFlex Team

Adobe Max 2008/2009 is up

Posted by Magie Cannizzaro under AIR, ActionScript 3, Adobe, Events, Flash, Flex

Adobe Max 2008

The new Famous Adobe Max Event is near

this year the great Adobe Community event will be

MAX 2008 North America

San Francisco, California β€” November 16 - 19, 2008

MAX 2008 Europe

Milan, Italy β€” December 1 - 4, 2008

MAX 2008 Japan

Tokyo, Japan β€” January, 2009

All the informations and the Registration for the San Francisco date are opened!

Go and register yourself at http://max.adobe.com.