Archive for May, 2008

Flex and css: Unrecognized fill style type: 42

Monday, May 5th, 2008

We’ve had a strange bug for some time now that I’d like to share because we finally found it.

the scenario:

1 css stylesheet for a flex application.
8 windows computers with flex builder 2. 7 compiles the css perfectly the 8th throws a compile time error. Specifically: Unrecognized fill style type: 42
1 Linux server compiling with the command line compiler which also throws the error.

we tried:
copying the sdk from one of the non-complaining machines to both the windows and the linux server… it didn’t help a bit. When flex 3 arrived we tried compiling to flex 3 and all machines worked, but going back to flex 2 … the same problem.

The fix:
I figured there was only one way. Removing one line at a time from the css until it compiled. Unfortunately the line resulting in the error was embedding symbols from an extremely large swf file.
So next step was to remove one movieclip at a time to find the sinner. And let me tell you that took some time. The sinner turned out to be a shape tween. Once it was removed the css compiled as it was supposed to.

I expect the behaviour was not intentional since most machines compiled the css without any problems at all. If anyone out there run in to the same problem I hope this was helpful.

AMFPHP – Index out of bounds.

Monday, May 5th, 2008

I recently used a lot of time on this issue which exists when using AMFPHP.

the scenario:

I used a NetConnection to access an amfphp gateway. But everytime I ran my application I got a runtime error saying RangeError: Index out of bounds.

I tried to catch the error, but it seemed to happen between my call to NetConnection.call() and the callback to the Responder().

After a few hours I finally found out that my php populated an array with values in the following way

$array[1] = value1;

$array[2] = value2;

$array[3] = value3;

… and so on, skipping the 0 index.

this is perfectly alright with php. I suppose it acts like an associative array even though the keys are numeric.

But when it entered Flash it got translated into an Array instead of an Object resulting in the RangeError because the 0 index didn’t exist.

As soon as I added data to the missing 0 index everything ran smoothly.

First run

Monday, May 5th, 2008

So here it is. I finally did what I’ve been wanting to do for a while now. I went and made a blog about something I think I know enough about to interest other people… Adobe Flash… in all it’s appearences.

So in this space I’ll try to share whatever quirks and tips a know about programming flash, flex and AS3.