Using ActionScript to Configure

  1. Create graphic icons for the iconbarMenu. See Creating Icons for tips on how to create icons for use with this component.
  2. Make sure all icons for the iconbarMenu are movie clip symbols and have been exported from the library with unique identifiers. These icons will be attached at run time.
  3. Drag the iconbarMenu component from the Components panel onto the stage and then delete it. This places it in your movie's library.
  4. In the frame in your movie where you wish the iconbarMenu instance to appear, add the code:

    this.attachMovie("iconbarMenu", "iBar", 0);
    icons = ["icon1", "icon2", "icon3", "icon4"]; // change values to match exported icon identifiers
    iBar.setIcons(icons);
    iBar.setClickHandler("iconClicked");
    iBar.refresh();

    For additional parameters you may set to control the iconbarMenu at runtime, see The iconbarMenu API.

    Important *

    Make sure to call refresh() after you have set the components parameters through the code API in order to have the iconbarMenu instance update.
  5. On the same timeline as the code above (possibly the same frame, although this is not necessary), create the function named in the previous step's setClickHandler() call. This function will receive a single argument, which will be the data value from the icon clicked, or the identifier for the icon if no data value was entered.


  6. function iconClicked(i, num) {
      getURL(i, "_blank"); // opens a new window based on the icon clicked
    }
  7. Publish your movie.