May
25
2009
Thomas Viktil
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
May
2
2009
Thomas Viktil
I code snippet I tend to use quite often. And one that I tend to forget how I wrote the last time i used it.
while (this.numChildren > 0)
{
removeChild(this.getChildAt(0));
}
Update:
And when you want to remove a child as a part of an event handler, do this:
event.target.parent.removeChild(event.target);
Let’s say you want to delete the button you just clicked. The button dispatches an event, and this line of code goes in the event handler. event.target is the button (or what ever object you clicked). It does look at bit strange, because you have to tell the button that it’s parent should delete the button. The button can’t delete itself.
Note:
If you’re working with Flex, use this.removeAllChildren(); Thank you Bjørnar
no comments | tags: AS3, child, code, event, eventhandler, flash, flex, parent, remove, removeChild, snippet | posted in AS3, flash, flex