Flash MX: The Things You Might Have Missed

Time for another “tell them as they come to me” thread :wink:

Here I’ll discuss many of the overlooked or unknown features of Flash which may make you say, “I wish I had known that before!” or maybe even, “hmmph!” or perhaps, “what a worthless feature!” …? Nonetheless, hopefully you will learn something new.

[size=3]- Timeline Preview[/size]
Very helpful in animating in flash, this feature allows you to see the visuals of your movie frame by frame in the timeline with previews for each frame.

This menu is hidden in the dropdown menu in the upper-right corner of the timeline. There are two versions, preview and preview in context. Preview will crop the frame stretching the visuals to the extent of the frame box in the timeline, while preview in context will maintain the proportions with respect to the size of the work area.

May not be so hidden to the animators out there, but the coders might not be aware of this and it could be useful to them as well

[size=3]- Shape Textures[/size]
Not too terribly unknown but always fascinating, especially to the novice user. This option allows you to, instead of a color, use a bitmap image as the fill of an object.

There are two ways to do this. One is through the color Mixer window where you have the option of bitmap in the dropdown of fill options (showing any imported images you have in the current movie), therefore allowing you to use a bitmap as a fill color (showing any bitmaps you may have in the library). The other is by placing the bitmap on the screen and breaking it apart with Modify > Break Apart or CTRL + B. This will convert time image into a shape the size of the image and give it the bitmap as a fill. Then you can either manipulate that shape or use the eedropper tool to get the bitmap into your fill bucket and fill that bitmap in any othe shape. The bitmap can then be rotated, positioned and scaled to your liking within that shape through the use of the Fill Transform Tool (F) just as you would a gradient.

Here you have a great avantage for small textures like bricks or stone which would go well in keeping filesize at a minimum in such examples like games where you may have a large bitmap driven room with alot of repeating textures.

[size=3]- Color Swatches From a GIF[/size]
Yup, just use the menu in the color swatches panel and choose Add Colors… and you have the option of selecting a GIF file. The color palette of that GIF is then loaded into your swatches panel.

This can be helpful in two ways. One is the obvious “oh look I can use colors directly out of my image” sort of thing letting you borrow from an image or just keep consistency with that image that you might be using in Flash. The other is that it lets you make visual representations of color swatches. In other words, with an image as your color swatch collection you can easily look at the preview (or the image directly) to tell exactly what colors are in the “collection.”

[size=3]- Prevent Enter from Stopping Your Movie on Playback[/size]
Often, when you playback your movie in Flash and you have some action within your movie that requires the user to press Enter in order for something to happen, in testing this you come into a confliction between Flash wanting to stop the movie and your action happening (Flash wins and stops the movie.)

To prevent this, after initiating your test movie, go to Control > Disable Keyboard Shortcuts and you wont have this problem.

[size=3]- The Shortcuts You May Want But Didnt Know[/size]
The Enter shortcut maybe annoying in those situations but other shortcuts can be great time savers. Chances you already know many of the main shortcuts in Flash, but what about the secretive ESC shortcuts for coding? “What?” you ask? Open the actions panel and using the [+] drop down, navigate to Actions and anyone of the subcateories. Look at the esc based shortcuts there - relating to the most common commands used in flash and only a few key strokes away!

[size=3]- Add Your Own Colored Keywords in Flash Actionscript[/size]
Most anyone whos created a decent component already knows this one, but it could be helpful for the casual coders out there as well. Basically, you have the ability to add keywords into Flash which become color coded when used in the actions panel. Control of this is done through an XML file flash reads when it starts um familiarizing it with the keywords it needs to know and colorize when you use them in actionscript. Theres actually many XML files involved - a whole folder (actually more than one but not to get too complicated here) in fact that Flash reads the XML files within, so really, for this, its better to make a new XML file of your own as not to mess with the other defaults.

Heres a simple example an XML file that would adding coloring to the ASBroadcaster object:


<customactions>
	<colorsyntax>
		<keyword text="ASBroadcaster"/>
	</colorsyntax>
</customactions>

This can be made in any text editor and then just saved as something like ASBroadcasterColoring.xml to have this colorizing file. Then, to let Flash see it and understand it place it in the following directory:

[Your Programs Directory] /Macromedia/Flash MX/First Run/ActionsPanel/CustomActions

Then, the next time Flash runs, it will read that XML file and incorporate the ASBroadcaster text into its color coding and highlight it blue (or whatever color you have set in your preferences) when written in the actions panel.

You can go beyond that with these XML files. Heres an example that does a little more completion with the ASBroadcaster object:


