Flash, Internet Explorer and Firefox new releases

We had so many milestone releases today!
Flash player 9 for linux is probably the most exciting news.
Second, Microsoft announced Internet Explorer 7. (even if I dont like at all the new look).
Last but not least Firefox 2 is on the way!
Today the Firefox 2 Release Candidate 3 have been released (with Javascript 1.7 support and with Google suggest integrated).

Red5 with javascript python ruby and coffee?

Red5 (the opensource flash multimedia server) will support server side javascript, Ruby, Python and Java?
That’s terrific!
Well, it seems the next 0.6 RC1 version of Red5 will do that! The release is scheduled by next Monday and if that’s true I definitively will find the time to look inside it 🙂

XUL and XULRunner (co-starring flash)

Like you probably noteiced I got more and more interest in XUL and experimenting Firefox extensions in the last days.
After my first extension I decided to try something different and first I created a little (this time nothing new at all) and lightweight extension for grabbing flv videos while visiting youtube.com or video.google.com. It simply creates a statusbar icon and when there are availables flv on the page it will get active. Clicking on it let you save the current playing flv. You can also change the options and tell the extension to open the video using you favourite Video Player (Like VLC or FLVPlayer)

Install the getvideo-0.1-fx.xpi Firefox extension

When I did this extension comes also in my mind the idea of creating a simple Flash video player, just for practice. I was doing it using python/wxPython as usual.. but then I wanted to try using XUL  and package it with XULRunner (a runtime XUL runner, which runs xul applications like standalone applications).
First of all I have to say thanks to Darron Schall for his article on how-to embed swf files in xul. I was going crazy to understand all the steps for creating a valid xulrunner package..
As usual opensource sofware has bad and incomplete documentation. I need to look into one of the examples (chatzilla) to understand how it works.

Once I undertood that a new problem arise, the damn flash security sandbox error! When the xulrunner application starts it prompt also the security warning.. Oh my god!

After various attempts and after reading various articles on FlashplayerTrust I managed to solve the problem (or at least I think I’ve solved…).
In the installer a file named flvideoplayer.cfg will be copied inside the Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust direcory, and it’s content is

chrome:\\flvideoplayer\content\flvideoplayer.xul

In this way the embed swf file should has the correct permissions to communicate with the xul page using fscommand. I thought that my experiment was finished, but when I shown it to a friend he  asked me to add also the possibility to convert the .flv video into other formats (avi, mpeg, etc).
Well, fortunately there’s ffmpeg which does this job for everyone 🙂

Thus I included ffmpeg to enable video conversion. What I did it’s a runtime .bat file which wil invoke ffmpeg:

function execute_batch(bat) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
try
{
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(bat.path);
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file);
process.run(true, {}, 0);
} catch(e)
{
alert(e);
}
}

Ok, how to install this application.
In order to run correctly this application you first have to:

  • download XULRunner (I did not included in the installer because it’s about 10Mb).
  • Once downloaded from a command prompt, run xulrunner.exe –register-global (to register for all users) or xulrunner.exe –register-user (to register for one user only).
  • To enable the flash plugin (the Firefox plugin isn’t used, so if you launch the application you won’t see the flash embed object) you have to copy:
    {programs}\Mozilla Firefox\plugins\NPSWF32.dll
    {programs}\Mozilla Firefox\plugins\flashplayer.xpt

    into your XULRunner\plugins\ folder
  • Now just download yougrab! and install it.

Install YouGrab! (sorry but currently Windows only)

My first Firefox extension! (FlashTracer)

Ok, it does nothing particular new, but it’s my first one 🙂

What it does?
If you have a flash debug player version you will see in the firefox sidebar all the swf trace output while running any of the swf in a browser window.
I have to say thanks to jayjam (Giuseppe Montemurro) who talks about the mm.cfg file yesterday at the From A to Web Adobe conference. I’d never read about this cool feature of the debug players.. and so I decided to make it as firefox extension.
I took 1 hour to make the XUL and js files, while the .xpi package was driving me crazy!.. the documentation is really terrible for my point of view.

Download and install FlashTracer from the Firefox extension page.

