How to switch from Actionscript 2 to Actionscript 3… in September for FREE in Milan and Rome

During September I’ll take part of Arrivano i Guru Tour, an Italian event that allow designers, developers and photographers to learn new stuff for FREE about Adobe technologies!
In fact, the event starts in September until to the end of October and you can see it in 10 differents Italian cities.

In the last event you can find a special guest… Katrine Eismann, on of the most important person in creative digital retouch world!
I decide to talk about a big problem for a lot of developers: How to switch from Actionscript 2 to Actionscript 3 during my sessions in Milan (27th September) and Rome (5ht September).

During my session we can see the power of new AS3 features,  architecture of new Flash Player and differences of both languages.
You can see a real mirror from AS2 scripts to AS3 scripts and how to porting your daily “Actionscript life” to a new step: more interesting and powerful!

If you’d like to have more information take a look at the site or feel free to contact me leaving a message on my blog or dropping me an email.

I hope to see you during this event and remember that is a great opportunity to learn more and for FREE!

See ya!

Flash Builder Beta is out… my first tests

Finally is OUT! New Flash Builder version is out in labs.adobe.com

I spent all the evening to try new features, so I think that could be useful talking about that in my blog.
The new features that I like so much are:

  • States / Library / Modules: States are totally changed in a new version that make easier write in MXML, I love so much includeIn and excludeFrom attribute to decide in which state you can put or remove a particular component.
    If you want you can work also with group and add in the same group N states.
    Library is a new object that works like Flash library, so you can create a Definition (like a Symbol) and reuse it during your application, make attention because you are working with Element and not Child!
    States and Library increase a lots application KB so I prefer work with Modules that load in runtime mode. They have a new particular argument when you try to load it that is ByteArray (more information on Migration Guide on labs).
  • Automatic getter / setter / event handler: YESSS! I switch to FDT in last month because I increase my productivity to write AS3 code, now with Flash Builder you’ve a couple of actions to create getter, setter and event handler, that’s so cool!
  • New Drawing API: we have a lots of new interesting MXML tag to define a shape like a square or a rectangle, but the most interesting is Paths that allow you to create particular lines and shape with bezier curve via code
  • Advanced CSS selectors: another interesting feature is the new way to refer a component via CSS, in fact you can interact with MXML structure (all buttons in an hbox must be red and all buttons in a vbox must be black).
    Very easy and cool!
  • Flex Theme: that’s one of my favorite features, in fact with Flash Builder you can create custom Flex Theme and skin your application in a second! You can find more information about Theme in Ted Patrick blog.
  • DateGroup: Instead of using Repeater to repeat a particular object, now we have DataGroup that defines a dataprovider and how to render it via an ItemRender or an ItemRenderFunction.
  • Switch a Flex project to AIR: finally if your client doesn’t know what he wants, you can swtich a Flex app into an AIR desktop application directly from context menu of Package Explorer (new name of  Flex Navigator panel).

Remember to read Migration guide, it’s so interesting! Stay tuned for next Flash Builder and Catalyst tests!
Another great resource that is now live to see Flex 4 features is Tour de Flex that you can view directly from Adobe web site.

Bye bye

First impressions about Flash Catalyst

Yesterday I was in Milan at From A to Web and I saw Serge Jespers session about RIA workflow with Flash Catalyst and Flash Builder.

In 30 minutes he made a real Flex application that interact with Coldfusion to retrieve data from a database and he started from a normal and static AI file… that’s totally AMAZING!
Flash Catalyst will be a great software that will help us to create desktop applications and rich internet application, in particular could be very interesting to create animations and user interaction on own GUI.

When Serge showed Flash Builder he interacted with a CF script (you can work with WS, XML and other back end tecnologies also) trough a panel and in few steps he was connected to data source… COOL!
I’m so excited, Flash Catalyst will change RIA and desktop apps workflow definitely! I’m sure about that… BUT…

I’d like to investigate more about Flash Catalyst when Adobe decides to release public BETA on Labs, but I asked a couple of questions to Serge during his session to understand better the power of this new software.
For me the first problem is that FC doesn’t work with Flex Modules but only with States and in big projects it could be a problem.
Yes, you can copy MXML code and  paste on a Module, but it could be more easy to choose if you want to work with states or modules or better, export your GUI like module and not only custom component.
Another thing that I’m scared is that FC is very easy to use, open new way of business and make your daily work more fast, so designers and developers that approach for first time RIA and Desktop apps could start to release tons and tons of “bad apps” like Flash in 90s… I hope that Adobe will teach around the world with free training courses, not only with one day events, or will begin a new HORROR ERA for RIA and Desktop apps.

