CubeRotate flickr slideshow

[kml_flashembed publishmethod=”static” fversion=”10.0.22″ movie=”http://blog.sephiroth.it/wp-content/uploads/2006/11/flickr_cube.swf” width=”200″ height=”200″ targetclass=”flashmovie” bgColor=”#CCCCCC”]

Get Adobe Flash player

[/kml_flashembed]

Thanks to alex uhlmann who released the source code of his presentation at MAX, I’ve managed to do this little flickr slideshow based on his CubeRotate flex effect.

This effect, beside all the others in the flex component, are based in Sandy (a great opensource 3D engine).

Using the flickr libs from labs.adobe.com first I’ve created a very simple slideshow to take pictures from my personal gallery, then I followed the examples provided within the Alex’s files and voilà.. a little but indeed cool effect 🙂

Just one remark. I need to put a PHP page on my site with reads the flickr image file, using php’s function readfile, otherwise all the bitmapdata effects couldn’t works, because images are not from the same domain…If someone is interested I put toghether also a little tutorial on how to make it.

For more informations read the original entry @ Alex Uhlmann blog.

P.S. Do you like that little boy in the first picture? 🙂 It’s me!

[attachments docid=897 force_saveas=”1″ logged_users=”0″]

Create a Flex2 search plugin toolbar in Firefox2

With the release of Firefox 2.0 we had many new features and one of these is the Enhanced search capabilities:
Search term suggestions will now appear as users type in the integrated search box when using the Google, Yahoo! or Answers.com search engines. A new search engine manager makes it easier to add, remove and re-order search engines, and users will be alerted when Firefox encounters a website that offers new search engines that the user may wish to install.”

For example you can add more search engines from here. I’ve take a look at the google built-in search plugin and I managed to create a search engine for AS3/Flex2 which uses the livedocs as target result site, but which uses a “search term suggestion” too.

You can install in Firefox2 this search plugin just clicking here.
This is the XML I used to generate this search engine:

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Actionscript 3.0</os:ShortName>
<os:Description>ActionScript 3.0 search on livedocs</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///7//v///v/+/v7//v/+/v7//v/9///7/P+DZN9SLtZ4Vdv09v7////9//////77/f77//7+/v7//////v39//////7///7YzPYxA8skAMeTeeT////+/v7///z08Pve0vb//v/////9//7+/v74/fz//////v+IZuIlAMg7EM/j3vv+//3//v/9//+5p+ySdeP+/f/////+/f/8+/+TeeRtUNt0U94+D88lAsh3Ud/////9///////+/f9vSNpIG8/z7/v+/f///v/+/v6YhOUkAMgoAckyAMouAsvEtvD///z////////h2fczBc0mAMq5p+z9/////v/////u6PtCENIvAckvAcpcM9X8+////f////////+YgOYfAMgkAMtrRdv////9///9/P7///+JbN8oAckoAMqqlun//v////7///759P1MH9MiAcgvAMs2CcrVy/b9//7//v/9//7YzPY0Ac1AEtDp4Pr6//7///////+6rO4zAMwqAcgvAcomAcmLa+H///7//v///v////9fNdaDYuL+//v9//7//////v9uSN0sAMopAsovAM0vAMtEGNHw7fz////////9//6+rfDOwvT///7//v///v/Zz/M1Bs4xAcsqAMkvAco1AMwsAMqwm+r8/v7////9//7//v/////////+//3//v+OcuMqAMkyAcksAMovAMoyAMoqAMpgNtf3+v/+/f///v3//v/////////////y6vtGHtEsAMo0Ac0sAMwvAMswAM0xAsowAsrQx/L//////////v////7//////v+4oewpAMcxAM8yAMsrAcotAcoxAMw1AMwqAMyGZOH9///+//3///7///7//v/9/f1jOtktAM01AcoyAMsqAMkxAsoyAM00AMsuAcxCEtDm4vv9/////////v/////SyfQ1CM0wAMszAM4zAMwsAMo/Dc89Ds4+D889Ds43D8yqkur9//////7///////6OdeU0Dsw+D889Ds89Ds45Ds0AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//</os:Image>
<SearchForm>http://livedocs.macromedia.com/cfusion/search/index.cfm</SearchForm>
<os:Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&qu={searchTerms}"></os:Url>
<!--<os:Url type="application/x-suggestions+json" method="GET" template="http://localhost/as3-static/search.php?q={searchTerms}"></os:Url>-->
<os:Url type="text/html" method="GET" template="http://livedocs.macromedia.com/cfusion/search/index.cfm">
<os:Param name="loc" value="en_US"/>
<os:Param name="termPrefix" value="site:livedocs.macromedia.com/flex/2 "/>
<os:Param name="term" value="site:livedocs.macromedia.com/flex/2 &quot;{searchTerms}&quot;"/>
<os:Param name="area" value=""/>
<os:Param name="search_text" value="{searchTerms}"/>
<os:Param name="action" value="Search"/>
<os:Param name="client" value="firefox"/>
</os:Url>
</SearchPlugin>

You can also install it just by creating  an xml with this code and save into your:
{UserAppDataDir}\Mozilla\Firefox\Profiles\{ProfileName}\searchplugins\

Using this search plugin as it is now, it just will redirect all the queries to the http://livedocs.macromedia.com site, and uses the google suggestion search engine to display the suggestions.
See an example on how suggestions works here. As you can see the results are encoded using JSON.
This is the output you will see there: [“mx.core.”,[“mx.core.view”]]

But since I wanted to have a “pure” flex2 suggestion search engine I grabbed all the contents from the Flex2 Language Reference site using python, saved the results in a local Mysql database and finally created a little search engine in PHP which returns the same json-encoded results, to be used with my search plugin.

Replacing the original search plugin xml file into:

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Actionscript 3.0</os:ShortName>
<os:Description>ActionScript 3.0 search on livedocs</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///7//v///v/+/v7//v/+/v7//v/9///7/P+DZN9SLtZ4Vdv09v7////9//////77/f77//7+/v7//////v39//////7///7YzPYxA8skAMeTeeT////+/v7///z08Pve0vb//v/////9//7+/v74/fz//////v+IZuIlAMg7EM/j3vv+//3//v/9//+5p+ySdeP+/f/////+/f/8+/+TeeRtUNt0U94+D88lAsh3Ud/////9///////+/f9vSNpIG8/z7/v+/f///v/+/v6YhOUkAMgoAckyAMouAsvEtvD///z////////h2fczBc0mAMq5p+z9/////v/////u6PtCENIvAckvAcpcM9X8+////f////////+YgOYfAMgkAMtrRdv////9///9/P7///+JbN8oAckoAMqqlun//v////7///759P1MH9MiAcgvAMs2CcrVy/b9//7//v/9//7YzPY0Ac1AEtDp4Pr6//7///////+6rO4zAMwqAcgvAcomAcmLa+H///7//v///v////9fNdaDYuL+//v9//7//////v9uSN0sAMopAsovAM0vAMtEGNHw7fz////////9//6+rfDOwvT///7//v///v/Zz/M1Bs4xAcsqAMkvAco1AMwsAMqwm+r8/v7////9//7//v/////////+//3//v+OcuMqAMkyAcksAMovAMoyAMoqAMpgNtf3+v/+/f///v3//v/////////////y6vtGHtEsAMo0Ac0sAMwvAMswAM0xAsowAsrQx/L//////////v////7//////v+4oewpAMcxAM8yAMsrAcotAcoxAMw1AMwqAMyGZOH9///+//3///7///7//v/9/f1jOtktAM01AcoyAMsqAMkxAsoyAM00AMsuAcxCEtDm4vv9/////////v/////SyfQ1CM0wAMszAM4zAMwsAMo/Dc89Ds4+D889Ds43D8yqkur9//////7///////6OdeU0Dsw+D889Ds89Ds45Ds0AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//</os:Image>
<SearchForm>http://livedocs.macromedia.com/cfusion/search/index.cfm</SearchForm>
<os:Url type="application/x-suggestions+json" method="GET" template="http://localhost/as3-static/search.php?q={searchTerms}"></os:Url>
<os:Url type="text/html" method="GET" template="http://livedocs.macromedia.com/cfusion/search/index.cfm">
<os:Param name="loc" value="en_US"/>
<os:Param name="termPrefix" value="site:livedocs.macromedia.com/flex/2 "/>
<os:Param name="term" value="site:livedocs.macromedia.com/flex/2 &quot;{searchTerms}&quot;"/>
<os:Param name="area" value=""/>
<os:Param name="search_text" value="{searchTerms}"/>
<os:Param name="action" value="Search"/>
<os:Param name="client" value="firefox"/>
</os:Url>
</SearchPlugin>

now the search plugin engine will query http://localhost/as3-static/search.php?q={searchTerms} for displaying the suggestions (so you need to have a php script there which can return something).
What I did at this point is:
1. Grab the flex2 reference using this python script. This script will output a file mysql.sql.
2. Import this sql file into my Mysql database using:

mysql  flex2_reference < mysql.sql

where “flex2_reference” is a database I previously created.
3. Create this php script (sorry, it’s not really a good example of php script…) and saved into my localhost at this address: http://localhost/as3-static/search.php
and I’ve got a fully ActionScript 3.0 search engine with suggestion!

Find programming documentation

I found two very useful reference sites which aggregate various documentation within an ajax suggestion search textbox (like google suggest).

QuickRef.org [view]
Very fast an easy, includes C, C++, CSS, HTML, HTML DOM, Java, JavaScript, MySQL, Perl, PHP, Python, and Ruby references. Unfortunely it does not include ActionScript reference. It has also a “add to google” button, to add a widget in your google homepage.

Fast API Search [view]
This includes ActionScript reference too! It allows to select which references to be used in the live search (such as  HTML, CSS, CSS2, Javascript, Google code, XML, XSL, XPath, XSD, PHP, Ruby, Perl, AS, ColdFusion, C, C++, MySQL, PostgreSQL, Oracle, Java…). Unfortunately this one does not include Python and it seems to be slower than quickref.org

Anyway, I think a couple of useful bookmark links.

Flash Switcher for OSX

After the many requests of a mac OSX version of my last Firefox plugin I finally was able to create it.
I have to say I had much more difficulties rather than the one for Windows.
For what I could understand Firefox for Windows unload the NPSWF32.dll once there are no pages displaying an swf. In fact (under windows) before switching plugin I have to be sure there are no pages wih an swf within, then I can clear the dll and copy the new one.

Instead Firefox for OSX  doesn’t unload the Flash Player.plugin even when there are no flash contents. For that reason I could not delete the current plugin file, so I decided to first move the running plugin into Trash and then copy the new one in the Internet Plug-ins folder and then ask user to restart Firefox. In this way everything seems to work clean.

Another problem is the fact there are 2 different plugin file for mac Intel and mac PPC. So I had to create 2 different .xpi installers.
Many thanks to Gabriele Farina who help me with this, I completely forgot the fact there were 2 different installer under Mac.

Here the installers (btw, I’m not 100% sure they will work.. a better test should be done):

Flash Switcher for Firefox

P.S. Another thing regarding my recent interest on Firefox plugin development.
This morning Jesse Stratford mailed me saying he wrote an article about me (yeas, about me! ooh what a great honor):
http://www.actionscript.org/../Firefox-Plugins-for-Flash-Platform-Developers/

Ben Forta presents ColdFusion Powered Flex and Scorpio (CF8)

On 6th of November actionscript.it staff will present a new event about Ajax, ColdFusion, Flex2, Flash Remoting and more. The speakers will be: Ben Forta, Vince Bonfanti, Charlie Arehart and Giorgio Natili.
In particular Ben Forta will present all the new features of ColdFusion 8 (codename Scorpio, planned for released mid-2007) and its integration with Flex2.

These are the other seminars:

  • AJAX & CFML Applications
  • Accessibility & AJAX
  • CFML Developement on .NET & J2EE platform
  • Flex Data Services & Coldfusion – CF8 sneaks
  • Coldfusion debug; Flex, Ajax& Flash Remoting with Fusion Debug
  • FusionReactor

The event will be in Rome at the Ritz hotel.
For more info visit the event page at actionscript.it

Flash Switcher extension for Firefox

I just did this new extension (my third extension) for Mozilla firefox. I hope it can be useful for Flash developer who want to easily test their pages with different flash player versions.
The extension hasn’t been approved yet by the Mozilla developer extension team so I decided to make first a post here, also for let you to test it and also because last time they took 3 weeks before they approve an extension…

What is this extension?
This extension comes with all the currently published flash player plugins (from the version 2 to the most recent 9,0,16) and allows you to easily switch from one plugin to another, or also to remove the currently installed plugin (maybe for testing the express install).

Where I can find it?
Once installed you will find the “flash switcher” icon in the Firefox statusbar at right. Click on it and a list of available options will appear.

Can I add more flashplayer versions?
Yes, even if you should do it manually.
The extensionn folder can be found here:

C:\{userAppData}\Mozilla\Firefox\Profiles\{userProfile}\extensions\{2b5cfade-d133-429c-aea5-865911de4e1d}

Into the “chrome\plugins” folder you will see different folder (such as 9.0 r16, 8.0 r24 etc) with a file NPSWF32.dll within.
To install a new plugin just create a new folder with the name of the player version and copy into it the NPSWF32.dll file which comes with every flash player installer.
You can find all the old flash versions here
Another way to add more versions of the player is to install the flashplayer version you want into firefox, then save it using the “save as” menu item of flash switcher.

Download and install flash switcher here.

Get Firefox 2 now!

Firefox2

Just after few days the launch of Internet Explorer7, Mozilla officially released Firefox2. In the previous days there were various blogs which posted a link to an “official” release of firefox on the mozilla ftp server, which causes various problem in cost of bandwidth…

Firefox 2 offers a refreshed user interface, anti-phishing protection, improvements to the built-in search feature (with the Google suggestion integration), tabbed browsing changes, the ability to restore an interrupted session, better support for Web feeds, inline spell-checking, support for microsummaries and a number of other enhancements (read more)

So, what are you waiting for? Download Firefox2 now!

PHP6?

Have you already play with PHP6?
Today I discovered the PHP6 CVS snapshots and I decided to take a look at it (still not tested).

I read some unhappy comment to the fact php want to put the Unicode settings into the php.ini, but if this change will make PHP faster  I would prefer in this way, expecially if unicode will be always set to on.
Is there a reason to put unicode support off in this world? (for example I haven’t still understood why wxPython continues to releases both ansi and unicode builds…)
Finally register globals‘ PHP3 BC to go!
Namespaces. Maybe they will add namespace.. I really hope so! This is indeed one of the most awaited features for me! (read about a discussion on namespaces)
Support for delegates.

My big hope is also to see a “real” strict type language, but this is only my though.
Backward Compatibility. Well this could cause a flame for many developers but if they really want to make a solid new product from scratch probably they dont have to take care about BC.

Read more about the PHP6 Novermber meeting and all the proposals.
Download the PHP6 snapshot