Search Tutorials
Finishing Up The aim of frame 3 is to customize the function that duplicates and initializes your menu item templates. The general idea is to create a loop that will use the Duplicate Movie Clip command to create a menu item and the "Tell Target" command to set variables. The key to this whole procedure is using the eval() function to give each duplicated clip a unique, logical name. I encourage you to examine the scripts in the example file, which I have commented extensively, to understand how this abstract process works. But just so you can see it now here it is:
Comment: This loop duplicates a template movie clip
Comment: and prepares it based on the information set in "menudata.txt".
Set Variable: "item_spacing" = 30
Set Variable: "x" = 1
Loop While (x <= /:menu_count)
Duplicate Movie Clip ("menu_template", "item_" & x, x)
Begin Tell Target ("item_" & x)
Set Variable: "menu_text" = eval("/:menu_text_" & ../:x)
Set Variable: "menu_link" = eval("/:menu_link_" & ../:x)
Go to and Stop (eval("/:menu_state_" & ../:x))
Set Property ("", Y Position) = getProperty("", _y) + (..:item_spacing * (../:x - 1))
End Tell Target
Set Variable: "x" = x+1
End Loop
Stop
So there you go. This may sound quite confusing so please download the example. It will compliment this tutorial to provide you with a better understanding. Good luck and happy flashing.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|