Click to See Complete Forum and Search --> : v7-AS3 [RESOLVED] How to make a contactform in KM, all fields requird?
trendsetterz
06-11-2009, 04:11 PM
Hey people,
i want to make something like this :lovers::
http://img7.imageshack.us/img7/7379/formulierw.jpg
And every field must be required to fill :scared:. And when you click on Send, send it to my mail.
:confused:
Thanks!
Peace from the Netherlands!
trendsetterz
06-11-2009, 08:00 PM
Ok for now i will use another.
I found on koolexchange a mailform.
Filename: mailform
I imported the .fun into my file.
My file has 7 frames. I opened it on frame 2 and it goes on till frame 7..
(Or is it cause it says it isn't connected to the server)
I want this cause my file is 7 frames long, but if i go to frame 3,4,5,6,7 i see the Mailform.
Can i do something like: Open in frame 2 and stop.
Or must i increase my frames?
Excuse me, if my english isn't correct. I hope u understand what i mean.
Thanks
blanius
06-11-2009, 11:16 PM
what version of KM?
trendsetterz
06-12-2009, 03:57 AM
Hi i have version 7.0.
Thanks
trendsetterz
06-12-2009, 07:27 AM
Don't worry. Thanks.
I increased already the frames.
It worked. One thing, when an error ocurs (when u don't fill the form) than u can press the button Back, than he starts again at frame 1 and not 3.
But thanks anyway!
blanius
06-12-2009, 08:01 AM
Probably need to just change the action for the back button to go to the correct frame.
trendsetterz
06-12-2009, 09:34 AM
Workin indeed. Thanks!
trendsetterz
06-12-2009, 09:41 AM
In a new file it is workin.
But in the .fun i'm workin, its gives a error:
The following AS1 code was removed from the movie because it will definitely not compile as AS3.
It is possible there is other code which will need to be converted to AS3.
Object btn1:
on (release) {
problem="";
lf="\n";
if (n.text.length<3){
problem+="Name to Short"+lf;
}
if (e.text.indexOf(",")>0){
problem+="one Email address only please "+lf
}
if (m.text==""){
problem+="Please enter a message"+lf;
}
if (e.text.length<7){
problem +="email too short "+lf;
}
if (e.text.indexOf("@")==-1){
problem+="Email missing @"+lf;
}
if (e.text.indexOf(".")==-1){
problem+="Email Missing dot"+lf;
}
if (e.text.indexOf("@")>e.text.indexOf(".")){
problem+="Mal formed email"+lf;
}
if (e.text.lastIndexOf(".")>e.text.length-3){
problem+="invalid Domain"+lf;
}
if (n.text==""){
problem+="You must enter a name"+lf;
}
if (problem.length<1){
emailvar.name=n.text
emailvar.email=e.text
emailvar.message=m.text
emailvar.sendAndLoad("jjhsuhs.php",result,"POST");
nextFrame();
}
if (problem.length>1){
p.text="problem"
gotoAndPlay("form_error");
}
}
---------------------------------------------
Object mc2:
on(release){
m.text=e.text=n.text="";
}
Is this because i didn't fill the mail yet.
And when i press ok: i got this error:
There are some instance name conflicts. The following changes have been made in exporting the swf.
Action script code which references these instance names has not been changed.
S56 -> S56_52
btn1 -> btn1_71
btn3 -> btn3_78
blanius
06-12-2009, 10:27 AM
This is because the form is AS1 from KM6. I'm working on a new one for AS3 as we speak. Be patient I will get it done soon.
[note] I moved this to the proper thread
trendsetterz
06-12-2009, 12:56 PM
Ok thanks man,
appriciate.
Goodluck!
Peace
blanius
06-13-2009, 12:50 AM
Almost there.
Just need to finish up and test the server side PHP
Try the form, Extra feature try to add email headers to the text like bcc: or to: etc... This is what spammers do...
Chris_Seahorn
06-13-2009, 11:31 AM
Also have one coming that utilizes an RTE to create formatted html mails. Yes, it has injection control :)
Running here:
http://www.km-codex.com/?page_id=421
KM7/AS3/PHP
blanius
06-13-2009, 06:30 PM
as usual one step ahead of me Chris lol
Chris_Seahorn
06-13-2009, 07:28 PM
No...just happened to have one lying around. :)
Cleaning up the code now.
blanius
06-13-2009, 09:44 PM
I'm pretty much done here as well just not getting my response back from server correctly, Server is sending it my AS3 is just bad....
//code snippet of sending data
status_txt.text="Sending...";
submit_btn.enabled=false;
//first we create a URL formated variables
email_data="name="+name_txt.text
+"&email="+email_txt.text
+"&subject="+subject_txt.text
+"&message="+message_txt.text;
txt1.text=email_data;
//then we create a URLVariables object and load our text
URL_vars=new URLVariables(email_data);
//Set it to use Text
URL_vars.dataFormat=URLLoaderDataFormat.TEXT;
//set the URLRequest data to our variables
vRequest.data=URL_vars;
//Actuall send it to the server
vload.load(vRequest);
//wait for it to be done sending
vload.addEventListener(Event.COMPLETE,done);
this is working but Event.Complete is not
function done(e:Event){
var loader=new URLLoader(e.target);
email_status=new URLVariables(loader.data).success;
txt1.text=email.status;
status_txt.text=email_status;
if (email_status=="ok"){
status_txt.text="Email recieved";
}else{
status_txt.text="There was an error. not sent"+email_status;
}
}
Chris_Seahorn
06-13-2009, 10:52 PM
Just posted in source section. :thumbsup:
trendsetterz
06-14-2009, 08:47 AM
Uhhhhhhhhhhhhhhh it's now going a little to fast for me :P
Or is the solution not find yet??
Blanius the code you pasted is that of the mailform.fun file?
&
Chris Seahorn, i downloaded KM Codexcontactform and when i'm opened it and want to play it, it says:
Can't find package etc.
Greets!
blanius
06-14-2009, 09:30 AM
Chris's example uses the tweenmax or tweenlite classes. You need those to compile his version or remove the references to it.
What I pasted is from mine, it's just quite working yet... I've having a problem with it still. AS3 is still new for me and I am away from it for long periods so I forget half of what I learn. I dealt with this same issue before but forget how I fixed it.
Chris_Seahorn
06-14-2009, 10:32 AM
Since the source needs to be edited to insert your subject lines, I had hoped the commented section here:
//Tweenmax classes need to be present!
import gs.*;
import gs.easing.*;
import gs.events.*;
import gs.utils.tween.*;
import gs.plugins.*;
would do the trick :)
blanius
06-14-2009, 08:53 PM
I've upload mine now to the KoolExchange (http://koolexchange.com) (look in the input forms section) for you to download as well. You would do well to look at both and see what you can learn from both, I know I'm studing Chris's example, he always does great work and usually has added features like using tweenmax which is pretty cool. Mine is a little simpler.
Good luck Trend
blanius
06-20-2009, 12:23 AM
Trend, did either one of these take care of what you wanted?
trendsetterz
06-22-2009, 06:28 AM
Trend, did either one of these take care of what you wanted?
Sorry man, i was a few days offline.. Thanks for your reply's. :thumbsup: I will trie them now. :mrpimp:
trendsetterz
06-22-2009, 08:53 AM
When i open it into a blanco page, it works.
But....
When..
I downloaded the file and imported into KM7.1 in my file:
It says: KC9: can't find AS3 component movie clip.
And then it crash.
blanius
06-22-2009, 09:56 AM
You will have to decide how to incorporate it into your project. You could load it as external swf file, or just copy and paste the AS3 and create your text fields yourself, and to make it work with an existing project you may need to rename some variables and or text fields to eliminate any conflicts.
Not sure what would cause that error you are seeing.
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.