<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,8 +3,8 @@ package skins {
 		[Embed(source=&quot;GithubBadge/ProjectSprouts.png&quot;)]
 		public static var ProjectSprouts:Class;
 
-		[Embed(source=&quot;GithubBadge/zmack.png&quot;)]
-		public static var ZmAvatar:Class;
+		[Embed(source=&quot;GithubBadge/octocat.jpg&quot;)]
+		public static var DefaultAvatar:Class;
 
 		[Embed(source=&quot;GithubBadge/public.png&quot;)]
 		public static var PublicProject:Class;</diff>
      <filename>assets/skins/GithubBadgeSkin.as</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>bin/GithubBadge.swf</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,13 @@
 package {
 	import flash.display.Sprite;
 	import flash.display.DisplayObject;
+	import flash.display.LoaderInfo;
 	import skins.GithubBadgeSkin;
 	import dataexchange.*;
 	import com.adobe.serialization.json.JSON;
 
+	import flash.external.ExternalInterface;
+
 	/*
 	Data looks pretty much like this: 
 
@@ -26,15 +29,31 @@ package {
 	public class GithubBadge extends Sprite {
 		private var _gw:Gateway;
 		private var _pl:ProjectList;
+		private var _user:String;
 
 		public function GithubBadge() {
+			var user:String;
+			addExternalInterface();
+
+			try {
+				user = getParams().gitUser;
+			} catch (e:Error) {
+				user = 'evilchelu';
+			}
+
 			_gw = new Gateway();
 			
-			_pl = new ProjectList();
-			addChild(_pl);
-			_pl.y = 20;
+			this.requestData(user);
+		}
 
-			this.requestData('evilchelu');
+		private function addExternalInterface():void {
+			if ( ExternalInterface.available ) {
+				ExternalInterface.addCallback(&quot;requestData&quot;,requestData);
+			}
+		}
+
+		private function getParams():Object {
+			return LoaderInfo(this.loaderInfo).parameters;
 		}
 
 		private function onDataLoaded(e:GatewayEvent):void {
@@ -42,23 +61,23 @@ package {
 		}
 
 		private function displayProjectList(user:Object):void {
-			_pl.setHeader({image: SpriteWrapper(new GithubBadgeSkin.ZmAvatar()), text: user.name });
+			if ( _pl != null ) _pl.parent.removeChild(_pl);
+			_pl = new ProjectList()
+
+			_pl.setHeader({image: SpriteWrapper(new GithubBadgeSkin.DefaultAvatar()), text: user.name });
 			user.repositories.forEach( function(repo:Object, index:uint, arr:Array):void {
 				_pl.addButton({image: SpriteWrapper(new GithubBadgeSkin.PublicProject()), text: repo.name });
 			});
-		}
-
-		private function displayError():void {
 
+			addChild(_pl);
 		}
 
-		private function getUserObject(json:String = null):Object {
-			// Cheesy loading of cheesy test data
-			json ||= '{&quot;user&quot;: {&quot;name&quot;: &quot;Andrei Bocan&quot;, &quot;repositories&quot;: [{&quot;name&quot;: &quot;mephisto&quot;, &quot;url&quot;: &quot;http://github.com/zmack/mephisto&quot;, &quot;description&quot;: &quot;A mirror of the mephisto code-base&quot;, &quot;homepage&quot;: &quot;http://mephistoblog.com/&quot;}, {&quot;name&quot;: &quot;badjo&quot;, &quot;url&quot;: &quot;http://github.com/zmack/badjo&quot;, &quot;description&quot;: &quot;Github flash badge &quot;, &quot;homepage&quot;: &quot;&quot;}], &quot;blog&quot;: &quot;http://spinach.andascarygoat.com&quot;, &quot;login&quot;: &quot;zmack&quot;, &quot;email&quot;: &quot;zmaxor@gmail.com&quot;, &quot;location&quot;: &quot;Bucharest, Romania&quot;}}';
-			return JSON.decode(json).user;
+		private function displayError():void {
+			_pl.addChild(SpriteWrapper(new GithubBadgeSkin.OctocatImage()));
 		}
 
 		private function requestData(user:String):void {
+			_user = user;
 			_gw.getUserInfo(user);
 			_gw.addEventListener(GatewayEvent.DATA_RECEIVED, dataLoaded);
 		}
@@ -67,7 +86,7 @@ package {
 			if ( e.succeeded ) {
 				displayProjectList(JSON.decode(e.data).user);
 			} else {
-				addChild(SpriteWrapper(new GithubBadgeSkin.OctocatImage()));
+				displayError();
 			}
 			trace(e.data);
 		}</diff>
      <filename>src/GithubBadge.as</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cdf458f1b7cd292eaeca3fb2b35519734e98355b</id>
    </parent>
  </parents>
  <author>
    <name>Andrei Bocan</name>
    <email>zmaxor@gmail.com</email>
  </author>
  <url>http://github.com/zmack/badjo/commit/f6dcfc42b2cc64316f5b3db1d7218a76d66ff400</url>
  <id>f6dcfc42b2cc64316f5b3db1d7218a76d66ff400</id>
  <committed-date>2008-04-30T00:08:53-07:00</committed-date>
  <authored-date>2008-04-30T00:08:53-07:00</authored-date>
  <message>Cleanup, some changes, external interface</message>
  <tree>89f064b0cfc3a173a82da2bf91e6e0cab19b41e1</tree>
  <committer>
    <name>Andrei Bocan</name>
    <email>zmaxor@gmail.com</email>
  </committer>
</commit>
