End of line for Flex/Flash for me

Posted: 30th December 2011 by Jhonny Everson in Uncategorized

After 5 years working with the Flash Platform, I came to a decision to leave it.

I find the other communities better. Flash/flex does not favor good open source libraries. Testing is hard, tools are slow. I am just tired of it. Now I am deep into Scala with Lift Framework, JQuery and Html/css and I will be blogging more about that soon.

If you are still a flash/flex developer, I highly recommend you to do so, as well.

Using StageVideo with AIR 2.6 on Desktop

Posted: 27th March 2011 by Jhonny Everson in actionscript, AIR
Tags:

StageVideo video is a great new feature of Flash Player 10.2. The problem is that it is not yet available to AIR 2.6 Desktop.

Here’s a little trick to use StageVideo with AIR:

  1. In AIR, you use HTML or HTMLLoader components to load a page containing a player that will actually run on Flash 10.2
  2. create a web project for the player itself. You can use one of demos from StageVideo’s Getting started;
  3. you can use LocalConnection to communicate between the videoplayer and AIR app. To pass the video info, for example, and most importantly to let the AIR application know when remove the HTML component. Refer to The Ultimate Guide To LocalConnection
  4. The StageVideo will only be available when the videoplayer running on Flash Player be at Fullscreen, so you will need to add a button in the flash player to go to fullscreen.
  5. Add a trust file the following locations. This will allow the videoplayer to access files from local system.
    • Windows: system\Macromed\Flash\FlashPlayerTrust (for example, C:\winnt\system32\Macromed\Flash\FlashPlayerTrust)
    • OS X: app support/Macromedia/FlashPlayerTrust (for example, /Library/Application Support/Macromedia/FlashPlayerTrust)

Well, that’s it. The bad thing is that we can only play StageVideo at fullscreen and we need the user interaction to go to fullscreen.

In this small tutorial I’ll show how to get starting using redtamarin to compile actionscript classes and run as shell script.

Download redtamarin from the project page. Put it in /opt/redtamarin and create a link to it using:

sudo chmod +x /opt/redtamarin/redshell
sudo ln -s /opt/redtamarin/redshell /usr/local/bin/redshell

You could test your installation writing a ‘Hello World!’.

hello.as:

trace('Hello World!");

To run that code type: redshell hello.as

Now let’s create class, Person.as:

package {
    public class Person {
       
        public var name;

        public function Person(name:String){
            this.name = name
        }
        public function sayHello(to:String):void {
            trace("Hello " + to + ", I'm " + this.name)
        }
    }
}

Now compile it with java -jar /opt/redtamarin/asc.jar -AS3 -import /opt/redtamarin/builtin.abc -import /opt/redtamarin/toplevel.abc Person.as

modify hello.as to:

import Person;
var p:Person = new Person("Everson");
p.sayHello("World");

And compile it: java -jar /opt/redtamarin/asc.jar -AS3 -import /opt/redtamarin/builtin.abc -import /opt/redtamarin/toplevel.abc -import Person.abc hello.as. Note that we are importing the compiled Person.abc.

Running the example: redshell Person.abc hello.abc. I think it’s possible to compile all classes into a single abc but that didn’t work for me.

That’s it. Cool, huh? Now you can go write cool scripts using actionscript.

New RIA Blog

Posted: 5th February 2011 by Jhonny Everson in Uncategorized

Hello everyone, this is my new blog. Here I will try to post interesting things about RIA development, mainly on Flex, Flash, Air, Java and Ruby stuff.