A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Problem with a form

  1. #1
    Junior Member
    Join Date
    Jun 2006
    Posts
    29

    Problem with a form

    Ok I have 2 basic problems that are probably some kind of error on the code but I can't seem to find them.

    1) When I add information to the form, when the e-mail is created it will return the values -1 character. Example:

    Name: Michael
    Date: 10/9/12

    It will show the values in the e-mail as:

    Name: Michae
    Date: 10/9/1

    That's problem number 1... the second problem is:

    The information will show if the .fla is open, if I close it and try and run the swf or html file to test it, it will open my e-mail handler but it wont show any information at all. I'm stuck and I need some help pls someone.

    The Code:

    on (release) {
    trace(this.fecha.text);
    trace(this.productor.text);
    trace(this.codigo.text);
    trace(this.nombreasegurado.text);
    trace(this.direccionpostal.text);
    trace(this.direccionfisica.text);
    trace(this.segurosocial.text);
    trace(this.telefono.text);
    trace(this.propiedad.text);
    trace(this.agregado.text);
    trace(this.productos.text);
    trace(this.injuria.text);
    trace(this.ocurrencia.text);
    trace(this.nombreadd.text);
    trace(this.direccionad.text);
    trace(this.direccionfisica2.text);
    trace(this.direccionfisica3.text);
    trace(this.comentarios.text);


    urldata = "";

    urldata += "Fecha: "+this.fecha.text+newline+" ";
    urldata += "Productor: "+this.productor.text+newline+" ";
    urldata += "Codigo: "+this.codigo.text+newline+" ";
    urldata += "Nombre: "+this.nombreasegurado.text+newline+" ";
    urldata += "Dirección Postal: "+this.direccionpostal.text+newline+" ";
    urldata += "Dirección F*sica: "+this.direccionfisica.text+newline+" ";
    urldata += "Seguro Social: "+this.segurosocial.text+newline+" ";
    urldata += "Teléfono: "+this.telefono.text+newline+" ";
    urldata += "Propiedades: "+this.propiedad.text+newline+" ";
    urldata += "Agregado: "+this.agregado.text+newline+" ";
    urldata += "Productos: "+this.productos.text+newline+" ";
    urldata += "Injuria Personal: "+this.injuria.text+newline+" ";
    urldata += "Cada Ocurrencia: "+this.ocurrencia.text+newline+" ";
    urldata += "Nombre Asegurado Adicional: "+this.nombread.text+newline+" ";
    urldata += "Dirección Adicional: "+this.direccionad.text+newline+" ";
    urldata += "Dirección F*sica: "+this.direccionfisica2.text+newline+" ";
    urldata += "Dirección F*sica: "+this.direccionfisica3.text+newline+" ";
    urldata += "Comentarios: "+this.comentarios.text+newline+" ";

    trace(urldata);

    getURL("mailto:[email protected]?subject=Resp onsabilidad Personal&body="+urldata);
    }

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    I recommend you to give your button a name in the property inspector such as submitBut and put all your script in the actions frame on the main timeline. I assume that onRelease refers to a button and that the textfields are somewhere in the movie and not the button. So replace "this" by _root, since this would refer to the button. If you want to use this, then it needs to be this._parent.

    submitBut.onRelease = function(){
    trace(_root.fecha.text);
    trace(_root.productor.text);
    trace(_root.codigo.text);
    .....
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Jun 2006
    Posts
    29
    Thanks man, I already fixed the problem but now I have a formatting problem it prints on the e-mail form but everything is together... is there any way I can add some kind of code to add an empty line between each item?...

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Instead of newline you can use this +"\n"+"\n"+

    This should give you 2 lines.
    - The right of the People to create Flash movies shall not be infringed. -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center