Dynamic CF 'n' Flash Menu - Tutorial

You should have the following files in order to view this tutorial:
  • cf_flash_dynamic.mdb - access database with links in
  • menu.fla - flash source file
  • menu.swf - flash movie
  • menu.htm - html file that pulls in movie
  • menu.cfm - coldfusion file that calls the database
  • this page!

  • Setting it all up:
    Before this example will work, you will need to install the cf_flash_dynamic.mdb as a DNS with the name "cf_flash_dynamic"

    See: FLASH MENU
    Now, read about the "stuff" behind the scenes....

    menu.cfm
    If you view the menu.cfm page alone, you can see that it pulls in the menu items in a simple format (click back on the browser to get back here)

    If you look at the code it is very simple - the <cfsetting enablecfoutputonly="yes"> removes all output except the query output - removing white space from the file.

    The output is looped within an if - else statement that calls a param "count" into play - param is set after the query as "0" - then the loop goes through the output, after the first run count is reset to 1, thus moving all other runs into the "else" statement. The reason behind this logic is that if you output one line of code with the flash as variable "menuttext=" at the front then after the first "item" every other item is listed with menutextNameOfItem, menutextNameOfItem, etc in front of it.

    menu.htm
    This page is simply an exported (published) flash page that has been formatted to fit in with the style of this tutorial

    menu.swf
    The "published" flash movie that does the funky stuff

    menu.fla
    The Flash source file has been built on many layers - in order to "break-down" how it was built for learners:
  • action script- the actionscript that "pulls" in the menu.cfm file - double click on the "a" to load the SHOW ACTIONS window and see the code
  • scroll script- Two "hidden" scripts that define the scroll actions, these are linked to the nav buttons actionscripts due to movies that they play - also, to set the parameters on each movie - open the LIBRARY window, look in the movies sub folder and right click on a movie to choose "define movie parameters".
  • nav buttons- sets the two nav buttons - view the actionscripts for these with the SHOW ACTIONS window, under object actions - remember to view the "movies" for these buttons as described above.
  • scroll_text- sets the text area that the menu.cfm file is pulled into - note the TEXT OPTION window, text options variable for this text box is entitled: "menutext" - this is the variable that is used in the menu.cfm page (menutext="
  • menu frame- sets the "menu" image at the top of the movie
  • text area- sets the light blue text area of the menu, sit underneath the "menu frame"

  • Legal Stuff
    The basic code for the above flash menu has been "borrowed" from other tutorials and the flash actionscript reference guide that came with your software - the cfm code an original variation on basic cfm text tutorials - please feel free to use any or all the above work in your "play" - we are currently working on adding "images" to the links and when that is done a new tutorial will be sent - any comments please contact us at flashcfm@thoughtbubble.net