Category Archives: My Work

Interactive Forest

From my previous post, animation.Float, I had the basic example of the animation class that I wrote to simulate dandelion seeds floating in the wind.  Well I had some free time this weekend and decided to keep my AS3 skills sharped and went on to add interactivity!    Depending on the location of your mouse will vary on the speed of the wind blowing the seeds around.  Farther away you go from the middle the faster the wind gets.  The interactivity is also directional and when you click on one of the seeds they disappear.


The Float class was one of the very first classes that I wrote on my own. Pretty much after I got done reading a book about OOP in AS2, I started this class.  Looking back now, it was pretty rough.  To add in the interactivity and to port the class over to AS3, I pretty much gutted the whole thing and started new, but it is neat to see that I have come a long way in such a short time.

Now the seeds are in a new Dandelion class that extends Float. Float contains a wind object which is shared among the other instances of dandelion seeds (kind of like a singleton, not really fond of them personally, but that is a different post).  After that is was simple to add in the required mouse detection class and update the wind velocity based on the mouse position.

Future:

There are still a few bugs left, if you are in FireFox switch to another tab and then come back.  Also I want to enforce the wind velocities a little better in case the mouse position is too extreme.  To enhance it I want to make it 3D by splitting the picture into layers and having the seeds go between the tree.  The 3d would also have the smaller seeds be removed from the stage earlier to make it look like it landed in the background of the image.

[UPDATE]: Github Repository for the Interactive Forest

Licensed under Creative Commons, so feel free to use them in your project and if you do please let me know.

Cartoons made in Flash

My first job in Flash was animating a children cartoon series. I had always drawn pictures and such as a child but freshly graduated I had no experience in animation. At first it was very frustrating to get any cartoons done, but I finally had a break through and this job became such a wonderful experience for me. I started with nothing and at the end of my two years with Kid Chess I had made 75 cartoon episodes of edutainment to teach kids (K-5th) how to play chess.

I would have never guessed the popularity of theses cartoons in the schools. To me I was just messing around try to make the knight’s lips sync with the audio. Despite my novice everyone wanted more, and so a got some great help from Josh Latta a great cartoonist to help me out on the videos.

And the weapon of choice for animating the cartoons….none other than Flash. At the time I didn’t know better but there is better animation software out there. I finally wised up and bought Preimer Pro and After Effects about a year into the job, but none the less it was and still is a great tool to create simple animations.

Below are some samples of my work. Head on over to KidChess.com to see more.




utility.Debugger

Screen Shot of Debugger

Description:

A Flex application that I developed to print trace messages to a custom debugger panel.  I use it in all my projects since trace does not work on applications running out side the Flash’s IDE.  Some of the features include 3 message levels so that you can choose not to get flooded with debugging messages.  Secondly you can also highlight messages. This works great for error messages and looking for those hard to find variables.    Even if your compiling in Flash’s IDE, Debugger still sends out your message as trace. This is a life saver in time and debugging when your clients call say the live app is not working. This app is a must for any Flex or Flash project.

[ View  debugger panel ]

Download:

[ Debugger.zip 281 K ] The source files for both the output panel and the static class that you place into your project to send messages to the panel. Instructions on using debugger panel is in the class file.

?Download Debugger.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
 Copyright(c) 2008-09 Craig Simpson, Some rights reserved.
 Your reuse is governed by the Creative Commons Attribution 3.0 United States License
*/
 package net.craigsimpson.utility{
 
	import flash.net.LocalConnection;
	import flash.events.SecurityErrorEvent;
	import flash.events.StatusEvent;
 
	/*
	 	Debugger Singleton Class:
 
		Developed to be used in AS3 Flash & Flex applications. The class sends debug meessages 
		to the custom built debugger panel. Kind of like looking trace commands in a browser. 
		Great for both development and when application is live on the web.
 
			//Example actionscript to send messages to plane;
			var debugger:Debugger = Debugger.instance;
			debugger.connect("MyCoolApp");
			debugger.send("Test 1...2....3");
 
		Debugger Panel Application:
 
		The custom debugging panel source can be downloaded at www.craigsimpson.net/download/Debugger.zip
		Also a live version is hosted on my site at www.craigsimpson.net/debugger.html
 
		Contact:
 
		Report any bugs, comments, or suggestions at www.craigsimpson.net/contact
	 */
 
	dynamic public class Debugger
	{
		private const CONNECTION_NAME:String = "_debugger";
 
		private var debuggerLC:LocalConnection;
		private var _appName:String;
		private var _domain:String;
 
        private static var __instance:Debugger;
 
		public function Debugger(enforcer:SingletonEnforcer)
		{
			//Constructor
		}
 
		public static function get instance ():Debugger
		{
			if(Debugger.__instance == null) {
				Debugger.__instance = new Debugger(new SingletonEnforcer());
			}
			return Debugger.__instance;
		}
 
		/*
			Send messages to output in the debugger window
		*/
		public function send(message:Object, level:Number = 0, hightlight:Boolean = false):void
		{
			debuggerLC.send( CONNECTION_NAME, "outputText", message, level, hightlight );
			trace(message);
		}
 
		/*
			Connects application to debugger panel, must be called once in your application.  Since multiple apps are allowed to connected to the debugger
			panel applicationName helps indenifty which apps are currently connected.
		*/
		public function connect(applicationName:String = null, domain:String = null):void
		{
			_appName = applicationName ? applicationName : "Unknown Application";
			_domain = domain ? domain : "*";
 
			debuggerLC = new LocalConnection();
			debuggerLC.allowDomain(_domain);
			debuggerLC.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onConnectionError);
 
			send( _appName + " Connected ", 1, false );
		}
 
		/*
			Sends a message that is highlighted in red, for sending error messages that need to catch the endusers atttention.
		*/
		public function sendError(errorMessage:Object):void
		{
			send( errorMessage, 2, true );
		}
 
		/*
			Sends highlighted message to panel.
		*/
		public function sendHighlighted(message:Object):void
		{
			send(message, 2, true);
		}
 
		/*
		 *  Event Listeners
		 */
		private function onConnectionError(event:SecurityErrorEvent):void 
		{
			debuggerLC.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onConnectionError);
			debuggerLC = null;
 
			trace("LOCAL CONNECTION SECURITY ERROR!");
			throw new Error("onConnectionError: "+event.toString);
		}
	}
}
 
internal class SingletonEnforcer {}

Future:

Documentation write up for implementation of Debugger class and using the panel. Any suggestions for future releases are greatly appreciated.