UPDATE: A new flash tracer called fbtracer has been released. This new extension is integrated into Firebug. Read more here

P.S. If you’re running the new 9,0,28 Flash plugin probably you noticed this extension wont work anymore. Adobe changed something and the plugin doesn’t read as previously the mm.cfg file so I’m invetigating on it. In the meanwhile you should tell the extension to point to this file: C:\Documents and Settings\{user}\Application Data\Macromedia\Flash Player\Logs\flashlog.txt.

For mac osx it should be: username:Library:Preferences:Macromedia:Flash Player:Logs:flashlog.txt

Using this path the flash tracer works again.

For discussing about this extension please use the forum instead of the comments here 🙂

Mobile game contest

For the 2nd year actionscript.it community announced a mobile flash contest.
Another exciting new feature is the active participation of Jamba, which will be sitting in the jury panel, and will review all the games in the contest. If Jamba finds one or more games it considers interesting and fit for distribution through their network, they have agreed to offer a revenue sharing contract directly to the developers involved.

Prizes are

Flashlite category:
• 1st prize: Flash Studio 8
• 2nd prize: IRiver 2G
• 3rd: 3 O’Rilley Books

J2ME Category:
• 1st prize: Nokia N93
• 2nd prize: IRiver 2G
• 3rd prize: 3 O’Rilley Books

Go now to the actionscript.it contest page and submit now your game!
You have untl January 29th 2007 to submit your Game.

Ps. I’ll be in the jury too 🙂

From A to Web memories

Yesterday I attended the Italian Adobe conference, From A to Web, in Milan.
I like expecially the Mike Downey presentation, in which he showm us a sneak peak of the new Adobe project, codename “Apollo”.
A PDF+Flash+HTML plugin viewer for creating desktop applications (so, goodbye Zinc and similar?). Someone asked him which html engine was used in apollo, but without a precis answer, I think he was referring to Geko…
Also interesting the Mike’s explanation about the reason of the name “Apollo”.
That’s because the first Central codename was “Mercury” (early American program for launching humans into space) the second beta codename was “Gemini” (the second US manned spaceflight program), and Apollo was the first ship to land the Moon

Then he introduced also a preview of the new Flash9 IDE (currently in beta process, codename “Blaze”) and he shown some of the new IDE features. First of all the IDE has changed (like in almost new releases) and there are very cool workspace management cool features indeed.
A completely integrated Photoshop PSD import process. You can select which element of the psd file to be imported and how to do it, select one of the layers and import as movieclip, etc.. very nice for designers (There was a long applause).
Another features he presented was the Robert Penner export as ActionScript3 of timeline tweens. This should be for developers who need to transform the timeline motion tweens created by designer into code (Another long applause). For what I understand it creates an xml code which can be put into the timeline and which reproduce the original tween. But I also understand that the produced code can only be used into the same timeline (a timeline with the same number of frames)..,

FZip and Transform Tool

This post is just for pointing out a couple of very interesting tools for Flash9 I recently discovered.

  1. FZip: a little ActionScript3 class (Claus Wahlers and Max Herkender) which enable you to extract files from .zip files.
    Read the original post here
    Download and documentation are here: http://codeazur.com.br/lab/fzip/
  2. Transform Tool: a class (by About Trevor ) which allow to make every kind of transformations on flash display objects.
    See it here

Flex2 and namespaces extending components

I took 2 hours to find a solution for that and I decided to blog it..
I was creating my new Flex2 component extending the UIComponent class and I need to define new custom styles for my own component…
Ok, i opened the “create and extend components” PDF guide and found that I need to put this code to accomplish it:
private static function classConstruct():Boolean
{
if (!StyleManager.getStyleDeclaration("ResizeManager"))
{
var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration();
newStyleDeclaration.setStyle("boxSize", 4);
StyleManager.setStyleDeclaration("ResizeManager", newStyleDeclaration, true);
}
return true;
}

That’s all, but at this time the compiler die with that error message “1000: Riferimento ambiguo a setStyle”, which in english should be: “1000: Ambiguous reference to setStyle“.
I google for some time but without finding a solution, then I discovered the problem. I was using in my component the mx_internal namespace, that was the problem. Once changed namespace everything was ok.