• Categories


  • Archive for the ‘AIR’ Category

    ZamfBrowser: Test your ZendAMF application the proper way

    Sunday, March 28th, 2010

    Last week, at work, I was creating an Zend_AMF server for some project I work on. But because the front-end isn’t ready yet, I couldn’t test the server properly.

    UnitTests are one thing, but I wanted to be 100% sure that everything is mapped correctly.

    I was thinking of creating a browser like the one you find in amfphp or weborb, but I didn’t had the time.
    Next option: search and find a browser with Google.

    A few moments ago, I found ZamfBrowser. It’s an Air application, so perfect for every developer, whether you work with OSX, *nix or even Windows.

    Features I like already:
    - auto updates
    - you can add amf servers as many as you want
    - you can build your own request, with as many parameters as you like

    Tomorrow I’ll test it properly, and I’ll post my findings later this week.

    AIR apps from ActionScript

    Saturday, April 19th, 2008

    This morning, I’ve lost some hours searching for a way to create an AIR app straight from ActionScript with Adobe FlexBuilder 3.

    When you create a new Flex app, you can chose between a normal Flex app and an AIR app. With a new ActionScript project, you can’t.

    You can create an AIR app from a standard .swf, but then you can’t use the native AIR framework.

    Now, here’s a solution:

    You create a new Flex project with AIR export in the Flex Builder.

    In your favorite text-editor (e.g. TextWrangler) you open hidden .actionScriptProperties file, located in the root of your project folder.

    You change the <application path=”<sourcefile>.mxml”/> into <application path=”<sourcefile>.as”/>. Make sure you have created the .as file

    Now create a new NativeWindow in the constructor of the ActionScript class and …

    now build your app.

    You’ve just created an AIR app, based on an ActionScript class.

    Source:

    package { 
    /**
    * import required classes
    */
    import flash.display.NativeWindow;
    import flash.display.NativeWindowInitOptions;
    import mx.controls.Label;

    public class myApp {

    public function myApp() {
    // set the window properties first
    var myWinProps:NativeWindowInitOptions = new NativeWindowInitOptions();

    // now create a new window, with the predefined window properties
    var myWin:NativeWindow = new NativeWindow(myWinProps);
    // make the window appear
    myWin.activate();

    // create a new label
    var helloWorldLbl:Label = new Label();
    // add text to the label
    helloWorldLbl.text = “Hello World”;
    // now add it to the stage of the new window
    myWin.stage.addChild(helloWorldLbl);
    }
    }
    }