Archive for the 'Quick Tips' Category

Maintain Your Sanity with IndieVolume!

Monday, May 10th, 2010
Flash Quick Tips

Do you ever find yourself wishing you could temporarily mute the audio in a FLA while working on it?  It’s easy enough, of course.  I’m not sure how it works on a Mac (surely just as easily), but on Windows, you simply mute the volume control in the system tray.

Ah, but there’s the rub!  On Windows—XP at least, which is what I’m using—that’s an all-or-nothing “solution.”  The trouble is, I like to listen to music while I work, and most of the time that means playing audio files directly on my computer.  If my system is muted, it’s muted.

For years, I’ve simply been dealing with this, but I finally had enough.  Just last week, I started searching online for ways to selectively mute individual applications on WinXP.  For my money, IndieVolume wins, hands down.  Not only can I mute Flash—which temporarily silences both my FLAs and SWFs—I can also selectively mute, say, Safari or Firefox, which lets me enjoy the same benefit when testing in a browser.

Even better, I can leave my apps audible, but adjust their volumes individually (panning, too), which means I can keep my Flash content quiet while leaving my audio player and other system alerts/sounds going strong.

If you’re interested, try giving IndieVolume a shot!  The developer offers a free trial period, and you even get a discount for endorsing the product on your blog.  I’ve been spreading the word anyway, because this app is one of those cases of “it’s the little things that count.”  I’m truly a happier coder for the quiet.  :)

Free 3rd Party Tools to Make Your Life Easier in Flash (and Elsewhere)

Tuesday, August 21st, 2007
Quick Tips

Here’s the second of my Notes on Design guest blog entries. to-make-your-life-easier-in-flash-and-elsewhere/

How to Round to the Nearest Ten, Tenth, Hundred, Hundredth, Etc.

Friday, April 6th, 2007
ActionScript 2.0 Quick Tips

I was helping a friend the other day with a rounding issue.  He needed to round numbers not to the nearest integer, but to the nearest hundred.  So 52.3 would round to 100.  86 would round to 100 as well.  13 would round to 0 and 101.287 would round to 100.  You get the idea.  The Math.round() method doesn’t take any parameters except the to-be-rounded value itself, so how could this be accomplished?  The answer couldn’t be simpler.  Keep reading »

The VideoPlayer Class API (aka, the Missing Manual)

Tuesday, February 27th, 2007
ActionScript 2.0 Quick Tips

I was just gabbing with someone about the NetStream class, which nudged my mind toward the VideoPlayer class.  According to the Components Language Reference, the FLVPlayback class “extends the MovieClip class and wraps a VideoPlayer object.”  As it turns out, the VideoPlayer class is mentioned in the Components Langauge Reference, but if you dig into it, you’ll quickly discover that none of the class members is hyperlinked.  In other words, you’ll get an overview of the properties, methods, and events defined by that class, but no actual explanation.

I find that an odd omission — but Adobe does make the full API available.  Keep reading »

Code Hinting Regardless of Naming Conventions

Wednesday, February 21st, 2007
ActionScript 2.0 Quick Tips

Depending on my mood, I may precede certain variable names with a small prefix that describes the type of object they point to.  For example, I may give a movie clip the instance name mcBall, rather than just ball.  Why?  Well, it allows me to see at a glance that I’m dealing with a MovieClip instance, which can come in handy during coding and also while I’m poking through the Debugger panel.  It doesn’t have any measurable effect on the functionality of the variable … it’s just one of those things you get used to.  I certainly don’t always adhere to this convention, but when I do, I’m practicing something called Hungarian notation, which has a decent pedigree (at least, in computer years).

Flash provides at least one naming convention that actually can make a practical difference, if you follow the suggested suffixes in the “About using suffixes to trigger code hints” section of Learning ActionScript 2.0 in Flash.  I’m not especially a fan stylistically, but, for example, if I name that ball clip ball_mc, I’ll get automatic code hinting for the MovieClip class (and so will you) in ActionScript 1.0 and 2.0.  A full list of suffixes is listed in that section.  Code hinting is definitely a useful tool, because I’m not always familiar with the class members of the object at hand.

What if you don’t like suffixes?  Or prefixes, for that matter?  Well, if you use AS2’s strong typing syntax (the :Number in something like var total:Number = 5;), it doesn’t matter what you name your variable:  you’ll get code hinting if you want it (see File > Preferences > ActionScript).  That’s fine for everything but movie clip instance names, which aren’t necessarily declared as variables.  But … see, if you declare instance names anyway — even though you don’t need to — you get the benefit of code hinting regardless of the instance name.

With a simple line like this …

var ball:MovieClip;

… even though you haven’t set that instance to anything, you’ll get MovieClip-centric code hints for subsequent references to that instance name in your code.

Easy as “Pi” Conversion between Degrees and Radians

Saturday, December 9th, 2006
Quick Tips

When working through trig functions in articles such as “How to Constrain Dragging to a Circle,” I often find myself having to convert degrees into radians and vice versa.  The formulas are truly simple … but they’re so similar, I often confuse them.  For the record:

radians = degrees * (pi / 180)
degrees = radians * (180 / pi)

However, in a pinch, just use Google.  Type, for example, “90 degrees in radians” (without quotes) into the search field and bingo! instant conversion.

How to Save a Folder’s Contents to a Text File

Thursday, September 7th, 2006
Quick Tips

I just finished a Flash movie that loads PNGs from a particular site folder.  In this case, the list of desired files is determined by an Array instance.  There are fifty-three files in this folder, and I didn’t relish typing out the names of each file by hand.  Old DOS trick to the rescue!  Keep reading »

Need Filler Text?

Tuesday, August 1st, 2006
Quick Tips

It makes no difference if you’re laying out HTML, a word processing document, or even an image with lots of text.  If you need filler content, just so you can visualize the layout, give Lorem Ipsum a shot.  I use this site all the time.  It’s free.

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.

Shoo, Flies, Don’t Bother Me!

Monday, July 3rd, 2006
Quick Tips

This is a Quick Tip, but it’s not related to Flash or any other software.  Has nothing to do with computers, in fact.  This is about how to catch fruit flies — whole bunches of ’em, with barely any effort.  Keep reading »