FLASH 8 and CS3 | Alejandra Jarabo |
Media Arts & Technologies division. Santa Barbara City College |
INTERACTIVE MAP USING DOT SYNTAX |
DOT SYNTAX STRUCTURE | ||||||||||||
Dot Syntax is a formatting convention to create quick and efficient phrases that refer to buttons, movie clips and other objects. The “dot” • is used to indicate the properties or methods related to an object (there is no space in between the elements and the dot) |
||||||||||||
DOT SYNTAX STRUCTURE APPLIED TO A MOVIECLIP | ||||||||||||
Once we had named our movieclip on Stage "ball_mc", we could create an action attached to a frame (in the ACTIONS layer) asking this movieclip to Stop. It will be written like this:
|
||||||||||||
DOT SYNTAX STRUCTURE APPLIED TO A BUTTON | ||||||||||||
Once we had named our button on Stage "spain_btn", we could create an action attached to a frame (in the ACTIONS layer) asking the button to move the timeline to frame 20 and Stop, when somebody clicks the button. It will be written like this:
Remember that to have this code working you need to: 1. Name the button's instance "spain_btn" through the Properties panel. 2. Make a keyframe in the ACTIONS layer, write a Stop action and then this code (let's say, on frame 1). 3. Have the button actually on that frame present on Stage (on frame 1). |
||||||||||||
Notice the difference in the code itself when you attach the code to the button itself or when you write the action on a keyframe in the ACTIONS layer (calling the button from a frame-action).
|
||||||||||||
BUILDING AN INTERACTIVE MAP | ||||||||||||
To Build our Interactive map, we will have to create a basic interface, with all buttons ready to be pressed. The interface will be generally built on frame 1, or wherever you want to place the Stop action that allows the user to choose. CREATING TRANSPARENT BUTTONS If the artwork for the map cannot be separated (you are working with a bitmap graphic containing the map artwork) you might want to create "transparent buttons", BUTTONS WITH REMOTE ROLLOVERS A remote rollover is an html concept, applied to a situation where the artwork for the rollover is not placed on the same location than the artwork for the hot-spot over the page. It is very easy to create something of this type in a Flash-button, all you have to do is place the artwork for the rollover Stage in a different area than the artwork for the up stage of the button. Notice that placing content on rollover is an opportunity to give some information, not just a fancy-looking feature. CONTENT LAYER In a good interactive map the main interface never disappears, so your options for clicking and coming back to another section remain always open. For this reason, the content that appears when you click the button, should be placed only on a certain part of the Stage. |
||||||||||||
THE SCRIPT: CALLING A BUTTON FROM A FRAME_ACTION | ||||||||||||
Since we are going to write the Action Script for your buttons, inside a frame-action, all the scripting for the buttons will be placed in one location. Classical programmers love this way of structuring the file; this way they don't need to find the buttons and select them one by one to find the code. We will use Frame-labels instead of frame numbers in the code: Remember that the frame-label needs to spelled exactly the same in the label (through the Properties panel) than in the code. |
||||||||||||
Example of Dot syntax in the Actions Panel. Notice the selected Keyframe in the 'ACTIONS' layer. |
||||||||||||
|
||||||||||||
|
||||||||||||