Create a 3 State Flash Button      
In FLASH
CS using ACTION SCRIPT 3

Flash buttons are a nice addition to an interactive web page.
They are simple to produce for designers with Flash experience but some new terms must be mastered.
As well a little familiarity with Action Scripts (we will use the normal mode).

******* OPEN A NEW FILE IN ACTION SCRIPT 3 *******
not Action Script 2!

The trick is you must create at least 2 layers and one of them must be an ActionsXXX layer
You must then insert and modify Action Script 3 in to the Actions window

Play with this test button for a while
Have you noticed that there are 3 states that the button reacts to?
UP OVER DOWN
The mouse is not over the button (up)
The button is red
The mouse is over the button and the button turns green You click on the button and it turns yellow and then hyperlinks to another URL
To Create the Hyper Link feature an action script must be defined and generated for the button.
Once the button is made you can select the button and add the Action Script > Browser/Network > getURL
Remember to use the Normal Mode in Action scripts NOT the Expert mode

Procedure - design and produce three buttons that are different in some respect from each other (except size) and save them for web ( the above buttons are 125 x 50 pixels)

File > Import to Library all images (so that you can use them)

Size the stage to the size of your buttons (here we are using 125p x 50p)

Drop the up button onto the stage first

Use Control /Alt --- 7- 9 to position button on stage

Right click and Convert to Button

 



Double clicked button to go to the Inter Tween
(notice now you have 4 frames called UP - OVER - DOWN - HIT)


- IGNORE HIT - most people do.
- its an area that defines where the actions take place we want it to be the button so its not neededI
> Create a keyframe in the OVER frame and place the OVER button on the stage

> Create another keyframe in the DOWN frame and add the DOWN button

So you should have 3 jey frames now UP --- OVER --- DOWN

 

Click on the blue arrow by the paint bucket and you will return from the intertween
back to the main screen and you will see the up button

Now create a new layer and label it ACTION-b1 or what ever you called the instance

Window > Actions - copy AND paste the following Action Script 3 code into the Actions Window and change the name of the instance that it controls AND the URL that you want to go to

Action Script Code = URLrequest (please edit to your needs) copy/paste

b1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);  
function mouseDownHandler(event:MouseEvent):void
{navigateToURL(new URLRequest("http://www.michaelsharris.com/")); }

 

Remember to Save As ( this will generate a .fla file ) to perhaps your Flash web folder

Now>  Publish Preview > Flash (this will create a .swf file) and your button should exhibit 3 states and when the down action is released you should be transported to your hyperlink destination!

In Dream Weaver --- Insert > media > flash (the .swf button file into your Dreamweaver production)

- remember to save and upload your HTML file and your .SWF button file

- remember that the .FLA file will not work in DW or on the Web

also

YOU DO NOT NEED TO CREATE BUTTON IMAGES IN PHOTOSHOP (MOST CREATIVE WAY)

YOU CAN CREATE THEM IN FLASH WITH THE DRAW/PENCIL/RECTANGLE/ELLIPTICAL TOOLS

 

 

Really Want to Create a Flash Website??