Recently in flash Category

Debugging AS3 with firebug's console

firebug output

Most probably you've already heard about firebug, if you haven't, I really recommend you go give it a spin right now.

Basically, firebug let's you lift the hood in your browser and see pretty much everything that's happening in there. It lets you edit, and monitor all HTML, CSS, Javascript live in any web page - it even lets you edit those objects on the fly!

It also gives you a fantastic console that lets you expose information about what's flowing through your scripts. Adding a global variable named "console" it exposes many methods that allow you to write to the Firebug console.

The really cool thing is that from flash you can call "console" using ExternalInterface, and any object you pass will be dumped as if it was a javascript object.

try it out, go:


ExternalInterface.call("console.log",{foo:123,bar:"da",boo:{da:12,beh:[123,145,"dfa",{fa:[0,1,2,4,5]}]}});

and you will see the output in the image above.

To save you some time and make things cleaner, here you will find an AS3 Class that exposes the console object to any of your Actionscript/flex applications.

All methods are static so you don't need to instantiate the class.

From actionscript, all you need to do now is:


Console.log({foo:123,bar:"da",boo:{da:12,beh:[123,145,"dfa",{fa:[0,1,2,4,5]}]}});

I guess the only drawback for this is that this will bong out if you are trying to dump an object with circular references, or your object is too big. - I can't find out what's the size limit right now, but I've seen it throwing an exception when the objects I passed where too complex.

In case you need something more robust to debug your code, then I really recommend you try out FlexBuilder's debugger.

download: Console.as

Phidgets AS3

Phidgets AS3

Here's an Alpha AS3 rewrite of the AS2 phidgets Library. It's still very early on the developing process, but I thought I'd give everyone who might be interested a quick peek of what you can do with it.

download:

Source and Samples (756 kb)
SWC (Compiled code) (38kb)

you will need to have installed Phidgets.msi and have the PhidgetWebService running in order to properly connect to your phidgets. PhidgetWebService is a super light socket server to which your flash application connects to in order to properly send and receive data from all phidget components.

To install Source and Samples in Flex Builder I'd really recommend you to simply choose file> Import > Archive File > Choose the zip you just downloaded

If you want to go the SWC way, which is probably simpler, just create a new AS3 project in Flex Builder, Choose a name click next, and on the Library Path Tab click [ add SWC... ] and choose the location of the PhidgetLibrary.swc you just downloaded.

Things are still very dirty, If you have any suggestions on how to improve the code, please let me know.

I've done my best to resemble the original AS2 API as close as I could. Still, I took the liberty of creating extra objects that allow for even easier Phidget management.

There's no documentation at all yet, but there's plenty of samples to dig and learn how to use most of them.

If anyone out there wants tp give me a hand with docs I'd really appreciate it.
I'll try in the following days to write up some simple tutorials, so if you can't deal with the samples, patience.

code sample after the jump.

Embedding fonts in AS3

I love this! ... library, be-gone!

package {
	
import flash.util.describeType;
import flash.display.MovieClip;
import flash.display.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
  
   public class Test extends MovieClip {
    
      // be sure this is pointing to a ttf font in your hardrive
      [Embed(source="C:\WINDOWS\Fonts\somefont.ttf", fontFamily="foo")] 
      public var bar:String;
      			
      public function Test() {
                	
          var format:TextFormat	      = new TextFormat();
          format.font		      = "foo";
          format.color                = 0xFFFFFF;
          format.size                 = 130;
						
          var label:TextField         = new TextField();
          label.embedFonts            = true;
          label.autoSize              = TextFieldAutoSize.LEFT;
          label.antiAliasType         = AntiAliasType.ADVANCED;
          label.defaultTextFormat     = format;
          label.text                  = "Hello World!";
          addChild(label);
       }
    }
}

AS3: attachMovieClip() no more!

aaah, "attachMovieClip"... just the sound of it sounds so retro already. plus... the library?! who the heck needs a library anymore?

kiss the library bye-bye!!
I'm sure we are going to remember these days with a lot of nostalgia.

package {
   import flash.display.MovieClip;
   import flash.display.StageAlign;
   import flash.display.StageScaleMode;
   public class Test extends MovieClip {
      // be sure this is pointing to an image in your hardrive
      [Embed(source='c:\images\whatsup.jpg')] public var MyImage:Class;
      public function Test() {
         stage.align     = StageAlign.TOP_LEFT;
         stage.scaleMode = StageScaleMode.NO_SCALE;
         var img:MyImage = new MyImage();
         addChild(img);
      }
   }
}

