print_r For Actionscript3

I’ve always wanted a print_r function for AS3 that worked like the one in PHP so I finally decided to write my own. As always, please comment back with things that don’t match up with the original print_r and I’ll update.

AS3 Frame Change (by label) Listener

So Event.ENTER_FRAME runs at the full fps right? Perhaps you just want to know when a frame is changed in the timeline. The following is how you can accomplish that:

Keeping OOP Scope While Using setInterval

Recently I have been working on projects that involve classical inheritence in JavaScript and also use window/document methods which requires me to manage the ‘this’ binding more closely. I encountered a situation where call/apply would not help, so I came up with a quick strategy that will hopefully help someone else out there.

When trying to run something like:

{syntaxhighlighter brush: jscript;gutter: false; fontsize: 100; first-line: 1; }setInterval(“this.myFunc()”, 1000);{/syntaxhighlighter}

Recursive Remove Files In Terminal

This is for or less a link for me because I forget how to do this often and have to scour the web

How to recursevely remove all .svn folders:

{syntaxhighlighter brush: bash;gutter: false; light: true; fontsize: 100; first-line: 1; }find . -name “.svn” -type d -exec rm -rf {} \;{/syntaxhighlighter}

How to recursively remove all files and folders starting with ._

Searching MySQL Database for EXACT word

Recently I’ve been stumped with searching a mysql database for exact words. I’ve tried a number of strategies I found online, but none worked exactly as needed.

The REGEXP didn’t work for me at all (probably because I didn’t really understand it in the first place). The MATCH/AGAINST would work, but only sometimes. The LIKE worked, but it included more words than what I wanted.

OSMF and Akamai Streams

For the last few hours I’ve been looking for info on how to do akamai streaming with the Adobe Open Source Media Framework. Mainly so we could take advantage of Akamai’s CDN streaming (rtmp).

Apparently, it’s easier than I thought it was going to be. Do the following and you’ll be set.

Static Listeners in Action Script 3

Hypothetical sitatuion: Let’s say you have a Flash/Flex AS3 video player and a play button which are nested inside separate parents. Your play button listens to when your player is PLAYING so that it can update it’s display accordingly (shows a play icon when the player is paused and shows a pause icon when the player is playing).

Cross-domain XHR

I learned about a new feature and decided I would share light with the rest of the web. I’m working on a YUI application for YAP and it’s causing trouble in the app because it’s forcing cross-domain loading of an XML file I need to load. However, it’s their platform and thus, their rules. Anywho, you can allow your files to be loaded to another domain by added a simple header to your file.

This can be done easily in PhP by adding the following code to your PhP file:

Documentation of Creating a Simple Safari 5 extension

Safari Show Develop Menu

I’m doing a safari 5 extension today and I wanted to document the beginning of my experience to hopefully help devs down the road who also take this same adventure. I’ve also attached a Safari Extensions PDF from Apple that explains extension creation in greater detail.
*note – I recently switched back to mac. Hopefully this will work for you PC folk as well.


OOP in JavaScript

As tested, this works in WebKit browsers (including iPhone), Firefox, Chrome, and Opera. I’ve abonded all hope for IE.