Live from Max Europe 2008 Serie: Preparing to leave (d-2)

November 29th, 2008 | By Cedric Madelaine

030 maxSerie00 Live from Max Europe 2008 Serie: Preparing to leave (d 2) image

Live from Max Europe 2008 Serie: Preparing to leave (d-2)

I will start in following day a serie Live from Max Europe. I am moving there tomorrow. I am looking forward to meeting a lot of people sharing ideas and attending amazing conferences.
So stay tuned on analogd’s blog.

I did a special thing to celebrate my 10 years of Adobe/Macromedia Flash Commercial Productions. This will be revealed tomorrow along first images of the venue.

All in all the free time doing networking will be great also icon wink Live from Max Europe 2008 Serie: Preparing to leave (d 2) image

I have followed closely news from Max USA, I hope that MAX Europe will be even better icon wink Live from Max Europe 2008 Serie: Preparing to leave (d 2) image

Find below the conferences I have booked: I am especially looking forward to meeting in real people behind Papervision3D and Away3d. The session on advanced Away3d will be amazing. There is also Mario Klingemann’s session on pixel manipulation, I wonder which inspiring gems he will reveal using Pixel Bender.

There’s an Nokia Open Lab on Sunday Night, it is free but there is only a limited available places!

Monday, December 1, 2008
09:30am – 11:00am MAX 2008 Opening General Session Auditorium
11:30am – 12:30pm Here Be Pixels Yellow 2
02:00pm – 03:30pm Twenty Tips and Tricks for Building Top-Performing Mobile Applications Orange 1
04:30pm – 05:30pm Advanced Papervision3D Blue 1
05:30pm – 09:30pm Welcome Reception in Community Pavilion Level 1

Tuesday, December 2, 2008
09:00am – 10:00am Adobe@Adobe: IT Innovation — It’s Not an Oxymoron Red 2
10:30am – 12:00pm General Session Auditorium
01:30pm – 02:30pm Anatomy of a Seriously Sophisticated Adobe AIR Application Blue 2
02:45pm – 03:45pm Architecture 4.0 Red 2
04:00pm – 05:00pm Wireframing Experiences and Applications Red 2
05:30pm – 07:00pm Sneak Peeks Auditorium, Level 2
08:00pm – 11:30pm Customer Appreciation Event Special Offsite Location

Wednesday, December 3, 2008
09:00am – 10:00am Flash Player Internals Yellow 3
10:15am – 11:15am Flash Lite 3: Learn How to Package and Distribute Mobile Content Red 1
11:30am – 12:30pm Finding Away3D Yellow 2
01:30pm – 02:30pm Building High-Performance Applications for Adobe AIR Blue 1
03:30pm – 05:00pm Collaborative Applications with Flex and BlazeDS/LiveCycle Data Services Green 1

Meet you in MAX Europe…

spacer Live from Max Europe 2008 Serie: Preparing to leave (d 2) image

Adobe AIR tips serie: browseForSave set default file extension and validate/modify.

November 17th, 2008 | By Cedric Madelaine

postImage 01short Adobe AIR tips serie: browseForSave set default file extension and validate/modify. image
spacer Adobe AIR tips serie: browseForSave set default file extension and validate/modify. image

In this serie I propose some quick tips for Adobe AIR products developers, which came out during my regular practice of this technology. Today topic is:

Conforming extension for a browseForSave.

This short tip allows you to ensure that the file which will be saved following a browseForSave match legal extension you have defined beforehand and if not it will apply a default extension when using the browse for save functionality. Currently File.extension is a read only property and you cannot change it directly, so I decided to manipulate the path in order to allow it. I think a setExtension and allowedExtensions property might be useful in such a situation.

import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.events.Event;

private var docsDir:File;
private const MY_DEFAULT_EXTENSION:String = "abc";
private const VALID_EXTENSIONS_LIST:Array = ["abc"];

public function mySave():void
{
	docsDir = File.desktopDirectory;
	docsDir.browseForSave("Save As");
	docsDir.addEventListener(Event.SELECT, mySaveHandler);
}
private function mySaveHandler(event:Event):void
{
	docsDir.removeEventListener(Event.SELECT, mySaveHandler);
	//Split the returned File native path to retrieve file name
	var tmpArr:Array = File(event.target).nativePath.split(File.separator);
	var fileName:String = tmpArr.pop();//remove last array item and return its content
	//Check if the extension given by user is valid, if not the default on is put.
	//(for example if user put himself/herself an invalid file extension it is removed in favour of the default one)
	var conformedFileDef:String = conformExtension(fileName);//comment: updated 17.11.2008 removed the typo
	tmpArr.push(conformedFileDef);
	//Create a new file object giving as input our new path with conformed file extension
	var conformedFile:File = new File("file:///" + tmpArr.join(File.separator));
	//Make save
	var stream:FileStream = new FileStream();
	stream.open(conformedFile, FileMode.WRITE);
	stream.writeUTFBytes("demo demo demo demo demo demo demo demo demo");
	stream.close();
}
private function conformExtension(fileDef:String):String
{
	var fileExtension:String = fileDef.split(".")[1];
	for each(var it:String in VALID_EXTENSIONS_LIST){
		if( fileExtension == it)
			return fileDef;

	}
	return fileDef.split(".")[0] + "." + MY_DEFAULT_EXTENSION;
}

Feel free to add any comment!

spacer Adobe AIR tips serie: browseForSave set default file extension and validate/modify. image