How to prepare yourself for Flash CS4 ACE exam

Just passed! I become Adobe Certified Expert on Flash CS4!

Like Flex with AIR certification I’d like to share my experience to prepare yourself for ACE exam of Flash CS4.

First of all… EXPERIENCE! You must work, play and work & play with Flash CS4 IDE and Actionscript 3.
More experience you have on Flash development less you must study for the exam and you have more chance to pass.

Obviously, it’s so difficult to know everything about Flash CS4 from all IDE controls to Actionscript 3 and OOP so there are 2 books that could be helpful to solve this “issue”.

With those book you can create a good base to try ACE exam for Flash CS4 but, if you have read Essential Actionscript 3 could be better for Actionscript side and for your daily work ;).
Another good suggestion is to read Help guide of Flash, in fact Adobe made an impressive job on that guide and you can find lots of interesting stuff; you can download a guide PDF file directly from this link.

Try everything, from import PSD or AI files to prepare files for web or desktop application with AIR, because you may find some questions about AIR and own code syntax!

Finally test yourself before real exam with a very good service (I really appreciate it) like acequestions.com with less then $10 you can try how Flash CS4 exam works and also which kind of questions you could find in that certification.
That’s it! Take a look at Adobe site to read all information to become Adobe Certified Expert and… GOOD LUCK!

Memento Pattern in Actionscript 3 (UNDO/REDO)

Happy new Year everybody!

I’d like to begin 2010 with a design pattern argument.

First design pattern of this year is Memento pattern, that could be very useful if you are working on an AIR desktop application or in a Flex RIA and you want to make an history of user’s actions.
In fact this pattern is used to make undo and redo in an application.

Memento pattern is tightly coupled with originator object and it’s usually composed by 3 different parts:

  • memento
  • caretaker
  • originator

Originator is object that pass data to caretaker and it saved them in a couple of arrays (undoArray and redoArray).
So caretaker is an object that stores a memento snapshot and, if originator needs, pass undo or redo data to this object.

I prepare a sample to understand better what could you use Memento pattern in your applications (“view source” option is activated).
I wrote a Memento class with a Singleton to centralize all users actions,then I create a MementoVO that is a dynamic class to help me store data from each object used by the user, you could use a simple Object instead of a dynamic class to save more memory if you prefer.
Sample is very easy but useful for Memento pattern purpose, in fact you can move windows trough the stage and our “history” class (Memento.as) saves their positions when saveAction method is called by the originator (an instance of CustomWin).

Memento class has 4 essentials methods that are:

  • undo()
  • redo()
  • saveAction(_obj:Object)
  • saveRedoAction(_obj:Object)

I start from the end, saveRedoAction, last method, is used to save the position of a window before I restore its positions, usually Redo action is used only one time, but if you want you could create an Array and work with multiple Redo.

Another important method is saveAction that is called when mouse down event was triggered and it stores in memento class own old position and object itselfs.

First two methods need to undo and redo an user action, it’s easy isn’t it?!

I think that in this year I’ll share lots of those patterns with you to share our knowledge together so feel free to add comment at this post and we could make an interesting and useful conversation, I’m totally sure!

Review of “Confessions of a public speaker”

I’m so happy to make a review of Confessions of a public speaker because it was an inspire book for me that gave me tons of tricks and confirmed feelings that I’ve when I make speech.

Scott Berkun, the author, is a young guy very passionate about his job, he had a great past working for big companies like Microsoft in IE team and not only.
He wrote great books like Making things happen or The Myths of Innovation, I read only the first one and it was very good.

In Confessions of a public speaker you can find everything that you need to grow your skills like speaker, in fact Scott describes own feelings during particular situation, he talks about how to manage crowd in a room and how to create a connection with people in your room and this is only the beginning…
With his informal writing he shares with us own experiences and a part of him, I think is the best way to teach how to grow like speaker but also like teacher.
He dedicates a chapter to explain different approaches between a teacher and a public speaker, I really appreciate a lots because I found similitudes trough Scott’s book and last course for trainers that I took part last year.
For a teacher and speaker like me this book is like a light in the hell that give me new motivations to do my job better and explain me how to prepare myself in a new way that could give me opportunity to make better speech and give to people more.

