Flash+Help

=Flash Help= toc

FACS 2930 Flash Notes
[|This site] has tutorials on some key flash interactions (ie. dragging movie clips, changing movie clip properties on button press, invisible buttons, dynamic pointer mask, making your own mouse pointer, mouse tracking, letting the user draw on ur swf, etc.) Credit goes to Nadine Wettlaufer. Has **.fla file included** for each example!

Rollover Effect
create a button (see below) set the 'over' state to a distinct image as the 'up' state

Creating Buttons
comand - F8 or Insert > New Symbol brings up the dialog window to create a new symbol, choose button.

Creating a Slider Timeline (Using Action Script)
If you have a lot of numbers to deal with, save some time and try getting things to work using action script. This is not really a tutorial in a sense that there's no set Step #1, #2, etc. It's more of an example. Download [|.fla file]
 * History timeline that allows you to drag and display the year (+ necessary changes) as you drag along.
 * The animation aspect (in this case, the speech bubble) is embedded within the movie clip, and not the main timeline.

**Rollover buttons:**
code red_btn.onRollover= function{ _root.red_btn.gotoAndstop(2) }
 * give mc (movie clip) symbols unique names or instances (red_btn) when brought into timeline or onto the stage. For example: red_btn
 * we can attach or adjust a property to any object. e.g alpha. _root.red_btn._alpha = 50;
 * define an input action: activate on Rollover:

red_btn.onRollout= function{ _root.red_btn.gotoAndstop(1) } code

**Dragging movie clips:**
instance name: garbage_mc //In actions layer:// code garbage_mc.onPress = function { garbage_mc.startDrag; }

garbage_mc.onRelease = function { garbage_mc.stopDrag; } code

code garbage_mc.onPress = function { garbage_mc.startDrag; } code //in actions layer timeline:// code position1=garbage_mc._x; position2=garbage_mc._y; code
 * Tell object to go back to position it was in:**

code this function allows the trash to be draggable garbage_mc.onPress = function { garbage_mc.startDrag; }
 * Tell object to disappear when placed over trash can:**
 * write a conditional statement. If the garbage is over the can make it disappear.
 * The two slashes, //allow you to comment on what the action script is doing.//

garbage_mc.onRelease = function { garbage_mc.stopDrag; }

code

//this is a condition to check if the trash is in the bin// code //garbage_mc.onRelease=function{ if (garbage_mc.hitTest(container_mc)){ garbage_mc._visible=false; } else{ garbage_mc._x=position1; garbage_mc._y=position1; } }// code

In main timeline at the last frame in actions layer write: code // this loops between frames 5 and 10; so initial position is not reset. gotoAndPlay(5); code

=Embedding Flash Into HTML=

Here is the code to add your flash file into your website:

 //  //

The size can be modified by changing the number values in width and height. You can also find more information [|here].

Source: **//Visual Quickstart Guide: HTML, XHTML & CSS, Sixth Ed.//** by Elizabeth Castro