Japanese Flash OOP Book announced

If you can't read Japanese, please ignore this post.
If you can, well luckily you've already heard about it, but who knows how different the reach from this blog is compared to others in Japanese.

A couple of days ago was announced the forthcoming Flash OOP book, the result of a ton of work by 14 members of the Flash OOP Japan Study Group. Published in Japanese and focusing on Object Oriented programming with ActionScript 2.0 and FlashMX 2004 Professional, the book is aimed at developers with previous understanding of ActionScript or developers from other programming languages willing to make their first incursions in ActionScript 2.0

The book is expected to hit the stands on June 16th.

you may still preorder it here:

Flash OOP - ActionScriptによるオブジェクト指向プログラミング

Supervised by Tatsuo Kato, and written by Fumio Nonaka, Kampei Baba, Jun Kitazawa, Hoshi Tetsuya, Tatsuo Kato, Yasunori Fujimoto, Shinya Tomikawa, Naohiko Ueno, Marcos Weskamp, Taro Sugita, Ken Azuma, Shin Matsumura, Hisato Ogata and Atsushi Honda.

With the help of Baba-san and Kitazawa-san I chipped the 8th chapter: "Data Structures and Algorithms", which was not an easy task, but definitively a ton of fun writing.

Biggest thanks goes to Kato-san who almost left his soul in the supervision of this book, and of course everyone at Bascule for their never ending dedication to this project. Special thanks go to Kan-chan who was able to put up with all my missed deadlines and helped me all the way until the end.

Oh, next week, June 18th (fri) from 18:30 - 21:00 we will be holding a meeting with the Flash OOP Study Group at the Macromedia office in Akasaka, anyone in the area is mostly welcome to participate - entrance is free of charge, and we will be giving away a copy of the book to the person who talks the loudest in the discussions there:)


皆様本当にお疲れ様でした!

DIY Social Circles

| No Comments

So you're probably tired of looking over and over the same lists in Social Circles.
Since day 1 of this project Dan always wanted to let users look into their own mailbox too. So he grabbed the original source code and rewrote it so that you can now visualize the mailing lists YOU are subscribed to.

So what are you waiting for, go try DIY Social Circles!

We haven't tested this one thoroughly so if it doesn't work for you, please, please drop me a line: [mail ATT marcosweskamp DOTT com]

a map of the news media




just finished killing the last bug I had in my list before releasing this new project.
newsmap is an application that visualizes the totality of the GoogleNews aggregator.
The GoogleNews aggregator is an amazing piece of software, not only aggregates almost every single online newspaper, but it also combines news stories into clusters so that when the same story is repeated among several news sites, it files and displays only one to you - no mater how different the actual text that makes the article is. Even the same story, told from completely different points of view, get's filed as one single entry.

Google news aggreagates stories in several languages and customizes it's content for 10 particular countries. I've loved googlenews for this particular reason since the first day, and it was then when I started thinking about visualizing the totality of it, since it could be a very close approach to getting a picture on how news media attention differs from country to country.

Newsmap utilizes a treemap algorithm to dynamically create each view, and the size of each cell is determined by the amount of related articles that exist inside each news cluster.

this could have never been finished without the invaluable help of Dan and Gus - thanks a lot guys!

launch the project over here

dentsuDesignTank

...comming soon:)

did I ever mention how much I loooove XML?

MAX 2004 - Japan

| No Comments

We'll be speaking together with Yuji about Flash and Coldfusion integration in the forthcoming MAX 2004 conference here in Tokyo.
We will basically be giving a detailed intro in Coldfusion, Remoting and Database Integration and later dissecting Habitat Perspectives explaining how we grab GPS coordinates and images from cellphones and visualize that from the web in Flash.
We will be giving it in japanese, but still it's going to be pretty visual, focusing on flash users with little or zero experience in Coldfusion and Database integration in the attempt to demistify that Databases cannot be used creatively and should only be touched by engineers.
It's going to be tons of fun, so if you happen to be around, do not hesitate to drop by!

more over here

it's hip to be square

| No Comments

coehesive aesthetical cubic isometrical community visualization, very futurefarmers.

http://www.communiculture.org