Monthly Archives: November 2005

Could a lot of Inspectable properties cause Flash to crash?

Update: I posted some additional information about the Inspectable issue.

So I’m working on some components, and they have Inspectable tags on all the properties that are customizable. Nothing new or exciting here… except that one particular component has a large class heirarchy with well over a hundred properties. Just about every time I mess with one of these properties, Flash starts acting up, and sometimes it even crashes without warning. After trying everything imaginable to track down the problem, I believe that Flash 8 is just having trouble handling so many properties at once.

Originally, I figured Flash was choking on some of the legacy assets in the library. There’s a lot of AS1 code floating around, and since I didn’t work on any of the art assets, there could be all sorts of evil lurking in the dark corners. So, to be extra sure, I created a brand new FLA, and made a new symbol for my component from scratch. I didn’t add any art, it’s just the component on a blank symbol.

After I set the class in the Component Definition dialog, everything is looking good. Then I try to save the FLA. It appears to work, except for one detail: The asterisk that says my file has been modified didn’t disappear. It’s definately not anything in the art. I’ve been hitting this fork in the road for the last two weeks, art or no art. I can continue working and hope that it works the next time I try to save the file (or the FLA gets corrupted and I have to start from scratch or get it back from CVS), or I have to close my FLA and open the last saved version to try doing the same thing over again.

Unfortunately, that’s the better behavior from Flash. Every once in a while, Flash will completely crash on me. Most of the time, Windows throws up that nice little “Ha, ha! Your program sucks! Do you want to tell us about it?” dialog. Usually this happens if a click on the stage somewhere after messing with some properties. Sometimes Flash just closes without any warning whatsoever while I’m compiling my SWF. I’ll just look at the taskbar and notice that it’s gone.

As far as I can tell, no one else is having this problem. I’ve done quite a few Google searches. The only thing I found that sounds anything like this behavior is in the Release Notes for the Flash 7.2 update. In the “Crash Issues Addressed” section, it says 96110 : Component property definition with Inspectable value incorrect will cause crash. As far as I know, all my Inspectable tags are correct. The only thing I’m not sure about is where exactly to use quotes, or if it even matters. Every tutorial for Inspectable is different.

Has anybody else faced problems working with Inspectable, or does anyone from Macromedia know of continued issues with Inspectable causing crashes?

Web Standards Solutions is Polished, Focused, and Fresh

I don’t like programming books. My own small collection has a lot of snoozers, and only a couple cloudy gems. Lucky for me, the last time I visited the local Barnes and Noble, I discovered Web Standards Solutions: The Markup and Style Handbook by Dan Cederholm. The book is published by Friends of ED, a name I keep hearing, but I hadn’t taken a look at any of their titles yet. After reading this one, I’ll be sure to check out any others I see.
Continue reading

An All-in-One Web Development Solution?

You may have heard about Nicolas Cannasse and his revolutionary MTASC Actionscript 2 compiler. For the developers in the Flash crowd, MTASC brings Actionscript to a completely new level of power and flexibility. Unfortunately, Nicolas announced recently that he doesn’t want to make a version of the compiler for AS3. He points out that MTASC provides a missing tool, but the Flex 2 compiler from Macromedia already provides that and promises to build on it. I’d love some strong open source AS3 tools, but I can understand where he’s coming from. He wants to innovate, not recreate.
Continue reading

Connecting to AIM with ActionScript 3 Sockets

Update: I’ve added some more features to FlashAIM, such as text formatting.

The community has been posting some pretty cool things made with Flex2. Andre Michelle’s blog has been filled with all sorts of interesting 3D and bitmap experiments. Darron Schall presented a preview of his VNC client which takes advantage of bitmap drawing and the new Socket api. Of course, I couldn’t let everyone upstage me, so with a couple weekends of work, I put together some classes for connecting to and interacting with AIM via the TOC 2.0 protocol. I made the basic user interface below just so I’d have a screenshot of the code in action.

Thumbnail image of basic client in action

At the moment, the TocConnection class allows a user to log in, keep track of the status of buddies, send and receive messages, and set his or her own user info. I mainly wanted to get the most vital functions in place before releasing any code. I don’t know if I’ll expand it, but maybe I’ll start a project on OS-Flash so that the community can contribute.

Here’s an example of how to use TocConnection in your own code. In the example, event handlers simple trace the output to the console. We start with initialization of the connection and adding listeners to the events. Generally, when a server message is received from AOL, an event is dispatched so listeners can update their status.

After initialization, and once you receive the connect event, you can start sending and receiving messages, and accessing other data. Here you’ll notice I set my user info right away, and sent a message to SOME_USER. Normally you wouldn’t send automated messages like this, but you can start sending messages to other users after you receive the connection event. Finally, I loop through the list buddies for my account and trace them to the console.

package
{
	import net.zeusdesign.im.aoltoc.*;
	import flash.display.Sprite;
	import flash.util.trace;

	public class ActionTalkTest extends Sprite
	{
		private var _aol:TocConnection; //the main connection class

		public function ActionTalkTest()
		{
			//the constructor takes host and port as params, but there are defaults
			this._aol = new TocConnection();
			this._aol.addEventListener(TocEventType.CONNECT, onAolTocConnect);
			this._aol.addEventListener(TocEventType.DISCONNECT, onAolTocDisconnect);
			this._aol.addEventListener(TocEventType.ERROR, onAolTocError);
			this._aol.addEventListener(TocEventType.RECEIVE_MESSAGE, onAolTocReceiveMessage);
			this._aol.addEventListener(TocEventType.UPDATE_BUDDY, onAolTocUpdateBuddy);
			this._aol.connect("YOUR_SCREEN_NAME", "YOUR_PASSWORD"); //sorry, can't have mine
		}

		private function onAolTocConnect(event:TocEvent):Void
		{
			//set your user info
			this._aol.setUserInfo("This user is connected with ActionTalk.");

			//sendMessage takes a screen name and the message to send to it
			this._aol.sendMessage("SOME_USER", "Hi, I'm talking to you from Flash!");

			//the following adds all your buddies to a string and traces it out
			var output:String = "";
			for(var i:int = 0; i 

Other events include ERROR, RECEIVE_MESSAGE, and UPDATE_BUDDY. As far as I know, errors that you receive after sign-in aren't fatal. If you receive it beforehand, the server will drop the connection. When another user sends you a message, a specialized event tells you the screen name , his or her message, and if the message was automattcally sent (an away message). Another event is triggered whenever the state of one of your buddies changes. Typically, this happens one someone goes offline, becomes idle, or receives a warning.

//error event handler
private function onAolTocError(event:TocErrorEvent):Void
{
	trace("Toc Error: " + event.errorID + " " + event.message + " [" + event.raw + "]");
}

//receive message event handler
private function onAolTocReceiveMessage(event:TocImEvent):Void
{
	var output:String = "";

	//auto variable in TocImEvent marks auto-replies such as away messages
	if(event.auto) output += "Auto-Reply from ";

	//screenName refers to who sent the message and message is what they said
	output += event.screenName + ": " + event.message;
	trace(output);
}

//update buddy event handler
private function onAolTocUpdateBuddy(event:TocUpdateBuddyEvent):Void
{
	//generally updates online status, warning level, and idle time
	trace("Update Buddy: " + event.screenName + " " + event.online + " " + event.warningLevel);
}

That's it. The instant messenger source code is available. Get the free Flex 2 SDK from Adobe.