Apr 5, 2009

IRBWEB - Try Ruby on Your Browser!

One of the annoyances of trying ruby is installing Ruby. IRBWEB let you try it on your browser!

You can enter ruby expression and evaluate it.


IRBWEB

It works completely in your browser, so you get the result so quickly.

Silverlight 2.0 Required

The Silverlight 2.0 runtime plug-in required. Click the following image.

How does it work?

Silverlight supports DLR(Dynamic Language Runtime) which enables us to execute Ruby and Python on .NET application. IRBWEB is developped based on repl sample included in Silverlight Dynamic Languages SDK 0.5.0.

Mar 25, 2009

Processing "FireCube" example ported to ActionScript 3.0

Processing example FireCube is so interesting to me. I ported it to ActionScript 3.0.

The result is...

Performance improvement

Processing version calculates every pixel color when

  • creating noise,
  • combining values from adjacent pixels and
  • converting color.

So I implement it as follows:

  • creating noise -> BitmapData.noise()
  • combining values from adjacent pixels -> ConvolutionFilter
  • converting color -> BitmapData.paletteMap()

Difficulty

HSV color space is not supported in AS3! I created a function called HSVtoRGB.

Drawing a cube was a pain. So, I changed a cube to circle...

Here is the code: (83 lines)

Read more»

Feb 17, 2009

50 polygons Mona Lisa in AS3

I ported Image evolution to ActionScript 3.

We start from random 50 polygons that are invisible. In each optimization step we randomly modify one parameter (like color components or polygon vertices) and check whether such new variant looks more like the original image. If it is, we keep it, and continue to mutate this one instead.

In my computer, the result was as follows.

It's waste of CPU.., but very interesting.

Published SWF (CAUSION: TOO HEAVY CPU 60%~)

Because this program uses BitmapData.compare() to improve performance, it is about 10 times faster than the JavaScript version. The original C# version is about 3 times faster than mine.

Here is the code: (189lines)

Read more»

Jun 26, 2008

Color Illusion Generator released

I released a 'Color Illusion Generator', which enables to create a illusion movie from an arbitrary image.

(Example)

You can embed the movie to your blog.

Source code: Illusion.as

May 26, 2008

Google Earth control in Google Maps

I placed Google Earth control in Google Maps.

Here is the code(185 lines):

Read more»

May 23, 2008

Google Maps Globe

I created a globe using Google Maps API for Flash.

It is impossible to get the image data by BitmapData.draw(), so I used a DisplacementMapFilter.

Here is the code(70 lines):

Read more»

May 18, 2008

Google Maps API for Flash without MXML

In the Google Maps API for Flash tutorial, a sample using MXML is introduced. But MXML is not required, because com.google.maps.Map class derives Sprite class.

The following sample demonstrates how to rotate and blur the map without MXML.

Here is the code:

Read more»

May 12, 2008

Keynote-like cube transition by FIVe3D

I tried FIVe3D v2.1, very simple 3D library. For example, 'Graphics3D' class has method like lineTo() and drawCircle(). Looks like Graphics class!!

I created an example 'Keynote-like cube transition' using Bitmap3D class.

I refered to unic8 Studios - Flex Cube - 3D OSX look, which uses PV3D.

FIVe3D doesn't execute hidden surface removal, so I used setChildIndex() in the onUpdate callback of Tweener.

And since fl.motion.Color was not in Flex SDK, I commented out to compile :)

Here is the code:

Read more»

Jan 26, 2008

Here-document in AS3.0

Here-document is not implemented in AS3... But we can realize it using E4X and CDATA section!!

  1. var s:String = <><![CDATA[bar
  2. foo
  3. <p class="test">Any text here</p>
  4.  
  5. Ohhhhhhh!!!!!
  6. ]]></>;
  7.  
  8.     trace(s);
  9. /*
  10. bar
  11. foo
  12. <p class="test">Any text here</p>
  13.  
  14. Ohhhhhhh!!!!!
  15. */

You don't have to escape " and \ in the here-document.

Jan 17, 2008

Introduction of "Spark project" in English

Yoshihiro Shindo has blogged about "Spark project" in English.

"Spark project" is a Japanese OpenSource ActionScript Community. There are many awesome libraries such as:

ASReflect
ASReflect is a Java-like reflection library that wraps flash.utils.describeType.
E3Engine
An ECMAScript(3rd) engine written in ActionScript2. This engine enables us to execute "eval()" dynamically.
swfassist
swiffassist can dynamically generate SWF binaries on ActionScript3. This library may change the world!?
Thread
'Thread' helps us write asynchronous processing in ActionScript3.

The details are given in his entry. Let's check it now!

Jan 14, 2008

as3Query: alpha version (New Wave ActionScript)

as3Query is an ActionScript3.0 port of John Resig's exellent JavaScript library jQuery 1.2.1.

This port is released under the MIT and GPL licenses(as is the original jQuery).

Documentation is NOT available. Please refer to the original jQuery Documentation. Most features are ported except for Ajax methods.

Read more»

Jan 2, 2008

First post

This is my first post at this blog.

I've learned AS3 and Flex for 1 year, and writing AS3 blog in Japanese(here). And now, I decided to write in English. I want to show many AS3 samples on this blog.

I also want to introduce good libraries and tools developed by Japanese. Some Japanese have developed very nice libraries and tools, but I'm afraid most of them are not used world wide.

Nice to see you.