<customactions>
	<actionspanel>
		<folder name='Hidden' id='Hidden' tiptext='Hidden Features' version='6'>
			<folder name='ASBroadcaster' id='ASBroadcaster' tiptext='ASBroadcaster' version='6'>
				<folder	name='Methods'
					id='Methods'
					tiptext='ASBroadcaster Methods'
					version='6'>
					<string	name='initialize'
						tiptext='Initialize object to broadcast'
						text='.initialize(% Object %)'
						object='ASBroadcaster'
						version='6'/>
				</folder>
				<folder	name='Initiated Object Methods'
					id='ASBroadcasterObject'
					tiptext='Methods for ASBroadcaster Initiated Objects'
					version='6'>
					<string	name='addListener'
						tiptext='Add a listener to the object'
						text='.addListener(% Listener %)'
						object='ASBroadcasterObject'
						version='6'/>
					<string	name='removeListener'
						tiptext='Remove a listener from the object'
						text='.removeListener(% Listener %)'
						object='ASBroadcasterObject'
						version='6'/>
					<string	name='broadcastMessage'
						tiptext='Sends event to all listeners'
						text='.broadcastMessage(% event %)'
						object='ASBroadcasterObject'
						version='6'/>
				</folder>
				<folder	name='Initiated Object Properties'
					id='Properties'
					tiptext='Properties for ASBroadcaster Initiated Objects'
					version='6'>
					<string	name='_listeners'
						tiptext='Array of listeners for this object'
						text='._listeners'
						object='ASBroadcasterObject'
						version='6'/>
				</folder>
			</folder>
		</folder>
	</actionspanel>
	<colorsyntax>
		<keyword text="ASBroadcaster"/>
		<identifier text=".initialize" />
		<identifier text=".broadcastMessage"/>
	</colorsyntax>
	<codehints />
	  <typeinfo pattern="ASBroadcaster" object="ASBroadcaster"/>
	  <typeinfo pattern="*_bc" object="ASBroadcasterObject"/>
	</codehints>
</customactions>

Theres 3 parts to this. the actions panel defining the object, colorsysntax telling what to colorize and codehints specifying what objects get code hints =) Without getting into too much here, Ill just point out the actionspanel is the layout of the books in the actions panel in the actionscript window and defines the objects for the code hints. Colorsyntax colorizes, keyword for standalone keywords and indetifier for methods and properties etc., where codehints pops up a window for the typed pattern which references the actionspanel definition of the specified object. :slight_smile: Here I even added a _bc extension for if you name your broadcaster objects someName_bc, the code hints for an ASBroadcaster initialized object will open as Flash will think the object is just that.

[size=3]- Stick to Your Script[/size]
Its pretty common now for people to want to write almost all of their code in the first frame of the movie. At times some annoyances can come of this (asside from those of functionality) such as creating a new movieClip symbol in the work area and wanting to write script in the frame to go along with that symbol. If you have that symbol selected though, any script you write in the actions panel will be on that movieclip itself and not in the frame where you had desired.

You can prevent this annoyance by using the Pin option. This is hidden in an easily unoticed thumb tack icon in the upper left of the actions panel. While in your frame script, click on this icon to “pin” that script to the actions panel. Then, no matter what movieclip you select, that frame script will always be present in the actions window for you to edit without the worry of mistakenly putting script somewhere else.

[size=3]- Drag and Copy[/size]
To ease your copying woes (and not to replace your clipboard) you can use the ole drag-and-copy technique to make duplicates in Flash. For symbols on the screen and selections in the timeline, hold ALT and drag to make and move a copy of your selection. In the actions panel, for selected script, use CTRL and drag to copy the selected script. It can be a time saver.

[size=3]- The Movie Explorer[/size]
use it. its good. Window > Movie Explorer (Alt + F3)

[size=3]- Make your Own Flash Panels[/size]
Ever notice how that sitespring panel seems a little out of place? Well you can get rid of it if you want. You can even replace it. Better yet, keep it there and add a new panel of your own. Better yet still, add mine. Heres a completely useless panel you can have all for your own!

http://userpages.umbc.edu/~tmccau1/flash/kirupa/SenoFlex.zip
Update: Also see the panel attachment in a post near the bottom of the thread.

Whats that you say? Its just a swf? Yes, yes it is, where you place it is what counts. Put it in this directory:

[Your Programs Directory] /Macromedia/Flash MX/First Run/WindowSWF
(Note there is also a computer user directory - explanation in a lower post)

Restart Flash and reap the benefits of my incredibly flexible self by selecting the panel from the Window menu. That swf, btw, is an old one I did back in the day when learning Flash 5 :wink: Good times, good times.

Any swf file within that directory will be available as a Panel from the Window menu. If you want to ditch the Sitespring panel, just remove it from that directory. If you want your own panel, just make a swf and add it there!

[size=3]- Easy Includes[/size]
Similar to that mentioned above, there is also a default directory that Flash looks to for #include files other than the directory of the Flash movie itself. By default this folder doesnt exist but can be created in
Flash MX\Configuration
to be
Flash MX\Configuration\Include
.as (or .mx) files there can be easily included using
#include “filename.as”
without any folder referencing

