Archive for July, 2006

“Ace” Up My Sleeve

Monday, July 31st, 2006
General

Woo-hoo!  I’ve been accepted to the Adobe Community Experts program!  :-D   When I got the news the other day, this made my whole afternoon.  Heck, it made my week (heck, it made …).  See, working from home, for all its benefits, does put me at a disadvantage in the way of colleague interaction.  It’s for this reason I’m grateful to be a Community MX partner, as my involvement has brought me in contact with numerous other experts in the field.  This Adobe program increases this sort of opportunity all the more.  (My family, somehow, doesn’t nearly enjoy discussing Flash and HTML as much as I do. ;) )

Thank you!

Toggling Case in MS Word

Saturday, July 29th, 2006
Quick Tips

I’m a fan of keyboard shortcuts.  Not a raving fan — I certainly don’t know ’em all ;) — but a fairly large number of shortcuts have engrained themselves deeply in my brain, and I happily use them without giving the action a second thought.  One of these shortcuts toggles case in MS Word; that is, it changes “something like this” to “Something Like This” to “SOMETHING LIKE THIS” very quickly, without any retyping.  Position the cursor in a word — or highlight a series of words, even paragraphs — and press Shift+F3.  It’s a good one.

(Perhaps) Unexpected Point of View:  SWF Defers to HTML

Friday, July 28th, 2006
ActionScript 2.0 Flash

Ever aiming for a small SWF footprint, I often load external assets at runtime.  This includes FLVs, MP3s, XML, sometimes CSS, and frequently images (which even includes PNG — woo hoo! — since the release of Flash Player 8).  As often as not, I use a relative path to specify the location of an asset.  This means the resolution of that path depends on its position in relation to the SWF itself.  For example, with something like  mc.loadMovie("external.jpg");, it only makes sense that the SWF with this ActionScript must reside in the same folder as the JPG it loads.  Why?  Because no absolute path to the JPG is provided — how would the SWF possibly know where else to look, other than its own folder?

If the SWF was in one folder and the JPG in another, you’d have to provide a path to that location.  For example, if the SWF was inside a folder named swf and the JPG was inside a subfolder of the first — say, swf/images — you would have to specify mc.loadMovie("images/external.jpg");.  The SWF would interpret that as, “Okay, start from where I am; now, look for a folder named ‘images,’ then look for external.jpg.”  If the images folder was side-by-side with the swf folder, the relative path would instead be mc.loadMovie("../images/external.jpg");; that is, “Ah, back up one folder [that’s what the .. means], then look for a folder named ‘images,” then look for external.jpg.”  All of this should be pretty straightforward, and it always works when the HTML document is also in the same folder as the SWF.  But there’s the rub:  what happens if it isn’t?  Keep reading »

TextFormat.getTextExtent() is All Right in My Book

Friday, July 28th, 2006
ActionScript 2.0

As of this writing, the Flash 8 ActionScript 2.0 Language Reference incorrectly states that the TextFormat.getTextExtent() method is deprecated.  It makes this gaffe twice:  in the method entry itself and in a separate “Deprecated Function summary” listing.  This occurs in both the onboard Help and the LiveDocs version.  Keep reading »

How to Convert Milliseconds to Minutes and Seconds

Tuesday, July 25th, 2006
ActionScript 2.0 Flash

Someone recently asked in the Adobe Flash ActionScript forum how to convert milliseconds into the minutes-and-seconds format mm:ss.  This person wanted to format the value returned by Sound.duration in order to populate a dynamic text field to indicate the progression of a song — certainly a reasonable endeavor.  I also think it’s a fun way to demonstrate how to “roll your own” in cases where ActionScript lacks native support for whatever you’re hoping to achieve.  I’ll recount here what I posted in reply.  Keep reading »

Lesser Known Operators:  Modulo (%)

Saturday, July 22nd, 2006
ActionScript 2.0

Modulo is one of the multiplicative operators, a category whose members take two operands and perform a multiplication, division, or modulo operation on them.  Obviously, in this case the operation performed is modulo, so let’s take a look at what that means, especially since this operation can be useful in a number of unexpected ways.  Keep reading »

Lost, and Not Lost, in Translation

Thursday, July 20th, 2006
Meridian

I made a quick stop at Farm Fresh yesterday to pick up milk, cereal, and a couple cases of soft drinks.  I had Meridian with me, partly because I love simply being with her and partly because the trip was a good diversion before her bed time.  As I was leaving, Dawn added a few items to my list, so I made a mental note and had all the more fun talking Meridian through the process of finding our goods.

She stood at the head of our shopping cart, facing in and holding tight (she’s just tall enough that her eyes peer over the edge) — a cute round head with all those corkscrew curls and a grin.  Typical scene:  stop at the produce section and she’d hop off, run to retrieve a tomato, oh-so-carefully cradle the fruit in her arms on the way back, then violently dump it into the cart … all while I stood looking on, uselessly holding an open plastic bag, shaking my head, smiling.

But I’m waxing idyllic, which isn’t even the point.  Post checkout is where the head-scratching began.  Keep reading »

How to Position Flash beneath Other Content

Tuesday, July 18th, 2006
Flash Web Development

By default, Active Content is written directly to the screen, which means it appears on top of other HTML content, regardless of its z-index stacking order, as defined by CSS.  This includes Flash, QuickTime, Windows Media, Java applets, and basically any other file that requires a plug-in in order to be displayed in a browser. 

One of the most popular questions in regard to this issue is some variation on the following:  “Flash is showing through my drop-down navigation!  How can I keep this from happening?”  The answer is provided on Adobe’s website in TechNote #15523.  This TechNote has been available since December 2002, when it was written under the auspices of Macromedia.  Unfortunately, it has been factually incorrect from the very beginning — not fatally flawed, but certainly misleading.

Update!  Adobe revised this TechNote!  Not sure when, exactly, but obviously some time between the original date of this blog entry (07/18/2006) and today (11/29/2006).  Keep reading »

Is Strong Typing Possible with the _global Object?

Sunday, July 16th, 2006
ActionScript 2.0

I recently answered an Adobe forum post in which someone was curious about the _global object in conjunction with strong typing.  This person had read a best practices document and wanted to use the post colon syntax introduced with ActionScript 2.0 — :Number, :String, :Object, and the like — but couldn’t figure how to use these suffixes with properties of the _global object (that is, with what people often call “global variables”).

The following, for example, works fine:

_global.myName = "Stilloneous";

… but the compiler generates an error when strong typing is attempted …

_global.myName:String = "Stilloneous";

So what gives?  Is this not possible?  Keep reading »

I’ve Been Flicked!

Tuesday, July 11th, 2006
General

Ha, this had me rolling when I first saw it.  Cartoonist Chris Flick, a colleague over at Community MX, generally introduces new partners with a comic strip.  He happened to choose a hip-hop theme to familiarize subscribers with me (the comic and plenty of other content is free).  This is especially funny, in a completely coincidental way, because of a co-worker I knew from two jobs back.  He had this incredibly precise beard that would have made even Prince (the artist formerly known as “the artist formerly known as …”) envious.  This co-worker’s name was (is) Hector, and because of his facial object d’art, we called him Hector the Vector Connector, and would spout off many a mini freestyle rap about his superfly whiskers.  Those were good times.  His laughing reply was usually, “To dis the Stilloneous would be erroneous!”