"3actionscript" Posts

Tip of the Day – How to create a prompt field on your mx:ComboBox

For a long time I’ve been doing things like this within Flex.

[Bindable] private var _skills:Array = 
[
	{label: "---", id: -1},
	{label: "1 - Newbie", id: 1},
	{label: "2 - Some Experience", id: 2},
	{label: "3 - Expert", id: 3},
	{label: "4 - I'm a baller", id: 4}
];

And then binding this data provider to a ComboBox…

<mx:ComboBox id="skillsCB" dataProvider="{_skills}" />

Well it turns out there is a much easier way of doing this that I never knew of until today. ComboBox has a “prompt” attribute that you can set. It’s so easy…

<mx:ComboBox id="skillsCB" dataProvider="{_skills}" prompt="---" />

I told you it was easy. Can’t believe I never noticed it before.

Late-night programming

package
{
	import net.natebeck.Nate;
	import net.natebeck.events.NateEvent;
	import com.bugquash.Project;
	import flash.event.Event;
 
	public class BugQuash
	{
		protected var pokeCount:int;
		protected var baller:Nate;
 
		public function BugQuash()
		{
			baller = new Nate();
 
			baller.addEventListener(NateEvent.GETTING_TIRED, onGettingTired);
			baller.addEventListener(Event.COMPLETE, onComplete);
 
			baller.generateCode(Project.QUASHBOARD);
			baller.generateCode(Project.QUASHBOARD_ADMIN);
			baller.generateCode(Project.SERVER_LOGIC);
 
			baller.loadTest(Project.SERVER_LOGIC);
		}
 
		protected function onGettingTired(event:NateEvent):void
		{
			baller.caffinate();
		}
 
		protected function onComplete(event:Event):void
		{
			baller.sleep();
		}
 
		public function poke():void
		{
			if(++pokeCount < 4) 
			{
				baller.say("Ouch!");
			}
			else 
			{
				baller.say("Hey... that's kind of nice");
			}
		}
	}
}

Register for the Flex SDK BugQuash! It’s free!

Soooo… it is 4:46 am here… Pacific Standard Time.  I stayed up all night finishing up the registration system so I could get this information out to all of you.

Registrations for the first Flex SDK BugQuash event are now open.  It’s free, so go ahead and sign up.  We’re very excited about it.

Register for the event —> here.

March 28th, 10am – 8pm in Seattle, WA

We will also be broadcasting the event, live. So even if you can’t attend physically… you can attend virtually (very ninja-like)! More information about the event can be found on BugQuash.com.

Night all!

:: Update ::

My bad, my bad.. I wrote the wrong time on this post. The actual time is from 10am – 8pm. My apologizes for the confusion.

TweetCoding!

Two days ago Grant Skinner announced he’s now part of the Twitter craze.

One day later, he has setup a “TweetCoding” competition. Winner will receive a copy of Flash CS4 (compliments of Adobe).

As for how it’s going to be judged… nobody really knows yet… but loads of fun none the less.

Official Rules —> here
Template Files —> here

And you can follow the competition —> here