Talking about Flash Catalyst and Adobe AIR in Rome at “Arrivano i guru”

Next week in Rome, starts a new Italian event called Arrivano i guru, where 6 speakers from designers to developers, talking about Adobe technologies and others arguments.
I’ll be speaker there and I choose to talk about Adobe AIR and Flash Catalyst Public Beta, because I think could be so interesting for people that comes to this event understand how to approach this new world and start to work with those technologies.
In fact I think in Italy there are few companies that approach AIR to create real desktop application and an overview about Flash Catalyst give me opportunity to introduce a new way to skinning your RIA or desktop applications and how to save lots of times in a real workflow.

In the same event you can find others session about Digital Imaging, Advanced technique with Indesign or Photoshop and SEO also.
I think could be very interesting for a lots of Italian people, so feel free to leave a comment here if you’d like to receive more information about this event.

For more information or registration take a look at official site event.
See you there guys.

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.

AIR tour, last date in Milan

AIR tour is finished! Last date was in Milan and obviusly was very cool!

Location was pretty nice, great organization, cool food and a lots of stuff (T-shirt is amazing!).
A very friendly atmosphere, Adobe guys made a great overview about AIR from the beginning to final deployment.
I appreciate a lots Serge Jesper and Andrew Shorten‘s session, they talked about how to deploy and sign an AIR application and a great overview about LCDS and Blaze DS.
But my favourite one was Brimelow‘s session, he showed a lots of cool samples and in a very cool and funny way.

This weekend I’ll publish all photos made during the event in my Flickr account

 

SotR… Rocks! first day impressions

Here we are! I’m at Peter’s session about AIR but it’s the final session, after this we have Bird of fathers.

First day is very interesting, I meet very skilled and strong developers like Nico and also I have a great lunch with Neil, Peter and so on.

Atmosphere is very fresh, Edinburgh is an amazing but very relax city, I love it so much.
Event starts with Ben Forta and Adam Lehman that make a keynote about Coldfusion and integration with Flex, LCDS and AIR, very cool!

First session of my day is Working with OOP and CFML, Matt Woodward shows us why developers must work with OOP and which are benefits.
Then I follow Nico session about google analytics, I learn that old counters are better than analytics… no that’s a joke! He shows the true powerful of this google solution and give us some news about new features (native integration with flex and air… cool!)
And finally now Peter give us an overview of AIR API with a lots of samples, great work Peter!!!

If you are plan which event to follow next year, take in consideration Scotch on the Rocks, very friendly and fantastic atmosphere!