
A couple of bugs, workarounds and requests
Well, after expending some time working with HTML5 Canvas documents in Flash CC I could recognize some bugs (already mentioned some in my last post). I hope Adobe works on these since most of them are very random.
Weird properties in Textfields
When I was making the game I used some subtitles. In a layer I had several keyframes with different texts. Everything was working fine until I changed the color of the textfield. No matter what that textfield would be black with a default font instead of the font I’ve chosen.
To fix it I tried to assign an instance name to each textfield, no luck. Then I simply added another textfield outside of the stage, for some reason this worked. I have some theories but I can’t tell exactly how and why.
Encoding large Wav files will crash Flash
I had some small wavs, they got encoded nicely to MP3. But when I tried to add a 60 seconds wav it crashed. Tried the same wav in a regular Flash document and it worked without any problem. Then tried it again in a brand new HTML5 Canvas document and it crashed.
So, the workaround is pretty obvious. Encode your wav in a 3rd party software while Adobe fix this.
Oh, btw. Adobe, please encode not only the MP3 but the OGG. I know Firefox is annoying and they have a weird idea about how developers want to spend their free time “should I go to the movies? or should I stay at home fixing all the inconsistencies between browsers?”. But you have the money to make this happen.
Frame code not being executed
This one is big. If you have a MovieClip with code in its first frame, then you make an instance from the library and place the MC on the stage (or other MC) some times it won’t execute.
Temporal fix: add the behavior after instantiating. It’s horrible and nasty? yes, but that was the only way to make it work.
.removeEventListener() not working
Another big, some times in nested MC’s the method .removeEventListener() or it’s cousin .off() won’t work.
The workaround is to empty the array from the ._listeners object. By example, if you are trying to clean the event ‘tick’ you just need to type ._listeners.tick = [];
Well, I think that’s all by now, but wait… a personal request.
In regular Flash documents we have this nice option on display objects called “export as Bitmap”. It would be awesome to have this enabled, so Flash could convert complex vectors into bitmaps at export. This would make the workflow even faster.