Friday, November 10, 2006

Optimising for Beginners - Part 3

In Part 2 of this article I demonstrated how to save a step as a command so you can repeat that action just by selecting it from the Commands menu.

Commands aren't limited to just one step though.. you can save several steps as a command. For example, I have a 'Centre Stage' command saved for centering my fade-to-black graphic symbol. Here's how that command is done.
  1. Place a piece of artwork (symbol, or raw artwork - doesn't matter) on the stage and open the Align panel (Win: Ctrl K)
  2. First make sure the artwork on the stage is selected
  3. In the align panel toggle the 'To Stage' button ON
  4. Now click the Align Vertical Center button
  5. and the Align Horizontal Center button


Your artwork should now be in the centre of the stage (if it's made up of lots of little pieces, they're all clustered together in the centre) and with the above steps completed, those steps will be in the History panel (Window > Other Panels > History).

Hold down shift and select the two 'align' steps, then click the Save icon:



Give your new command the name Centre Stage and click OK. It's now in your commands menu.

My 'fade-to-black' symbol (a black rectangle the exact size of the stage) can now be dragged from the Library and dropped on the Stage. I can then go Commands > Centre Stage and it's dead-centre, ready to apply a fade tween.

Getting familiar with Commands and the History panel is the starting point for you to learn JSFL too: the language with which you create your own Flash extensions. An earlier article covered the work and links to some of the community's JSFL gurus, like Dave Logan and Warren Fuller.

- - -

Setting Keyboard Shortcuts

Any menu item in Flash can have a keyboard shortcut allocated.. some of us (*raises hand*) would be lost without them. In fact, I have a difficult time finding some Flash menu items because I rarely go through the menus and most of my workflow involves keyboard shortcuts.

Now that your commands are menu items, you can assign key presses to run those steps.
Go to Edit > Keyboard Shortcuts. First thing you need to do is press the Duplicate Set button (circled) because you can't overwrite the 'Macromedia Standard' set.


Give your personal set a name and click OK. Now you're free to create your own keyboard shortcuts. This is how:

  1. Find the Commands menu in the list, and click the little (+) to expand the menu.
  2. There you'll see your saved Commands, so select one of them.
  3. Now click the 'Add Shortcut' button below:



    You'll be prompted to press the keys that you want for the shortcut. I find the Numpad keys are really useful for my most frequently used shortcuts. Numpad 5 is my 'Centre Stage' key. Another of my favourites is the tilde (~) key, just above the Tab key. It's my 'Optimise 8' shortcut key.
  4. Once you've entered the desired shortcut for your command, click the 'Change' button


Note: If you try assigning a shortcut that already exists, you'll get plenty of warning.

Click OK to get out of the Keyboard Shortcuts box now and if you look in the Commands menu, you should see your commands and their shortcuts in there.

Here are my optimise commands and their shortcuts in the Commands menu:



'Opt 1' is the least amount of optimising possible, with the slider at 1. 'Opt08' is the one I use most, so I've got a one-key shortcut for that. The last two commands are named with a '+' because they had 'Use Multiple Passes' checked.. so they're the most powerful optimising commands.

-- - --

A Note on a Flash bug

There's a known issue in Flash that causes keyboard shortcuts to 'slip' in the commands menu, so that they activate the wrong commands. If this ever happens to you, the workaround is simple:
  • Open the Keyboard Shortcuts window again, then click OK. Your Commands should now have their shortcuts in place.
--- ---

So there you go! If you've been following along throughout this 3-part article, you will have learned how to optimise graphics, save commands using the History panel and set keyboard shortcuts for them.

WEEEEEE! etc..

3 Comments:

Jean-Rene said...

That's a damn good tip. I'll be sure to use this.

There's something that I'd like to know though. I'd like to know what your workflow's like. Cuz everytime I start a project, I find myself being confused as to what to do next. So hell, if you could give an example, that could probably lead me towards the right direction :)

Only a suggestion though :)

1:52 AM  
chluaid said...

my workflow huh? OK I'll put it on the list for a future article :)

Cheers!

2:26 AM  
gabriel valles said...

Thanks, This was really helpfull, especially how to set up commands.

Another method that I use to optimize drawings in Flash is to Map the Smooth tool to "Ctrl W". If you hold down on "Ctrl W" you can actually watch the lines smoothing out. This help you not smooth your lines out too much.

6:40 AM  

Post a Comment

Links to this post:

Create a Link

<< Home