Zoltán Majoros, freelancer iOS developer living in Bonn, Germany.

Contact: info@arcanelab.com

Posts Tagged: bug

Text

Today I noticed a very, very strange behaviour (bug?) in Xcode. I am creating buttons for my iPhone application with a custom image background and a text on top of it. The Interface Builder attributes window looks like this:

Usually I change the font-family and size for my text, but when I do this, the button dimensions suddenly grow pretty big. So I just head over to the Button Size tab and reset the dimension values to the originals, like so:

And here comes the crazyness: as I modify the width/height values, the text inside the button gets slightly blurred!

During my current development I realized that some button texts are not as sharp as others, but I had no idea why. Finally I managed to catch this “bug” by redoing the last few steps before the blur effect occured.

How to overcome this pesky issue? If I resize the button “by hand” in the view editor, the text keeps its sharpness. Odd.

Text

In the past few weeks I’ve been digging into the realms of the Actionscript world as much as I could. (And I was never as excited about any programming language before as I am about AS3.) I’ve been reading tons of documentations (primarily this one, several times), and still I have black spots even on pretty basic stuff.

For example, take this code:

package 
{
import flash.display.Sprite;
import flash.events.*;

public class Main extends Sprite
{

public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}

private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point

graphics.beginFill(0x7f7f7f);
graphics.drawCircle(300, 300, 300);
graphics.endFill();

addEventListener(MouseEvent.MOUSE_MOVE, handler);
}

private function handler(e:MouseEvent):void
{
trace(e);
}
}
}


Seems pretty trivial, eh? The problem is that if I attach an event-listener to the main class of the swf file (as I did in the example above), seemingly no MouseEvent will be dispatched to the handler. If I add the very same event-listener to the stage, the mouse events suddenly start to be delievered.

Please, somebody educate me, why?