Skip to main content
Participating Frequently
July 23, 2013
Answered

Button (email) ERROR!!

  • July 23, 2013
  • 1 reply
  • 1955 views

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

This topic has been closed for replies.
Correct answer Ned Murphy

Done, and don’t work. The same error.


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.

1 reply

Ned Murphy
Legend
July 23, 2013

What is the entire error message?

Where are you putting that code, in the timeline or on the button?

andyesptAuthor
Participating Frequently
July 23, 2013

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

Ned Murphy
Legend
July 23, 2013

Try changing the first line to not have that space between on and the parentheses, and use release instead of press...

on(release) {