Search Category

Extra First Line in a Multi-lined TextField (Flash Pro)

June 23, 2009, 9:35 am by senocular

Part two of things I didn't know... And this has been something that has bugged me for years.

Have you ever added text through ActionScript to a multi-lined text field created in Flash Professional (Flash Authoring) and frustratingly found that the text immediately starts one line below where you think it should? Me too! Thankfully glosrfc pointed out to me why that is...

On-stage Bitmap Instances in Flash Professional

June 19, 2009, 8:17 am by senocular

It's not often I run across something I didn't know as simple as this. In fact I'm a little embarrassed that I didn't know this, but it gives me comfort that some other people I talked to also didn't know.

What is this of which I speak? Well it may or may not be fairly common knowledge that normally, when you place a bitmap from your library onto the workarea (a.k.a. "the stage" though technically, it's never really the stage, at least not the same stage ActionScript refers to) in the Flash Professional authoring tool, that bitmap becomes a shape, or a part of a shape consisting of other bitmap or vector graphics within the same layer or z-ordering group, once you publish your SWF. A quick test will reveal this behavior:


  1. Create a new Fla

  2. File > Import > Import to Stage...

  3. Add the following frame script:
    trace(getChildAt(0));

  4. Test movie



Result?

[object Shape]


If you didn't already know that, that's interesting enough. How then, you may ask, do you get an actual Bitmap instance on the stage in Flash? Until yesterday, I thought you couldn't except through ActionScript. But it turns out that is not true. Bitmap objects on the stage will become Bitmap instances rather than shapes if that bitmap image is exported for ActionScript (via library item properties).

Edit the image imported in the above example to be exported for ActionScript and run again to get the following:

[object Bitmap]


In other words, that image on the timeline has become a true bitmap instance rather than part of a shape. The Flash GUI still doesn't give you options for things like instance names or anything at this point, but the object available in the display list is in fact a true Bitmap.

Disabling Flash Player (Debugger) Error Dialogs

June 15, 2009, 1:55 pm by senocular

If you're a Flash/Flex developer, you've likely seen those Flash Player error dialogs resulting from unhandled ActionScript errors.

Flash Player Error Dialog

These appear when you have the debugger version of Flash Player installed and you run a SWF with errors in the code that are not handled correctly, either through appropriate logic, try..catch blocks, or the correct event listeners. But what if you don't want them?

Flaky Flex Builder Selections

June 12, 2009, 8:50 pm by senocular

Have you ever been making a code selection in Flex builder and suddenly the selection resets itself, starting over again from the current position of the mouse?

This has been KILLING me. But apparently not many people have seen this? Either that or they don't seem to be vocal about it. Well, now's your chance, there's a bug logged about it (thank you Tim) here:
http://bugs.adobe.com/jira/browse/FB-20121.

So if you've experienced this, vote for the bug to help get rid of it!

I Lied - Array Iteration Order

May 5, 2009, 10:33 am by senocular

Ok, I didn't necessarily "lie" per se, but I did leave out some vital information in one of my ActionScript 3.0 tips of the day, for..in and for each..in. There I claimed that ActionScript 3.0 "maintains array element order (using numeric array indices) when using for..in and for each..in". But does it?

Random Flex Rant - GUI Validation

May 1, 2009, 12:05 pm by senocular

Another thing that throws me off about Flex is the validation system for the GUI. Yes, I understand that you want to defer screen rendering until the end of the frame, but that shouldn't mean that property inspection is all over the place. If I set something, whether or not its updated visually, I should be able to get that value back when I check it immediately afterward.

ColorTransform's Effects on Gradients

April 28, 2009, 9:27 am by senocular

Here's something fun to try. Create two circles of the same size, next to each other in Flash. Give them both radial gradients from black to white - use the default in the color picker (and if you're clever enough, you ActionScripters out there can play along too).

My Copy of Pratique d'ActionScript 3

April 24, 2009, 10:03 am by senocular

Not too long ago, I received my copy of Pratique d'ActionScript 3 from Thibault Imbert. And while yes, it is in French, and yes, it is correct that I don't speak French (beaucoup), I am super excited to have it! And not only because I'm mentioned in the Remerciements and on page 463 ;), but because its just such a massive book that covers about everything in Flash Player 10. Great job Thibault!

Pratique d'ActionScript 3

Page: 1 2 3 >