Archive for February, 2009

Flash: More Efficient Blur filter Values

Friday, February 27th, 2009 by Luis

Last year during the development of a project where blur filters were used extensively we put into practice several tips and tricks to be able to render this visual effects quicker.

What caught my attention on top of everything was something really obviuos, in fact it is mentioned in the Flash documentation (I never read every single line), values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values.

Having this into account, the problem (a fairly common problem in systems programming) was to locate the "next highest power of 2", whenever I need the value to be dynamic.

Here there are a few AS3 algorithms to find the next highest power of 2:

Actionscript:
  1. var powerOf2:int=1;
  2. var val:int=456;
  3. while ( powerOf2 <val )
  4. {
  5.     trace(powerOf2 <<= 1);
  6. }


Actionscript:
  1. function nextPowerOfTwo( value_ : int ):int
  2. {
  3.     value_--;
  4.     value_ = (value_>> 1) | value_;
  5.     value_ = (value_>> 2) | value_;
  6.     value_ = (value_>> 4) | value_;
  7.     value_ = (value_>> 8) | value_;
  8.     value_ = (value_>> 16) | value_;
  9.     value_++;
  10.     return value_;
  11. }


Actionscript:
  1. function nextPowerOfTwo( value_ : int ):int
  2. {
  3.     return int(Math.pow(2,Math.ceil(Math.log(value_) / Math.log(2))));
  4. }


Flash Switcher extension and Vista

Thursday, February 26th, 2009 by Luis

Flash Switcher extension is a well known Firefox extension to switch between various Flash player versions. Also very useful to save or remove the current installed Flash plugin.

In the last two months I have found people around my friends network having a lot of trouble making the extension work with Windows Vista, getting this two common errors while installing the extension:

Component returned failure code: 0x80520008 (NSERRORFILEALREADYEXISTS) [nsILocalFile.copyTo]

Access to folder C:Windowssystem32MacromedFlash is denied. Consider to use an user accesible plugins folder instead (for example: ~/.mozilla/plugins/ )

The solution to get ridd of this error messages is very basic, you just need full access to the macromed folder in your system.

  • Go to C:\Windows\System32\Macromed
  • Right-click "Flash" folder to open the properties panel.
  • Click the "Security" tab.
  • Click "Edit" Button.
  • Select the current user in "Group or user names:"
  • Change folder permissions, normally I change it to have full control.
  • Click "Apply" and "OK"

Another question that comes together with this errors is how to customize the Flash Switcher extension.

The default download for Flash Switcher includes a fair variety of player versions but not all and you may need to add newer players to fit your development needs, for example the new 10r22_87 version.

First you need to download the player from the following Flash Player archive:

Archived Flash Players available for testing purposes.

Download Flash Player 10 (debugger versions) (60 MB).

Open your Flash Switcher extension plugins directory, located at (remember I'm talking about Windows Vista):

C:\Users[username]\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxxxx.default\extensions\flash_switcher@sephiroth.it\plugins\win

Create a new folder and name it 10.0 r22 debug, which is the new version to install. (Released February 24, 2009 due to security vulnerabilities)

Next you need to install the Flash player (flashplayer10r2287win_debug.exe) which goes to C:\Windows\System32\Macromed\Flash

Now copy the NPSWF32.dll file from the "Flash" folder to the Flash Switcher extension plugin directory that you just created.

And that's all, now your Flash Switcher extension should work without problems in Windows Vista.

BCN Event: New Salvation Army at BOO

Wednesday, February 25th, 2009 by Luis

February 25 - March 12, BOO presents "NEW SALVATION ARMY" by designer friend Eider Corral.

Eider's new work is a limited edition of custom made or fake "LladrĂ³" for the occasion.


Pack design - Photo by Eider Corral.


Volunteer #1 - Photo by Eider Corral.

Time and PlaceStart Time:
25 February 2009 at 19:00
End Time: 12 March 2009 at 21:00
Location: BOO
Street: Perla, 20
Town/City: Barcelona, Spain

Related Links:

Moyashimon

Wednesday, February 25th, 2009 by Carsten Schneider

I finally got around watching Moyashimon, the Anime about a boy being able to see and interact with microbes. Pretty fantastic kids TV about agriculture, microbiology, chemistry, and girls in short skirts. Here's the intro:

Full episodes with English subtitles, on YouTube.