Internet Explorer 6 is not supported.
Upgrade to view this site.

Blog Archive

Results for the blog tag classes.

AddThis Class For Custom Flash Visualizations

One thing I don’t like about the AddThis API is that it doesn’t give you the ability to get all services to make your own custom visualizations. You can only make a bookmark URL one link at a time. If there was some way to get all the services listed you could loop through them in any programming language and make your own organized listing of all the services and attach the link accordingly. Whether that was a just a scroll box or some kind of crazy over-the-top 3D Flash thing it would be possible with such an API. I suggested this idea of a Supported Services Data API on the AddThis forum. Read more …

Associative Arrays

An Associative Array can be made in ActionScript 3 by using an Object instead of an Array. You use the Object to make a name/value pair. Name/Value pairs consist of a name and a value and are separated by a colon. The name is what you use to reference the value. When you reference what is in the Associative Array you just write the name as if it was a property on the Object. Here is an example of how to make an Associative Array.

1
2
3
var info:Object = {name:"Tony", occupation:"Bouncer", iq:80};
 
trace("My name is " + info.name + " and I am a " + info.occupation + " with an IQ of " + info.iq + "." );

You could also write it out long-handed and the effect would be the same. Below is the same thing but the names are added as dynamic properties of the newly instantiated Object.

1
2
3
4
5
6
var info:Object = new Object();
info.name = "Tony";
info.occupation = "Bouncer";
info.iq = 80;
 
trace("My name is " + info.name + " and I am a " + info.occupation + " with an IQ of " + info.iq + "." );

They only problem with this is that you lose the length property on this Associative Array. If you try getting the length property it will come up as undefined. I looked this up and found that Senocular actually has a class that fixes this. That class is called AssociativeArray and it can be found here. When I first tried it I got an error at line 32. I didn’t read the class to figure out what was wrong, but I commented out the line throwing the error and it seems to work fine. Here is an example of that class in action. Read more …