That’s my 2 cents, if you’d like to talk about FC on this blog, feel free to leave a comment.

Create PDF in runtime with Actionscript 3 (AlivePDF, Zinc or AIR, Flex or Flash)

This morning I’ve a new target, create PDF in runtime with Actionscript 3.
Very cool project to accomplished this mission is AlivePDF, an opensource AS3 library that you can download from Google Code.
AlivePDF allow you to generate PDF in runtime with Actionscript 3 and you can add pages, draw in each pages or add images, it’s very powerful library.

In this sample I use Actionscript 3 (with FDT) and Multidmedia Zinc 3, but you can use Flex or Flash and AIR to make this sample.
So first of all I create a simple class that allow you to create a PDF file with multiple pages and to add content in each pages.
This is the code:

package org.mart3.pdfGeneration {
    import flash.events.Event;    
    import flash.utils.ByteArray;    
    
    import org.alivepdf.images.ImageFormat;    
    import org.alivepdf.saving.Method;    
    
    import flash.display.Loader;    
    import flash.events.IEventDispatcher;    
    import flash.events.EventDispatcher;
    
    import org.alivepdf.pdf.PDF;
    import org.alivepdf.layout.Orientation;
    import org.alivepdf.layout.Size;
    import org.alivepdf.layout.Unit;
    import org.alivepdf.display.Display;
    
    /**
     * @author lm
     */
    public class CreatePDF extends EventDispatcher {
        
        private var pdf:PDF;
        public var pdfBA:ByteArray;
        
        public function CreatePDF(target : IEventDispatcher = null) {
            super(target);
            
            pdf = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.A4);
            pdf.setDisplayMode(Display.FULL_PAGE);
        }
        
        public function set totalPages(num:int):void{
                
            for(var i:int = 0; i < num; i++){
            
                pdf.addPage();    
                
            }
    
        }
         public function setData(_l : Loader, _numPage:int) : void {
            
            pdf.gotoPage(_numPage);
            pdf.addImage(_l, 15, 15, 0, 0, ImageFormat.JPG, 100);
        }
        
        public function savePDF():void{
            pdfBA = new ByteArray();
            pdfBA = pdf.save(Method.LOCAL);
            
            var evt : Event = new Event("baReadyEvent");
            dispatchEvent(evt);
        }
    }
}

Obviously if you want, you can create a custom event that pass to the document class the ByteArray but this is a quick sample to show how you can create PDF in runtime!

One of the amazing things that you should do with AlivePDF, it’s that you can decide to save PDF locally or on web! Read documentation because it’s very interesting what you can do with this library!

Ok now, go to document class where we use MDM swc that you can find when install Zinc on your computer (you can find 2 differents SWC, one for Flash and the other one for Flex. Remeber also that Flash SWC works with Flash CS4 also, not only with Flash CS3!).
In this class we do those simple steps:

  • create a PDF object using CreatePDF object
  • set our PDF document
  • pass an external image loaded with Loader object
  • save PDF bytearray with Zinc FileSystem class
package org.mart3.pdfGeneration {

    import flash.display.MovieClip;    
    import flash.net.URLRequest;    
    import flash.display.Loader;    
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;

    import mdm.*;

    import org.mart3.pdfGeneration.*;

    /**
     * @author lm
     */
    public class Main extends Sprite {
    
        private var pdfObj:CreatePDF;
        private var l : Loader;
    
        public function Main() {
            
            mdm.Application.init(this);            
            
            pdfObj = new CreatePDF();
            pdfObj.totalPages = 2;
            pdfObj.addEventListener("baReadyEvent", saveLocalPDF);
            
            l =  new Loader();
            l.name = "myImg";
            
            l.contentLoaderInfo.addEventListener(Event.COMPLETE, showImage);
            l.load(new URLRequest(mdm.Application.path+"assets/bg.jpg"));
        }
        
        private function saveLocalPDF(e:Event) : void {
        
            mdm.FileSystem.BinaryFile.setDataBA(pdfObj.pdfBA);
            mdm.FileSystem.BinaryFile.writeDataBA(mdm.System.Paths.desktop+"generate.pdf");
    
        }

        private function showImage(event : Event) : void {
            
            l.scaleX = l.scaleY = .4;
            var mc : MovieClip = new MovieClip();
            mc.buttonMode = true;
            mc.addEventListener(MouseEvent.CLICK, savePDF);
            mc.addChild(l);
            this.addChild(mc);
        }
        
        private function savePDF(event : MouseEvent) : void {
            event.currentTarget.alpha = .5;
            pdfObj.setData(l, 1);
            pdfObj.savePDF();

            
        }
    }
}

