View Full Version : How to make my banner a link to a webpage
AntonioRamirez
11-19-2005, 11:13 PM
Hi!
I Just finished my first animated banner and my last step is to make it capable to be clicked on and then send the user to another URL. What do I have to do?
Really newbie
Regards
Antonio
Ruben
11-19-2005, 11:23 PM
on (release){
getURL("yourpage.html","_self");
}
:) - Ruben
oldnewbie
11-20-2005, 01:03 AM
this.onMouseDown = function(){
getURL("yourpage.html","_self");
}
Ruben
11-20-2005, 04:52 PM
OldNewbie's right, if you want the whole of your stage to be clickable it's best to use the onMouseDown event. However they're be no hand-cursor.
:) - Ruben
Alphasnail
11-28-2005, 10:26 PM
OldNewbie's right, if you want the whole of your stage to be clickable it's best to use the onMouseDown event. However they're be no hand-cursor.
I'm also somewhat new. Why would on onMouseDown be preferrable to on(release)?
Also, if the onMouseDown is used, could you also add on(release){} to the movieclip instance itself to regain the pointing hand?
Ruben
11-29-2005, 09:06 AM
The only difference here is that you can attach onMouseDown (or onMouseUp for that matter) to the _root.
onRelease is an eventhandler that has to be attached to a movieclip or button.
This means that if you're creating a banner and you want the whole stage of the banner to be clickable then it's easier to use onMouseDown and attach it to the _root since the _root is simply everything in your movie (including the stage). For this you won't have to use a button or whatever to attach the actions to (like you will have to with onRelease).
Only downside here is that if you want to have the hand-cursor displayed when rolling over the banner you'll probably have to create a movieclip of the hand-cursor (http://www.actionscript.org/forums/showthread.php3?t=47005), hide the mouse (Mouse.hide (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary499.html)) and drag the hand-smybol around the stage continuously (startDrag() (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary681.html)).
:) - Ruben
PS. Do note that the difference is really tiny, if I'd want a hand-cursor I'd just create a button since creating a button at the size of the stage takes way less effort then setting up the thing with the custom hand-cursor...
Crazzzy_DucK
11-30-2005, 01:02 PM
Simple invisible button over the whole stage gives u hand cursor.
Alphasnail
12-01-2005, 03:18 PM
The only difference here is...
Thanks Ruben! That makes sense.
Ruben
12-01-2005, 05:41 PM
No problem man, you're welcome
:) - Ruben
|
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.