other tags

ajax /  arcball /  AS3 /  attractors /  awards /  barcelona /  book /  brighton /  carnivore /  choroq /  clustering /  code /  color visualization /  conference /  conversation /  cover /  dojo /  email /  email visualization /  exhibit /  fitc /  flashcom server /  fluid dynamics /  fonts /  fotb /  gaming /  globe /  gps /  graph /  heteml /  information visualization /  ink /  inspiration /  instalation /  installation /  interaction design /  interview /  ivrea /  javascript /  life /  livesearch /  mediatemple /  mobile media /  moblog /  mysql /  network /  network activity /  network visualization /  news visualization /  pencil /  phidgets /  physical computing /  publication /  research /  school /  sketches /  social network /  space perception /  telepresence /  time visualization /  timeline /  tokyo /  treemap /  treemaps /  vector field /  visualization /  website /  work /  workshop / 

tags / as3

December 05, 2012

Debugging AS3 with firebug's console

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:

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.

July 17, 2006

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.

October 29, 2005

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);
       }
    }
}

October 29, 2005

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);
      }
   }
}

June 09, 2004

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:) 皆様本当にお疲れ様でした!