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 / code

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.

December 04, 2008

QueryBox

QueryBox

QueryBox allows you to easily create a Live Search Input form that lets users search and refine a query while continuously showing all valid results as they type.

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

February 13, 2003

Interval Manager

Discussion on FlashCoders keeps on going endlessly about probelms that arrise when using setInterval(). A while ago I wrote this intervalManager that helps with keeping track of all intervals that get set in a movie. Although this version works with no problem, there are still a couple of issues to be solved for it to work as close at setInterval(). Maybe there's someone out there with a little bit more time:P who can give it a look and solve the last issues that I point below. OK, so you are tired of loosing your interval ID's, you always have to remember to kill any interval before setting it again and such.
Well, intervalManager will basically store all those precious id's under a list, to which you can always reference and clear anytime. read more...

January 11, 2003

ZoomPane Component 1.0

Ok, so I finally got sometime today to fix the couple of bugs i had pending from the beta version. Wrote and packaged al documentation (which shouldn't be really nessesary to learn how to use it ) aaaand, here you go: view the working demo or get ZoomPane 1.0 over here (MXP) This will be the first release of a component library I'm working on - that's why once installed, you'll find ZoomPane under the TOK Components tag in the components panel and the Reference panel. More components to follow depending on how this one works for everyone.

November 18, 2002

ZoomPane Beta

Here you go, ZoomPane component for your viewing pleasure :) Started working on it over Sam Wan's Devcon presentation files, and ended up writing it almost from scratch. as easy as:

zoomPane_zp.snapTo(scrollPane_sp);
scrollPane_sp.setScrollContent("worldMapSymbol");
scrollPane_sp.setContentScale(150)
get the component .zip file get the working sample .zip file or view the working sample If everything goes fine, expect the final .mxp release pretty soon. Please report any bugs, comments, critiques :)

November 18, 2002

ZoomPane component

Almost there, just a couple of minor bug fixes and documentation, and I'll be ready to release this component I'm feeling very confident about. quick demo over here