Skip to main content
Participant
January 7, 2009
Answered

Help with getting buttons to request URL

  • January 7, 2009
  • 1 reply
  • 359 views
Greetings!

Can someone take a look at the following code and tell me what is wrong/missing or what the code should be? The buttons are not clickable and need to be. Please see test page here: http://www.mishgallery.com/salonbordello/index.html

Thanks in advance!
This topic has been closed for replies.
Correct answer Mish_linuxchik
Ah! Hello again Ned. Im not sure if you remember this, but I purchased this menu.fla and I do not know AS3. You however seem to be a real AS3 wizard of sorts. I found the following in the adobe help section in regards to Event-handling: Clicking a button to navigate to a URL. In this case, linkButton is the instance name of the button: ( code attached below )

ok! I see what you are saying. But how do I get this (code attached) to work with the if else statement for the addChild(butn). Can you please look at the code about butn.x = getChildByName. It looks to me like the code was designed to add child buttons and link them via the event.target.num == x.
So once or if I remove the event.target how will each child link?

1 reply

Ned Murphy
Legend
January 7, 2009
The event.target of your butn's is the hit element, but you appear to be trying to get the butn's num value in the CLICK handler, which isn't a property of the hit element.

I'm not sure of the design, but you may not need the hit element if it is covering the entire butn. You could assign your listeners to the butn and then target it directly in the functions.
Mish_linuxchikAuthorCorrect answer
Participant
January 7, 2009
Ah! Hello again Ned. Im not sure if you remember this, but I purchased this menu.fla and I do not know AS3. You however seem to be a real AS3 wizard of sorts. I found the following in the adobe help section in regards to Event-handling: Clicking a button to navigate to a URL. In this case, linkButton is the instance name of the button: ( code attached below )

ok! I see what you are saying. But how do I get this (code attached) to work with the if else statement for the addChild(butn). Can you please look at the code about butn.x = getChildByName. It looks to me like the code was designed to add child buttons and link them via the event.target.num == x.
So once or if I remove the event.target how will each child link?