Mar
21
2010
When returning a Boolean you can do the validation inside the return statement. Usually I would do something like this:
function doTest():Boolean
{
var returnValue:Boolean = false;
if (someValue > otherValue) { returnValue = true; }
return returnValue;
}
Instead, you could shorten it down to only one line of code like this:
function doTest():Boolean
{
return (someValue > otherValue);
}
doTest will return true if someValue is greater than otherValue. Pretty neat huh?
no comments | tags: actionscript, AS3, boolean, return, snippet | posted in AS3, flash
May
25
2009
As you probably know, the iPhone adds a nice glossy effect to your application’s icon. It sure does look good, but sometimes it just doesn’t suit your icon. It can be prevented by editing the Info.plist file. It’s easy! Follow me.

Click on one of the lines to make the little plus icon appear. Click the plus icon to add a new line.

Give it a key name of UIPrerenderedIcon.

The value is by default set to String, but we need to change it to Boolean. Right-click the newly created line, choose Value Type > Boolean.

The value has now magically transformed into a check box.

Click it!
And you’re done. It’s as easy as that.
no comments | tags: application, boolean, development, glossy, icon, iphone, uiprerenderedicon, value type, xcode | posted in iphone