Mike T. Henderson

I make interactive things.

Categories:


More Mike:

Using String.search() in AS3: Determining Window Target in navigateToURL.

July 14, 2009

I came across an instance the other day where I had a set of links; some of which where internal, while others where external. I wanted the internal links to open in the same window(target="self"), and the external links to open in a new window/tab(target="blank"). Since I was loading these links from an external json file, populated dynamically and displayed in Flash via a loop, the easy solution to determine the window target was to search for the internal domain name substring within the url string using String.search().

Continue Reading

0 Comments | Posted under Strings

Return Query Value — Version 2

February 2, 2009

http://www.mikethenderson.com?name=mike&age=27

A while back I created a little ActionScript 3 class, using the ExternalInterface.call method, that returns a query string value from the url. This came in pretty handy for things such as direct linking to certain videos within a video player, displaying campaign specific content on load based on different referring sites, ect, etc.

Upon second glance, I realized that I got a little loop-happy with the previous attempt. Below is a slimmer version with the redundancies taken out.

Continue Reading

1 Comment | Posted under Strings

AS3 QueryString Class

May 9, 2008

Today I was working on a video player in AS3 that I wanted to be able to play any video on initial load by passing a variable through the query string. I had done this before in AS2 using the ExternalInterface class but wasn't sure if it was still valid in AS3. After a little quick research, I found that this is one thing that they left alone between the two versions.

So after a few minor AS2 to AS3 migrating, I now have an AS3 version of my QueryString class. The following app allows you to search through a query string for a value of a specified variable. To test, add a query string to the url and play.

Continue Reading

9 Comments | Posted under Strings

Return Variable Value From Query String

January 2, 2008

I recently came across a case where I needed to use a query string in my URL to determine which content to display in my Flash. I learned that returning a query string can be as simple as using the ExternalInterface.call() method.

Continue Reading

0 Comments | Posted under Strings