I suggest to everyone to have a copy of this book that you are a public speaker or an account of a company, it really help you to prepare better an important appointment and to create a connection with you audience.

Are you a developer? Great! Take this survey

Hi everyone,

this post is very important, for us but also for you.
If you are a developer we want to know your opinion!

With my company, we are starting a new software development  dedicated to developers, made from developers to developers.
So we’d like to hear your voices, help us to make a better software for developers world.

Take this survey, it’s only few questions but they help us to know how you expect from a new tool for developers.
Don’t worry, in next few weeks I’ll give you more informations about that, but until now, please take the survey and thank you in advance to everyone.

Feel free to leave a comment or contact me via email for any questions.

Multitouch with Actionscript 3 and AIR 2.0

AIR 2.0 is out with a BETA version on labs since a couple of weeks ago more or less.
It introduces a lots of new features like UDP protocol, Socket server implementation, access to raw micrhophone data, multitouch and gesture support and so on.

When I see multitouch and gesture support I start to think how many devices are touchscreen based and they are growing a lots in those months, so I start to investigate about that features.
First of all I suggest to read a cool article on devnet made by Christian Cantrell, he goes in deep about this new features and give you a lots of information about Multitouch, TouchEvent and gestures.
It’s so interesting because you can see compatibility of that features with different OS also.

In this post, I’d like to share with you a little sample on how you can create an AIR 2.0 application with Flash Builder and test it with a macbook trackpad.
In fact, you can use macbook trackpad gesture because they are supported on AIR and it’s so interesting, for example, if you want to test an application for new Wacom Bamboo pen & touch and you haven’it.
Wacom Bamboo has a new AS3 SDK for Flex and Flash that allow you to work with multitouch and gesture too, it could be so interesting if you don’t have a multitouch for an expo and you want to buy a cheap solution to give a cool interaction for your possible new clients.
Bamboo has also the availability to create “minis” that are applications dedicated to Wacom Bamboo, but you can read more at Wacom developer website.

So, in this sample we load an external image and we use gesture to try our macbook trackpad:

package {


import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.TransformGestureEvent;
import flash.text.TextField;
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;


public class MultiTouchSample {


Multitouch.inputMode = MultitouchInputMode.GESTURE;
private var sq:Sprite;


public function MultiTouchSample() {


sq = new Sprite()
addChild(sq);


this.addEventListener(TransformGestureEvent.GESTURE_ZOOM, scaleObj);
this.addEventListener(TransformGestureEvent.GESTURE_PAN, panObj);
this.addEventListener(TransformGestureEvent.GESTURE_ROTATE, rotObj);


var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE, addImg);
l.load(new URLRequest("img/sample.jpg"));
}


private function addImg(e:Event):void{
sq.addChild(e.target.content);
sq.scaleY = sq.scaleX = .2;
}


private function rotObj(e:TransformGestureEvent):void{
sq.rotation += e.rotation;
}


private function panObj(e:TransformGestureEvent):void{
sq.x += e.offsetX * 2;
sq.y += e.offsetY * 2;
}


private function scaleObj(e:TransformGestureEvent):void{
sq.scaleX *= e.scaleX;
sq.scaleY *= e.scaleY;
}
}
}

You can see that is so simple work with gesture, a couple of suggestions before starting work with them:

  • remember to verify which gesture are supported on your system, more information you can read on devnet article about multitouch and gesture
  • TransformGestureEvent is event class dedicated to gesture
  • you can use TouchEvent also

Feel free to leave a comment and thank you to visit this blog.

Moving to LiveCycle Collaboration Service

We saw an year ago during San Francisco MAX a great project called COCOMO that allowed developers to take all features in Acrobat Connect (chat, webcam and audio streaming…) and to add in your Flex application with few lines of codes and with this “library” pre-built very easy to use.

This year at MAX in L.A. I followed a very interesting seminar about LiveCycle Collaboration Service (LCCS) that is the final name of the project COCOMO.
LCCS is very interesting for many reasons:

  • easy to use
  • very cheap service
  • very well documented
  • customizable and integrable with own desktop application or RIA made with Flex
  • open new opportunities for customer care solutions and other kind of applications

