Actionscript 3 getURL() class
I don’t know about you, but one of the things that I miss most about AS2 is the simplicity to use…
getURL("http:www.mysite.com", "_blank")
…to launch a web address.
I don’t know about you, but one of the things that I miss most about AS2 is the simplicity to use…
getURL("http:www.mysite.com", "_blank")
…to launch a web address.

I’ve been tearing my hair out for the last 24 hours trying to work out how the hell to get my precisely drawn design to scale correctly in Papervision. Anyone who’s tried this will know that it’s a frustrating blend of messing around with camera zoom, focus and field of view. But try as I might, I found it absolutely impossible to solve. I had come to the end of my patience and was ready to give up with PV3D and change the design completely…
…and then I came across this.
The thing that crossed my mind first when seeing this demo was “not only is it possible to reproduce a good pixel perfect 2D design in Papervision, but potentially it could be really great”.

If you want to add a Twitter feed to your flash website, currently the best way to do it is to pay a visit to Matt Pearson’s (Zenbullets) Twitter API explanation and buckle down to the code. However if like me you are finding your clients increasingly requesting Twitter feeds in their sites, perhaps you’ll appreciate my new Tweeter class for ease of re-use.
Try it out:
It’s based around Matt’s explanations and centres on drawing a single tweet from a single user (using the API’s “status” call). All I’ve done in my clumsy ham-fisted way is to simplify it for anyone who either doesn’t have the time to learn it or simply can’t be bothered. Now all you have to do is use something like the following code for it be up and running in seconds…
AS3 is a wonderful thing, but it can be really long-winded sometimes when you’re trying to achieve something simple – the perfect example being the replacement of AS2’s getURL() class with a series of listeners. I know why it has been set up this way, I understand why it’s better that everything follows a uniform methodology and I do wholeheartedly agree with it, but there is no getting around the fact that you can get bogged down writing the same long-winded code over and over again. Frankly, it can be a pain in the ass and can sap the fun out of simple tasks.
Sometimes I get around these chunks of code using snippets (see Lee Brimelow’s tutorial on how to set up snippets in Flex Builder), but sometimes the code is crying out for a simple class to be made – in my opinion, loading external stylesheets is one of these times.
The FindURL class has been updated and the new version can be found here.
This new version corrects a rather embarrassing issue – the class was returning no text at all if no URL was present in the text. I was so wrapped up with trying to get it to look for URLs in a text block, it didn’t cross my mind to test it without any at all! Problem solved now though, simply overwrite the previous version and everything should work as before.
This site is the playground of the The Burned Out Hippy, head honcho of the web design and multimedia company Plagro. It serves no other purpose than to act as a place where I can store my most recent Flash ActionScript experiments. However, I will be posting code whenever an experiment is complete so that you can have a play with it yourselves.