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!

Advertisements

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.

Second day at Flash on the Beach 08… Flash 10 on IPhone

Second day is finished, but it was very intensive!
I saw lots of interesting session, first of all Mr. Aral Balkan that showed us how to have fun with our work and that we must take time to experiment and try new languages, very interesting session.

Then, my favourite, Adobe Town Hall, where they said: “Yes we are working on Flash 10 on iPhone!”.
I hope that they don’t put a “slim” version without important API like the newest that allow to work with local files with Flash Player in a browser.
I asked also if with AIR 2 they will solved the problem of interaction with others applications embedded on a mobile phone and if it update itselfs without download a new firmware… they said… “Open Screen Project solved the second issue and the first one… yes we are working on this way”.
Great news for mobile developers!

Then I saw Grant Skinner with a cool sesson about  what a Flash developer should know… 

Peter Elst talked about AIR api and show interesting things with Merapi Projects and Adobe AIR… the speech to text sample was amazing!

Lee Brimelow showed us about new Adobe product releases like Flex 4, new features of Flash CS4 and so on, it’s an amazing speaker because he show stuff with a fun.. like a joke… cool!

Tomorrow I will attend the last day, there will be lots of interesting things to take a look… Nicolas session for example… see you tomorrow guys