Ramblings

November 9, 2006

inArray Method for JavaScript and ActionScript

Filed under: flash — michaelangela @ 12:15 pm

Lo and behold… actionscript (2.0 at least) does not seem to have a way of checking if an item is in an array. Here is a snippet of code to help with that.

Code Lab » Blog Archive » inArray Method for JavaScript and ActionScript

This method (prototype) provides simple linear search capabilities for the built-in array class of JavaScript and ActionScript (ECMAScript compatible). It will return true or false depending upon whether the value passed as an argument to the method is found within the array object.

powered by performancing firefox

Moses Supposes links: ActionScript2 Utility Classes

Filed under: flash — michaelangela @ 4:58 am

Perhaps this will work with the Dynamic Flash Delegate class as well. Other useful links on the site as well along with notes and examples.

MosesSupposes :: AS2 Utility Classes

CallbackDispatcher 2.0 Updated January, 2006
Scopes all standard MC, Button, and TF callbacks (onRollOver, onScroller, etc.) back to your class using easy syntax like:
my_mc.addEventListener (‘onRollOver’, this);
function onRollOver(o:Object)… // handler in this scope

This easy system keeps you from having to write a bunch of references and callbacks into simple button clips.

When used with Delegates it also enables the grouping of callbacks into a single uniquely named event handler (something like handleMainNavEvents, for instance).

powered by performancing firefox

ActionScript util class: XML2Object

Filed under: flash — michaelangela @ 2:24 am

An updated XML2Object class. Phil has cleaned it up a bit. I haven’t used the original yet as I have been using XPath4AS2. But it’s good to keep in mind.

SillyDomainName.com » Blog Archive » ActionScript util class: XML2Object

What I found was this great little class from Alessandro Crugnola. As good as it is though, I felt the need to do a bit of code clean-up. I’ve done a bit of refactoring, got things working in Flash 8, used some more explicit variable names and stricter type casting, removed some crud, and finally set things up so that parsing can be done through a single static method.

powered by performancing firefox

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.