Copy link to clipboard
Copied
Hi,
Im making a web and I have a problem with one button. I want to this button when you will do clic on it; Outlook or similar program open a new eamil with my adress.
I put this code in my action:
on (press) {
getURL("mailto:tumail@tumail.com", "", "POST");
}
But don't work. Appear a ERROR MESSENGER "Error 1086"
Thnx.
Andrés
I'm still not clear on where you are putting that code. For that type of code you need to select the button on the stage and then enter the code in the Actions panel.
A better way to code the button is to place it in the timeline where the button lives instead. To do that, select the button on the stage and give the button an instance name in the Properties panel where it says <Instance name>... let's san you name it "btn"
Then create a layer in the timeline for actionscript. If the button is i
...Copy link to clipboard
Copied
What is the entire error message?
Where are you putting that code, in the timeline or on the button?
Copy link to clipboard
Copied
Hi.. thnx for ur repley.
First of all im new with Flash I only use it for put all my Photoshop layers and make my buttons
First I’ve made my button after it, I went to go Scene and I did clic (only 1) in my button layer, later press F9 and put the code
The error message is “Escena 1, Capa ‘Contactame’, Fotograma 1, linea 1, columna 12 1086: Error de sintaxis: se esperaba un punto y coma antes de leftbrace.” in English the message is “"Scene 1, Layer 'Contact me', Frame 1, line 1, column in December 1086: Syntax error: expecting semicolon before leftbrace."
If you want I cant send u the file. I think the problem is easy, but i havent enough experience in it.
Thnx
Andrés
Copy link to clipboard
Copied
Try changing the first line to not have that space between on and the parentheses, and use release instead of press...
on(release) {
Copy link to clipboard
Copied
Done, and don’t work. The same error.
Copy link to clipboard
Copied
I'm still not clear on where you are putting that code. For that type of code you need to select the button on the stage and then enter the code in the Actions panel.
A better way to code the button is to place it in the timeline where the button lives instead. To do that, select the button on the stage and give the button an instance name in the Properties panel where it says <Instance name>... let's san you name it "btn"
Then create a layer in the timeline for actionscript. If the button is in the first frame of its layer, then select the first frame of the new actions layer and enter the following code in the Actions panel...
btn.onRelease = function(){
trace("btn works");
getURL("mailto:tumail@tumail.com");
}
The trace function inside the the button function should be removed but it is there for now to help make sure that the button is executing the function.
Copy link to clipboard
Copied
Yes. I put the first code in stage.
I tried your suggestion but i dont know how do it well. I've tried it but dont work :S
Copy link to clipboard
Copied
The first code you showed does not go in the stage. As I mentioned in my last response for the original code you select the button and then enter the code in the Actions panel. That way the code is attached to the button.
If you describe what you did for the other way maybe I can see where you missed something.
Copy link to clipboard
Copied
Here is a link to a file that show both approaches to making the button work.
http://www.nedwebs.com/Flash/AS2_button_coding.fla
The file has been tested, so if it does not work for you, the problem is not with the file.
Copy link to clipboard
Copied
If u try this file http://www.nedwebs.com/Flash/AS2_button_coding.fla
DONT WORK. appear 2 errors.
I have other 2 bottums with goto others web, and it works, but the problem is with this buttom for email.
Copy link to clipboard
Copied
As I already indicated, the file I provided has been tested and it works. The problem is not with the file - it is something with your system/software.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now