[size=3]- Reduce FLA size[/size]
Director has and has had a save feature called “Save and Compact” which resaves the file your working on in a way that ditches any unneeded library references from deleted objects and things of the such. Flash doesnt have this option, though that operation simliar to the save and compact feature in Director is performed with Flash files when you File > Save As… to a new file. So should you need to squeeze out the extras of your FLA (good if you plan to upload it and share it on the web) do a save as first so that you can reduce the file size of a possibly bloated FLA.

Ill post more if/when I think of them

wow sen… those are great… i love the customization features :beam:

the link to the zip file doesnt work though…

[edit]

LMAO! :stuck_out_tongue:

what a great tool sen! provides so much funtionality :beam:

good one, but when you say [left], you mean [right]…

unless my version of flash is newer/older

thanks :wink:

Sen these are awesome! I knew some of them, but most of them I didn’t know. And that Pin/UnPin thing was something I sat here hoping Macromedia would do, and it turns out they had it all along!!! ARGH!!! I never noticed that little pin there!

Ok I have to ask: This custom flash panel thing is awesome and all, but what is it’s functionality? Is there anything useful you can do with it? Or is it just for funky flexable senoculars and things such as that?

Ill make one that gives -some- functionality. To be honest, Im not sure of its real capabilities (if there are any) other than just playing a swf in Flash. Im not familiar with any resources on it (nor have I looked), but I have used it for things like alarms and timers and text generators; you know, some little flash based utility that might be helpful while working in Flash. Again, there might be a greater purpose to that capability where those swfs have more control over things in Flash (?) I dont know, though that would be nice - i.e. something where you could make a swf with buttons to automatically select a fill color, a line color and a line thickness for you just by a single click. I doubt thats possible, but it’d be nice. Otherwise, like I said it could be for alarms, web links, text gens (like alternating html colors etc), or whatever.

Yeah that was exactly what I was thinkin Sen, it would be great for that kind of thing, so I was wondering if it could be used for that.

Alright, I have an idea, I think I am going to set up a .swf file with a drop down menu of some of the most useful prototypes for me that I use often and when you select one it writes out the prototype in a textfield :slight_smile: That would save me having to open another .fla file that uses it and/or having to retype it all out :beam:

*Originally posted by senocular *
Any swf file within that directory will be available as a Panel from the Window menu. If you want to ditch the Sitespring panel, just remove it from that directory. If you want your own panel, just make a swf and add it there!

Sen… HELP! When I delete the files from that directory I STILL get them in my Window menu in Flash. I close out Flash and re-opened, and even tried restarting my computer! How do I get rid of them? They still work perfectly even though I deleted the files!

For user based systems you have your default applications directory then you have a user applications directory too. This is something like

C:\Documents and Settings\senocular\Application Data\Macromedia\ …

or something along those lines (might be AppData) for the user senocular in XP. Flash actually looks in the macromedia set up there, copying anything which is in the default macro directory to that one and using its contents for preferences. So in that case, first remove the swf from the main directory, then find the directory in your user settings and remove it there as well. Now the AppData folder is hidden by default I think, so browse with hidden files visible to see it. You might want to put a shortcut in your main Macro folder to your personal config there to make it a little more easily accessible when messing with these things.

cool! We needed that .(.though I already knew 'em all, edit:except the palette from a file thingy)! :slight_smile:

as I said before, Id post a somewhat useful panel :wink:

Still basic at this point but running off what I mentioned before. Not everything is functional, like the arrow tool, but it gets the basics out there.

What is it you ask? Install it and find out :slight_smile: I packaged it as a mxp so just click and install, restart Flash and it should be there.

Update: new panel uploaded with the arrow tool working :wink:

v 1.3 :slight_smile:

First: Thanks for helping me fix that, the list was building high as I was experimenting…hehe.

Second: WOAH!!! That drawing API thing is INCREDIBLE!

*Originally posted by lostinbeta *
First: Thanks for helping me fix that, the list was building high as I was experimenting…hehe.

Yeah itd be nice if it was in a sub menu. As far as I know, you cant put them in one either

*Originally posted by lostinbeta *
**Second: WOAH!!! That drawing API thing is INCREDIBLE! **

Theres still some fixes to be made (I meant to include an endFill() but I forgot) and some ways it could be improved. I probably wont do much more with it, but its a decent example of what could be used as a panel :slight_smile:

…updated panel to 1.3

wow that drawing thing is awesome!

great tips here! thanks senocular!

thanks :slight_smile:

[size=3]- Double Color Select[/size]
Hold down shift when using the color picker tool and you can select both the fill and the line color colors at the same time. Using this method also wont convert the color picker to the paint pucket or the ink bottle tool after selection. This way you can hold shift to select the color of your alternative color (fill if you want to use line and line if you want to use fill) first, then pick the current color and have both done in one swift swoop.