EASY TO USE

Yes, you can create your application with LCCS integrated with few lines of code. An example?
This is a little conference call environment:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="0xFFFFFF"
minWidth="400" minHeight="600" xmlns:rtc="AfcsNameSpace">
<mx:Script>
<![CDATA[
protected function startTalk():void{
pubAudio.publish()
}
protected function stopTalk():void
{
pubAudio.stop();
}
]]>
</mx:Script>
<rtc:ConnectSessionContainer id="cSession"
roomURL="https://connectnow.acrobat.com/user/room">
<rtc:authenticator>
<rtc:AdobeHSAuthenticator userName="***********" password="************"/>
</rtc:authenticator>
<mx:VBox width="100%" height="100%" horizontalAlign="center">
<rtc:WebCamera width="320" height="240"/>
<mx:HBox width="100%" horizontalCenter="center">
<rtc:AudioPublisher id="pubAudio"/>
<rtc:AudioSubscriber/>
<mx:Button label="talk" click="startTalk()"/>
<mx:Button label="stop talk" click="stopTalk()"/>
</mx:HBox>
<mx:List dataProvider="{cSession.userManager.userCollection}"
labelField="displayName" width="100%"/>
</mx:VBox>
</rtc:ConnectSessionContainer>
</mx:Application>

That’s cool, isn’t it?
You can download the sample from this link.

CHEAP SERVICE

How much does it cost!? this is the question!
It’s cheap, LCCS is totally free you can download LCCS from Adobe site; like developer you have $15  per month to use for your test, applications and so on.
This is the LCCS “menu”1:

  • 1000 push/messages:  $0.10
  • 1GB live streaming: $0.49
  • user per hours: $0.01

No any additional cost and you don’t maintain anything because you use Adobe servers with LCCS.

VERY WELL DOCUMENTED

When you download SDK you have an AIR application that guide you to use LCCS in your Flex application, you can retrieve there API, SWC for Flex and Flash, you can manage your room and your account so you have a real console for your LCCS applications.

CUSTOMIZABLE INTERFACE AND NEW BUSINESS OPPORTUNITIES

LCCS components could be integrable with your application, so you can create an intranet dashboard with a chat or a VOIP service to communicate with others fellows or maybe you can create an interactive catalogue that help users to choose right product for own requirements.
But not only, you can create collaborative solutions with a shared whiteboard and list of users that could chat or share own ideas via VOIP.
I think that a lots of desktop applications and RIAs could become more interesting with those services and also, if you think, there are many opportunities for your business.

Finally, I think that LCCS could help all developers to make own application more fashionable and useful, but also open new doors for services that are so old.
It’s easy, it’s cheap so why don’t use LCCS?! With my company we start to propose LCCS to our customers and they are so interesting about this technology because it solves some problems in particular

Flickr mesh-up with actionscript 3, REST or SWX

Today I spend my afternoon to configure a part of a full Flash website that interact with Flickr and that retrieve data from my account without any appication authentication but only with my Flickr key.

First of all I was really impressed about how many languages you can use to bring Flickr photos and use in own desktop application or website (Real Basic, cUrl, Perl, Delphi, C…).

When you want retrieve photos from Flickr you must have a Flickr key that is totally free and you can activate one directly in the right section of Flickr site.
In the same section you can find whole documentation and lots of services expose to retrieve any kind of data from a photo, from Exif data to user or friends informations.
For AS3 we have a couple of interesting library; first one is as3flickrlib very well documented but it’s so long to start work with it because you must to find a frob ID then a token and finally you can start to work with Flickr API.
The other one is SWX, that is written by Aral Balkan and it’s too easy to mesh up any kind of popular service like Flickr, Twitter and so on.
Aral gives us availability to use SWX Service Explorer to take a look at the data and how to mesh up your application with public API, I really love it on Flash Lite too!

This is very interesting because you can retrieve all API in this library and in few line of code you can work with public services.
This is a simple example to call Flickr services with SWX, you can download source code too:

swx = new SWX();
swx.gateway = GATEWAY_PHP;
swx.encoding = "POST";
var callDetails:Object =
{
serviceClass: "Flickr",
method: "photosSearch",
args: ["", "", "#mart3"],
encoding: "POST",
timeout: 5,
resultHandler: resultPhotos,
faultHandler: faultHandler
};
swx.call(callDetails);

