First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: ::::: Daafy ::::: | Website: http://

Right, like most of people, you probably use html frames with "menu" and "main" for example. After the second version of "Dynamic Menu", I've note that lot of people has problems...maybe it wasn't enought clear...More, with time you'll realize that each time you look at your own script, you can make it better. That was the case for this. For example I know that, in general, a menu links a page most of the time in the same frame. There's only for special case, you need different frame target. So we'll create a new constant called "UsualFrameTarget". This for NOT input all frame target to each rubs & subrubs !!! If we don't set any target frame for a button, that is this var that will be used. wahhhhh, what a time won ! So, INPUT FRAME TARGET CONSTANTS ONLY FOR BUTTONS HAVING A DIFFERENT FRAME TARGET THAN "USUAL" ONE.

With your global constants

Set Variable: "UsualFrameTarget" = "main"

Then for buttons needing different frame target :
...
Set Variable: "LabelRub1" = "I"
Set Variable: "URL_Rub1" = "http://www.montfort-sa.fr"
Set Variable: "FrameTarget_Rub1" = "_blank"
...
or for subrubs needing & gnagnagna...
...
Set Variable: "LabelRub1_Subrub1" = "Subrub1"
Set Variable: "URL_Rub1_Subrub1" = "http://www.arnet.fr"
Set Variable: "FrameTarget_Rub1_Subrub1" = "_blank"
...
Now we send to each rub (always in first keyframe) its corresponding frame target IF THERE IS !
...
      Set Variable: n&":URL" = eval ("URL_Rub"&n)
      If (eval ("FrameTarget_Rub"&n) eq "")
            Set Variable: n&":FrameTarget" = UsualFrameTarget
      Else
            Set Variable: n&":FrameTarget" = eval ("FrameTarget_Rub"&n)
      End If
End Loop
...
For subrubs : in second keyframe...
...
     Set Variable: TargetRub&"_"&z&":Label" = eval ("LabelRub"&n&"_Subrub"&z)
     Set Variable: TargetRub&"_"&z&":URL" = eval ("URL_Rub"&TargetRub&"_Subrub"&z)
     If (eval ("FrameTarget_Rub"&TargetRub&"_Subrub"&z) eq "")
           Set Variable: TargetRub&"_"&z&":FrameTarget" = UsualFrameTarget
     Else
           Set Variable: TargetRub&"_"&z&":FrameTarget" = eval ("FrameTarget_Rub"&TargetRub&"_Subrub"&z)
     End If
End Loop
...
We set "Get URL" actions to our couple of buttons, so let fill the frame target...
On (Release)
      Get URL (URL, window=FrameTarget)
End On

Yeaaaaaah, you've done it ! Congratulations, I hope that, more than the menu concept, you've learned some scripting syntax and method ;-)

Ok, if this tutorial learn to you things really, don't forget to rate this cauz it take only 10 secs. As contrary, you have to know that each guy making tutorials do it for free and they spend lot of time for this ! It's the less of thing you could do...work hard.

:::: Daafy ::::

» Level Intermediate

Added: 2001-01-08
Rating: 7.99 Votes: 1292
(10 being the highest)
» Author
Daafy works with Flash since 2 years but began to script (never scripted before) since few months with Flash 4. Like you, he began by downloading sources with some white nights, coffee & other...
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.