Switch Statement in ActionScript 3

2011.03.03

Using switch or case statements in place of “if” statements isn’t hard once you understand how the case is determined. Most examples on the web will show you how to write the switch statement but not how to call it.

The switch statement goes inside a function. In this case the function is named “updateText”. Now imagine you have several buttons in your movie. When the user clicks on any of those buttons, that button is the “event.target”

In plain english it goes like this:
If the “event.target” clicked is “button1_btn” then display “case 1″ in the “tBox_txt” text box then “break”.

What’s up with the Break?
This one is real simple. The “break” is required. Without it, every case will be evaluated and result in a fail.

In this example “event.target” is being evaluated.

button1_btn.addEventListener(MouseEvent.CLICK, updateText)
//
function updateText(event:MouseEvent):void {
switch (event.target) {
case “button1_btn” :
tBox_txt.text = “case 1″;
break;
case “button2_btn” :
tBox_txt.text = “case 2″;
break;
case “button3_btn” :
tBox_txt.text = “case 3″;
break;
}
}

Categories : Flash  ActionScript 3.0

unGeeked e’lite

2010.12.22

A few days ago I had the privilege of speaking with Cd the head organizer of unGeeked e’lite about speaking at the next retreat in March. I found out about the retreat from @ghostexecutive and @punklawyer who recommended that I be added to the list of speakers so to them I humbly say, thank you.

This is not your ordinary run-of-the-mill conference where you sit and watch a series of slides in liner progression. In fact the use of slides and such is a big no, no. Instead, the speakers foster and engage in conversation about the specific topic. I’m excited about this because it’s the perfect platform for another Therapy Session.

I encourage you to learn more about unGeeked e’lite and be sure to register for the Orlando retreat coming up in March 2011. If you can’t make that one, look at the other dates and locations.

Register for unGeeked e'lite  Marketing, Branding and Social Media Retreat - March 3-5th, 2011 in Orlando, FL  on Eventbrite

Categories : Skipping Rocks

“Therapy Session” Talk – Barcamp Tampa

2010.10.01

Homer Gaines – “Therapy Sessions” from Homer Gaines on Vimeo.

This is the pilot for series of talks that I give called “Therapy Sessions”. It’s intent is to give insight to designers who work with clients that may have a hard time getting out of their own way and vise versa.

This session was filmed at Barcamp Tampa on Sep 25th, 2010. The pilot was cut short but overall was received very well. The talk continued later at the after party.

Categories : Skipping Rocks

Thoughts About Web Design and Retina Displays

2010.09.26

I was taking some pictures this weekend with a friend who a very talented web designer with a traditional background in print design. She and I have had several conversations about print designers moving into the web world and how it seems that usability is often not a concern. This mainly is because print designers don’t have the same usability concerns that web designers have.

As we talked shop while taking pictures we noticed how different we framed the subject in the shots. I shoot landscape because I’m thinking about using images for the web, whereas she shoots portrait because her first thought is about print. The next thought through my head was not how we chose to see subjects through the viewfinder but more along the lines of how we have been trained to see the world as it relates to the mediums we create for.

I was then doing some reading online and came across a post on feedly about designing for apples new Retina displays. I knew that the new iphone had a higher resolution display than any other handheld device on the market but what I didn’t pay attention to was how that could effect my designs now and in the future.

One of the take aways from the articles was changing the way I think about resolution and displays. As a designer, I look at images and measure them according to pixels but at the dawn of this new resolution world, I need to see images as points. The reason being, displays like the Retina display have a higher pixel density than other displays and instead of measuring in pixels (px) it uses points (pt).

So now,  I’m looking more into the subject to determine if how much it’s going to impact what I do as designer and may possibly begin designing my sites using this new measurement in conjunction with SVG images based on my findings.

Categories : Skipping Rocks