With this tutorial you will learn to create an online flash
form using PHP coding to send the data... there is no knowledge of php needed
as the code is included… I must state though, I created this from the internet a
while ago and cannot find where I got it from… Naveen has created a good flash
form tutorial with validation on this forum check it out also!!!
I WILL POST THE SOURCE AS SOON AS I CAN FIND IT – I PROMISE!!!
Step 1
Open flash and create a new document
Step 2
Select the text tool and create a text box on the stage… don’t
stress too much about the size or position of the box at this stage we will fix
it later!!!

In the properties box, change the text “static text”
property to “Input text” and give it a variable of “name”… also, make sure that
the colour of the text is black and that you click the “Show Border aroung Text”
button…

Step 3
Copy steps 1 and 2 until you have four input text boxes on
the stage… give a variable of “phone”, “email”, and “comments” respectively… your
stage should look like this…

Step 4
Now it is time to resize and position the input boxes to
your liking… select a box and in the “info properties” make each box the same
width… for this tutorial I am making them 250 each… you will then have to
position them as you please… a little bit of mucking around but well worth the
professional finish (use the selection tool for this)… my stage looks like this…
it doesn’t really matter as you can make it look anyway you like!!!

Step 5
Using the text tool add text to the stage “Name”, “Phone”, “Email”,
and “Comments” and align them respectively with the input boxes you gave the
variable to… make sure that they are “static text” AND NOT “input text”

Step 6
Clicking the stage and pressing Ctrl + A (or using the
selection tool) select everything on the stage!!! Press F8 to create a symbol,
select movie clip and name it “form mc” (you can also right click and “convert
to symbol”)… click OK…

Select this movie click and give it an instance name of “form”
in the properties box!!!

Step 7
Create a button or use the buttons that flash provides (
Window menu -> common libraries -> buttons) and place it near the bottom
of the form… I am using the provided button in the “buttons rect bevel” folder –
rect bevel aqua!!! Just drag the provided button onto the stage where you would
like position it!!!

Step 8
Select the button and add the action script to the button…
on (press) {
form.loadVariables("email.php","POST");
}

Step 9
You have now created the form that will work with the
email.php provided below (we will get to changing that in a minute)… first we
will work on a little bit of animation so that the people who are entering
their details will know that the data has been sent… this is important so that
they don’t continuously click the enter button numerous times and send the
email over and over again… so, let’s get to it…
Create a new layer and name it “actions”… you should have
two layers now – “actions” and “Layer 1” (you can change the layer 1 name to be
whatever you like but for this tutorial I will leave it – mainly because I’m
lazy and have already taken the screen shots… LOL)… on the first frame of “actions”
layer add the action script:
stop();
(this can easily be done by pressing Esc + S + T)


Step 10
On the first frame of “Layer 1” layer… select the “form mc” movie
clip and open the actions panel… Add the action script:
onClipEvent (data) {
_root.nextFrame();
}

Step 11
Select the second frame of “Layer 1” layer right click it
and create a “New Keyframe” (you can also go through the menu – Insert ->
Timeline -> Keyframe)
Then, with the second frame select on Layer 1 delete
everything on the stage and add the text:
Your details have been submitted… I will be in contact with
you at my earliest convenience (or whatever you would like to say!!!)

Step 12
Select the second frame of “actions” layer, right click it
and create “New Keyframe”… open the actions properties and add the action script:
Stop();
We are now complete with the flash form… ON TO THE PHP
FILE!!!
Download the source files below before we go on!!! I got the
email.php from the following site:
<a href="http://www.thesitewizard.com/php/index.shtml"
target="_top">Free PHP Tutorials and Scripts</a>
PROPS TO THEM!!!
Open email.php – I am assuming that you have a program to do
this – if not NOTEPAD++ is a good code editing program and its FREE get it here
(Disclaimer - I have absolutely no affiliation with
NOTEPAD++ or its creators. Please don’t ask me any question about it!!! )
OK… after all that is said…
In the email.php scroll down and make the following changes:
$mailto = 'YOUR EMAIL ADDRESS GOES HERE' ; (Change this to be your email address!!!)
$subject = "SUBJECT OF THE EMAIL YOU WILL RECIEVE GOES
HERE" ; (Change this to be the subject of the email that you will receive)
THAT IS IT!!! You
have now created your very own flash form using PHP…
All you have to do
now is change the colouring to suit your needs and save the flash document as
form.fla and publish it as form.swf… you then add it to your website and upload
all the files to the SAME directory as
the web page (this is a must!!!)
Download Source files here…