Another interesting way to work with Flickr API without any authentication is using REST API.
REST (Representational state transfer) is a very simple way to request data from a database, update, delete them or to create new record using HTTPHeaders and XML.
You must know that AS3 doesn’t have PUT and DELETE method but there are some libraries that create a workaround to solve this limitation and they work very well with REST (as3httpclientlib for example)
I start to approach REST a couple of months ago with Ruby on Rails and I think is amazing.

Flickr gives us REST API too, and you can see that is so simple create a Flickr gallery with REST and Actionscript 3.

We have some API that works without authentication like photos search and we use this service to retrieve data for our Flickr gallery.
First of all we take a look at service documentation on Flickr, you can see that we have a lots of opportunity to find data on Flickr; we can search photos via userID, tags, text on title or description and so on.

In Actionscript 3 we’ll use URLLoader class and prepare some url to retrieve XML data from REST.

private const FLICKR_SERVICE = "flickr.photos.search";

private const API_FLICKR:String = "c6c31464878505403f9bbbf6214ae413";

private const PATH_SEARCH_FLICKR:String = "http://api.flickr.com/services/rest/";

		

public function FlickrRest(){

			

	var varsFlickr:URLVariables = new URLVariables();

	varsFlickr.method = FLICKR_SERVICE;

	varsFlickr.api_key = API_FLICKR;

	varsFlickr.tags = "#mart3";

			

	var req:URLRequest = new URLRequest();

	req.url = PATH_SEARCH_FLICKR;

	req.method = URLRequestMethod.POST;

	req.data = varsFlickr;

			

	var urlL : URLLoader = new URLLoader();

	urlL.addEventListener(Event.COMPLETE, retrieveImages);

        urlL.load(req);

			

}

