PDA

View Full Version : eh. really easy question


kylec4321
12-09-2005, 04:36 PM
i just started using macromedia flash for the first time in about a year today and i forgot how to make a button into a link? where do i put it at?

_Aerospace_Eng_
12-09-2005, 04:55 PM
First you need to open your library pressing CTRL+L your button should be here. Create a layer name it actionscript this is where all of your actionscript will be. Create a new layer, this will be your main movie layer. Drag your button from the library to where you want it to appear. Your button should have a greenish border around it. Then you will want to press CTRL+F3 this will open the properties panel for the button, in the top left of the properties panel you see a drop down menu that should have button in it, just below this is a box and the words instance name are in it. Type in a name for your button this will be used in the actionscript. Now go back to your actionscript layer, and hit F9 this will open your actions panel. Here you will type in the actionscript for your button.
myButton.onRelease = function(){
getURL("http://www.htmlforums.com","_blank","post");
}
Where myButton is the instance name that you gave to your button in the previous steps.

kylec4321
12-09-2005, 05:49 PM
http://www.sitesled.com/members/304productions/enter.html
heres the problem im having now. i have two questions.
ok i got the first link to work, the home one, but if i try to change the actionscript for the products or anything else, then all of them change to it. what do i do wrong?

And why does the site open up in its own page and also the separate page. i targeted blank when you click "click here to enter"

_Aerospace_Eng_
12-09-2005, 08:11 PM
You can't use the same instance name for each button. You will need to change the instance names and write the appropiate actionscript for each button. Try this for your splash page, personally I say dump the splash page, it gets annoying.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Enter Tha Spot Skateshop</title>
<style type="text/css">
html, body {
margin:0;
padding:0;
background:#000;
color:#FFF;
text-align:center;
}
a, a:link, a:visited {
color:#FFF;
text-decoration:underline;
}
a:hover, a:active {
text-decoration:none;
}
</style>
</head>

<body>
<br>
<a href="index.html" onClick="window.open(this.href,'loading','width=700,height=487');return false" target="_blank">Click here to enter</a>
</body>
</html>

nix
12-10-2005, 08:19 AM
I don't agree fully with aerospaces method. While it does work and would've worked if you knew what you were doing(no offense), a much simpler method would be to click on the button itself, press f9 which opens up the actions window, and then type this code:


on(release)
{
getURL("your-desired-page.htm", "_self", "post");
}


Now, for all the buttons, you don't need to give them instance names, and each button will have it's own special code. :thumbup:

RysChwith
12-10-2005, 02:20 PM
And, because I'm a contrary and difficult person, I must disagree with Nix. It's good coding practice to keep all of your code in the same place. It makes it a lot easier to debug and change the code.

I'll also disagree with Aero slightly (remember: contrary and difficult), but since I can't remember exactly how to do what I'd recommend off the top of my head, I'll save that disagreement for later.

Rys