You can also download source files from their hosting service and test it on your computer.
Feel free to give me any comments about AlivePDF, it’s very interesting to know what you think about this AS3 library.

Adobe MAX: day 1

Here we are, it has just started Adobe MAX 2008, I’m very excited and in this day I see a lot of cool and interesting things!

In General Session this morning we see new name of Thermo project, now we must start to call it Flash Catalyst, too long but not bad.
There are new interesting things on mobile side, Adobe is working in a new product that package Flash Lite contents in .sis or .cab file and delivery it over-the-air, maybe an important step trough a new Adobe mobile era.

Another interesting project that is in BETA now, it’s also my favorite one, is CoCoMo, I meet Nigel Pegg, amazing guy, that coordinate the project with Dr. Fang (:D).
Now CoCoMo is in Labs, you can download it and start to work with those components that allow you to implement your Flex applications with Connect Now features, so you can share your desktop, make a conference call with video, chat and so on.

There are other 2 minor project that Adobe releases today: Wave and Tour de Flex.

The first one is a social networking aggregator made with AIR that allow you to manage your social networking like twitter, flickr and so on in a all in one application.
Tour de Flex is another AIR application that is focused for developers and designers that approach Flex for the first time, I copy the purpose of the application from own site:

  • Provide non-Flex developers with a good overview of what is possible in Flex in a “look and see” environment
  • Provide Flex developers with an illustrated reference tool
  • Provide commercial and non-commercial Flex developers a place to showcase their work

You can find those projects directly from Labs too.
I meet also a lot of developers and designers that are involved in very cool projects, but I’ve also the honor to meet Simone Legno aka Tokidoki! It’s one of my favorite designers! Max respect for him.

But I must write also that there is ONLY 1 WI-FI CONNECTION here for more then 5.000 people… it’s unbelievable… 

See you tomorrow for resume of second day.

New Flex resource: flexets forum

Today is my last at work, from tomorrow to 23 August I’m on holiday.

But before to go on holiday, I want to share with you a new resource made from Franto that is a new Flex forum where you can talk about Flex, AIR and actionscript 3, share your knowledge with other developers and so on.

It started a couple of days ago so there are few people now, but I’m sure that could become a great resource for all Flash Platform developers.

Flexest launches also a service called Coaching forum, where new developers has a traning coach on Flex, AIR or Actionscript that helps to learn this stuff.
If you have few minutes during this holiday period, take a look and register in this community to start share your Flex exeprience! see you there guys!

My 2 cents about Let’s tour

Yesterday Thomas, Tiziano, Samuele and I finished Let’s tour.
Let’s tour was a tour around 5 Italian cities (Turin, Florence, Milan, Padua, Verona) where we showed what a team do when work together with new technologies in the same project.

In fact we made this session during this tour:

9.30AM – PHP & Framework how to make a web form with a MVC framework

10.00AM – Flash Lite: create a mobile experience to register yourself for an event

10.30AM – Illustrator: how to create dynamic content with Illustrator

11.00AM – AIR & Flex: working with web data and export them for Illustrator and Photoshop

11.30AM – Photoshop: working with external data

12.00AM – PHP: how to create dynamic PDF for mobile & print

We met a lots of people, developers, designers and account too, and we understand that in Italy we MUST talk more about those technologies from university to big company, because there are so many people that are interesting to grow up with those technologies!
I was so surprised when I asked in Florence, at Master of Multimedia, how many people knew Flex or AIR… I think that 80% of them knew those technologies and it’s GREAT!
They appreciate a lots this kind of event in particular they love the informal but technical way to show stuff during our sessions.
We are talking to organize another one maybe and we are working to make a big international event that it takes part in Italy next year.
I must to say THANK YOU to all people that came during this tour, that help us to organize meeting room in cities, and I hope to make it again.
A big thank you to Let’s course guys that follow me in this crazy idea! I think we spent great time together.