I can see vars in a textbox, but my script does not work? - Page 2
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30

Thread: I can see vars in a textbox, but my script does not work?

  1. #21
    Web Apprentice
    Join Date
    Nov 2006
    Location
    Philippines
    Posts
    6
    Hello.

    I have a similar problem with using the loadVars() function in connecting it with my php script that handles the data.

    Nothing seems to be wrong with the php script because when I run it using actionscript's send() function, the data gets emailed.

    So the problem has to be in the actionscript because when I used LoadVars() and loadVariables() funtions, they don't work, in other words, nothing happens to the email script.

    But then again, I was wondering that maybe it's because a php script cannot run unless it's opened? D'uh, I don't know.

    Okay now, here's the actionscript code:

    Code:
    on (release) {
    		if (...some condition I placed...) {
    		var submit:LoadVars = new LoadVars();
    		submit.emailTo = "bernie.leano@star22home.com";
    	        submit.emailFrom = data_mc.email_input.text;
    		submit.emailSubject = "star22home Form Submission";
    	        submit.firstname = data_mc.first_input.text;
    		submit.lastname = data_mc.last_input.text;
    		submit.company = data_mc.company_input.text;
    		submit.telephone_area = data_mc.telephone_input_area.text;
    		submit.telephone1 = data_mc.telephone_input1.text;
    		submit.telephone2 = data_mc.telephone_input2.text;
    		submit.mssg = data_mc.message_input.text;
    		submit.fax_area = data_mc.fax_input_area.text;
    		submit.fax1 = data_mc.fax_input1.text;
    		submit.fax2 = data_mc.fax_input2.text;
    		submit.loadVariables("http://www.star22home.com/submit.php","_self","POST");
    		this.nextFrame();
    		}
    		else {
    			data_mc.alert_dt.text = "Error: Fill in all required fields in proper format.";
    		}
    }
    A little help please. Thank you for the time.

  2. #22
    Moderator
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    should be submit.sendAndLoad() if youwant to stay in flash, or submit.send() if you want a html page back

    Musicman

  3. #23
    Web Apprentice
    Join Date
    Nov 2006
    Location
    Philippines
    Posts
    6
    Thank you Musicman. I will try it.

  4. #24
    Web Apprentice
    Join Date
    Nov 2006
    Location
    Philippines
    Posts
    6
    This is odd. I tried replacing it with submit.sendAndLoad(...); but still nothing happens. Only the submit.send(...) function does.

  5. #25
    Senior Member
    Join Date
    Feb 2006
    Posts
    198
    note:
    - did you test the .php file on the same domain and in the same chmod folder
    - try a clean flash script first with you send();
    then thereafter when succeeded, try your complicated flash script like yours is
    all punctuation and syntax looks fine to me, so.. try excluding (comment 2)
    http://www.michaellobry.com specialized by and for Web Media Designers. Herein shown should be summarizings about Web Media Design (eg. all CSS rules, SHTML tags, How to PHP, Macromedia/ Adobe app how-tos, etc. Please e-mail yours to webmaster@michaellobry.com so that everybody learns)

  6. #26
    Web Apprentice
    Join Date
    Nov 2006
    Location
    Philippines
    Posts
    6
    Quote Originally Posted by johnwhello
    note:
    - did you test the .php file on the same domain and in the same chmod folder
    - try a clean flash script first with you send();
    then thereafter when succeeded, try your complicated flash script like yours is
    all punctuation and syntax looks fine to me, so.. try excluding (comment 2)
    Yes, I did try testing the .php file and it works and I already placed it on the same domain and in ythe same chmod folder.

    Though I don't understand which comment you are pertaining to in my script. Could you point it out for me? Thank you.

  7. #27
    Senior Member
    Join Date
    Feb 2006
    Posts
    198
    It's no 'comment 2' from your script, but from my text, which is:
    First, try a clean script: thus as empty as possible, (yours isn't empty enough, that is what i meant). Once you have a really truly basic Action Script Code, try see if it works. If it works, try adding your scripts line by line if able. Using this excluding method, you might find some remedy/ alternative solution.
    http://www.michaellobry.com specialized by and for Web Media Designers. Herein shown should be summarizings about Web Media Design (eg. all CSS rules, SHTML tags, How to PHP, Macromedia/ Adobe app how-tos, etc. Please e-mail yours to webmaster@michaellobry.com so that everybody learns)

  8. #28
    Web Apprentice
    Join Date
    Nov 2006
    Location
    Philippines
    Posts
    6
    Got'cha. Thanks for the tip.

  9. #29
    Junior Member
    Join Date
    Feb 2007
    Posts
    7

    Login Example

    MusicMan,
    is it possible that you could make a simple login fla file that contains the login details you explained above.

    It is always easier for everyone to learn by looking at a working fla, as opposed to trying to sort out all the details from forum posts.

    I am sure this would help a LOT of members.

    I have now spent 4 whole days on this problem :-(

    Thanks in advance.

  10. #30
    Web Apprentice
    Join Date
    Nov 2006
    Location
    Philippines
    Posts
    6
    Does this section:
    submit.loadVariables("http://www.star22home.com/submit.php","_self","POST");
    need not be specific as to the php file's location?

    Will
    submit.loadVariables("submit.php","_self","POST"); do regardless of the root domain?

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

Poll by Flashkit.com