You can download source code and final sample from this link.
Finally I’d like to explain how to compose photo’s url to retrieve them on Flickr.
Flickr url is composed by some variables that you can find in REST XML or SWX result object

  1.  set FARM (ex.: http://farm”+flickrXML..photo[i].@farm+”.static.flickr.com/)
  2. set SERVER (ex.: +flickrXML..photo[i].@server+”/”)
  3. set Photo ID with underscore  (ex.: +flickrXML..photo[i].@id+”_”+”)
  4. set Secret code (ex.: flickrXML..photo[i].@secret+)
  5. last parameters is which size you want to get photos, you can use “_s.jpg” for small size, “_m.jpg” for medium, “_l.jpg” for large and so on.

I hope that could be interesting for many developers, if you have any suggestions or idea about mesh up with Flickr, feel free to drop a comment.

Flash Platform, automotive and industrial marketplace

During my last 6 months I take part in a couple of projects that are focused on Flash Platform and “unconventional devices”.
It seems strange, I know, but what I mean with the term “unconventional devices” ?

I mean that I use Flash Platform on embedded system with the purpose to create interface of industrial machine and automotive world.
Solutions based on Flex and AIR have great success for final customer, in particular because client has a great GUI with a cool user experience and he doesn’t lost any features with the hardware.
In fact we mix a couple of technologies to create those software like Python and C++.
Those tehcnologies make dirty work for us and via Socket or JSON, depends on traffic data, we make a bridge with Flex or AIR.
Performance are very cool, CPU processors move from 45% to 70%, optimization task take a great part of our time.

It was so interesting try for the first time AIR 1.5 on linux OS, we use Gentoo and Ubuntu too and I think they are very strong OS in particular development like this one.
Many people was really shocked in front of powerful of Flash Platform GUI from others developers to our clients, they can find from GPS integration until to a VOIP module made with Ribbit, from a wizard that guide user to interact with industrial machine to customization of GUI at runtime; everything in the same application that doesn’t run in a computer! Really awesome!

I saw during MAX that others companies are moving first steps trough automotive world but with Flash Lite, I think that an Intel ATOM processor has more potential and it’s so cheap for industrial market, when will be release new ARM processors (I think ARM 9…), that will be more powerful and cheap too, and Flash Player 10.1 or AIR 2.0 will have more opportunity to approach new marketplaces and also gives to many people great and easy user interface to work with.

Today Adobe releases in Adobe Labs Flash Player 10.1 and AIR 2.0 public beta, it’s a first steps to new opportunity for Flash Platform developers, many devices implements Flash Player and in future I think there will be many more.
So I’d like in a future, to find many “unconventional devices” with a Flash GUI because NOW we could make the history with those technologies.

A real workflow with Flash Catalyst and Flash Builder

Yesterday I take part of a pre-event labs at MAX called: Creating Application for the Flash Platform where Matt Boles show how to create a real workflow with Catalyst and Flash Builder.

I was interesting in this pre-event because I had some questions in my mind that I answered during this session.

First of all, I’d like to spend a couple of words about Matt Boles; guys Matt rocks! I love so much his training skills, how he explains during the session and also how he moves around the room, bring my attention for the whole duration of the session.
I think one of the best teacher that I ever seen, thank you so much Matt!

So come back on Catalyst and Flex 4; session was interesting and there are some things that I’d like to share with you:

  1. until now and probably also in the final release, if you create your project in Catalyst, then bring it to Flash Builder and start to modify it, you CAN’T go back to Catalyst…
    This is a problem because I’m sure that during a real project there will be some changes to do, so you must do that via Flash Builder Design mode or via code.
  2. Catalyst doesn’t export Flex Modules but only custom components, I talk about that with Matt and he is agree with me, after your work in Catalyst you must create in Flash Builder a Module Container and create modules for each custom components.
    So you’ll study to organize very well your assets during design process.
  3. I think that could be miss a part of a process that is a study of GUI usability, I mean, when you create a RIA or a desktop application you must study how users interact with it so if a designer starts to work on GUI but he doesn’t know how Flex works could be a big problem and you must refactoring the code to add a new functionalities or to group some components.
    Maybe could be useful start project with a meeting where designer and developer (and project manager or producer too) define informations (GUI, functionalities and so on) to create the final application and with a software like Balsamiq, define how to manage all components and custom components.
  4. I was surprise about Flash Builder design view, totally different of Flex Builder 3 one; could be useful when you want to make some little graphic changes at your project.
  5. Very cool news is data wizard of Flash Builder where in few steps you can retrieve remote data and then create VO for your application.
    Associate data to a component is really easy, just a drag ‘n’ drop in design view to a component.

This is a little resume of a day with Flash Builder and Catalyst, in a couple of hours starts the first official day at MAX with a Keynote that I think will be very interesting and with tons of news, so start to take a look at labs. I’m sure that Flash Player 10.1 become your best friend!!!

Obviously, feel free to add comment to this post and we could start an interesting conversation on how is the best way to realize a RIA or desktop app with Flash Platform.
I’m so interesting to know what do you think about that!

See ya 😉

Flash, Flex and SEO

During the flight from Philadelphia to Los Angeles I read a book that I wait for long time and finally arrive a couple of months ago but I’ve never started to read before.

The book is Search Engine Optimization for Flash by Todd Perkins, the first that talks about this argument and also about how to make your Flex RIA searchable from spiaders, so I was so exciting before start to read.

My final impression is that you don’t need to read this book if you are a developer because there aren’t new things to do…
I can resume the book in those few best practices:

  • Use SWFObject because make your SWF file more easy to read for spiders
  • Use SWFAddress or URLKit to rewrite url of your page but it’s useful only for RIA or site usability, not for SEO because HTML is the same for all pages, change only the page url.
  • Avoid to develop a full flash site if you are interested to indexing your project
  • Remember to “talk” with spiders via META tag in HTML page
  • One of most important thing is to make a relevant title of your HTML page
  • With FP 10 you don’t make anything to indexing your contents (dynamic or static text) because spider navigate trough SWF file to retrieve informations
  • Remember that you can set XMP file for your Flash project but until now, search engines don’t use those informations

I think that’s all, I hope to find more about how can create searchable content with Flash (there is a good PDF file in adobe website) but I think that there is no way.
We are only at the beginning of a big mountain and I hope that Adobe starts to make something new in next few months… maybe at MAX 2009 also, but I really don’t know.