First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: ::::: Daafy ::::: | Website: http://

Well well well...it's pretty nice to have a great menu system like this but...what about button function ??? Ok, let's see how to set an URL for each rub and/or subrubs...
Like others constants, we'll input each URL wanted for each rub and/or sub rub. If you don't input any constant for a rub or subrub ??? We'll see this part too.
Ok, like you've understood, open your constant keyframe (do I need to write witch one...? the first one...) and constants like that (in corresponding part for better edition) :

Set Variable: "URL_Rub1" = "http://www.montfort-sa.fr"
This is syntax for rubs, do this for all rub you want URL
Probably no URL if there are subrubs for this :-)
Set Variable: "URL_Rub2" = "http://www.adresse2.com"
Set Variable: "URL_Rub3" = "http://www.adresse3.com"

now the syntax for URL for subrubs :
Set Variable: "URL_Rub1_Subrub1" = "http://www.montfort-sa.fr"
Set Variable: "URL_Rub1_Subrub2" = "http://www.montfort-sa.fr"

Right now, always in the first keyframe you've note that we dupplicated our rubs (subrubs are dupplicated or remove in second one). So under the line that send the right label to each rubs, we'll insert the URL line :

	Set Property (n, Y Position) = YPosition
	Set Variable: n&":Label" = eval ("LabelRub"&n)
	Set Variable: n&":URL" = eval ("URL_Rub"&n)
End Loop

For the subrubs now, so in second keyframe :

          Set Property (TargetRub&"_"&z, Y Position) = YPosition
          Set Variable: TargetRub&"_"&z&":Label" = eval ("LabelRub"&n&"_Subrub"&z)
          Set Variable: TargetRub&"_"&z&":URL" = eval ("URL_Rub"&TargetRub&"_Subrub"&z)
End Loop
Our buttons (rubs & subrubs) need to have any "get URL" action to apply our vars...Set this action to your rub button and your sub rub button :
On (Release)
      Get URL (URL)
End On
Great, test it if you wish...remember : "Get URL" doesn't work in test mode so test it to update your swf file, then open it throught your window explorer. And normally, you'll be able to open explorator windows with corresponding URL... You can also note that if you didn't set any URL constants for some rubs, nothing appears...I mean it doesn't open window with "error 404" so all is ok :-)
» 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!


  • 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.