Add an Action to a Button

 < Day Day Up > 



If you attach the same goto action to a button symbol, the code will vary slightly. The event (which is release in this example) specifies which type of user interaction will make the action occur. You can change the event by selecting the on (release) line of code and choosing a different event from the Event list as shown in Figure 28-5.

click to expand
Figure 28-5: The on (release) line of code selected and the Parameter area open showing the list of events

Usually with a button you want the click to take the user somewhere, such as to another page. There are two different options: you can go to another frame within the same movie or to a different HTML page outside of the Flash movie. You can access another frame of the movie by using the goto action. To use a hyperlink instead, you would use the getURL action, by following these steps:

  1. Select a button symbol.

  2. Open the Actions panel, open the Actions book, open the Browser/Network folder, and then double-click getURL.

  3. You see the following code:

    on (release) {     getURL (""); } 
  4. In the Parameters area, type the URL in the URL field. You see the address added to the syntax between the quotation marks as you type. If you want to use an expression to produce a value for the URL, click the box next to the URL file and enter your information.

  5. In the Window field, select the target for the URL to open into from the following choices:

    • _self — Targets the window and frame where the movie is currently playing

    • _blank — Targets a new browser window

    • _parent — Targets the current window, but replaces only the frameset where the movies is playing

    • _top — Targets the current window and replaces all framesets with the new URL

  6. In the Variables field, choose from the following:

    • Don't send — This is the default and best used when there is no transfer of data.

    • Send Using GET — Use when transferring a small amount of data such as a small form.

    • Send Using Post — Use when transferring larger amounts of data.



 < Day Day Up > 



Macromedia Studio MX Bible
Macromedia Studio MX Bible
ISBN: 0764525239
EAN: 2147483647
Year: 2003
Pages: 491

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net