Articles related to web development
This tutorial will demonstrate you how to CREATE tables and insert data into it. I assume that you have read tutorial for mySQL connectivity and you have already made config.php Read here
Level : BEGINER
The function we will use is :
mysql_query();
For creating new tables we use the following query.
Syntax : CREATE TABLE tablename(fields)
but we have to use all queries in the function mysql_query()..
so it will be used like this.
I am making a table of members with only id,name and email.
mysql_query(”CREATE TABLE members(id INT(5), name VARCHAR(20), email VARCHAR(20))”);
Ok this will create table with the name members.
It was so easy, isnt it
![]()
Now the process of inserting data into table. We will be using another query for inserting data..
Syntax : INSERT INTO tablename VALUES(fields with values)
This is how you will insert data into table. So it will be used in the fucntion like this.
mysql_query(”INSERT INTO members VALUES(1,’Ali’,'abc@swish-db.com’)”);
Now if you want that ID should be unique everytime, means it cannot be the same. for example 1 is already assign to ALI so 1 cannot be entered again then you can put PRIMARY KEY in front of ID field, while you are creating table, so it will look like this,
mysql_query(”CREATE TABLE members(id INT(5) PRIMARY KEY, name VARCHAR(20), email VARCHAR(20))”);
so this is the basic tutorial for creating table and adding data into it. I hope it was useful.
I have replied a hundred times this question, so I thought why not to post it here. Next time if I found any question related to this topic I will delete it immediately. :@ Update : well I was really mad at that time
its oldie you know..
If you want your movie to stretch with the browser size, it will fit in any screen resolution. use the following code
| CODE |
<html> <head> </head> <title>SWiSH-DB –> Best Designers’ Community</title> <body bgcolor=”#FFFFFF” rightmargin=0 leftmargin=0 topmargin=0 bottommargin=0 scroll=no> <embed src=”index.swf” width=”100%” height=”100%” align=”top” scale=”exactfit”></embed> </body> </html> |
and for example if you dont want your movie(SWF) to stretch and you dont want scrollbars then change the height and width of your movie like this..
| CODE |
<html> <head> </head> <title>SWiSH-DB –> Best Designers’ Community</title> <body bgcolor=”#FFFFFF” rightmargin=0 leftmargin=0 topmargin=0 bottommargin=0 scroll=no> <embed src=”index.swf” width=”800″ height=”600″ align=”top”></embed> </body> </html> |
Level : Intermediate
French Transalation here - Thanks to Pierre
We will use a function percentLoaded(); in this tutorial, to get the percentage of the movie loaded.
Description
————
This function returns the percent of the movie that has so far loaded into your temporary file folder, its possible values are from 0 to 100. It always returs an integer value (means there will be no vlaue with point as 21.4 or 34.5, it will always return a round vlaue as 21 or 34. So its really handy function because this way we can let our movie goto any Frame number.
I assume that you already know how to make a simple preloader for your movies. You will have to make two scences, in the first scene (will be will at the top) you will place your percenatge preloader and in the next scene (Scene 2) you will place your movie to be loaded(main movie)..
Ok - follow the steps now.
1. In this step we will make the designing part how our percentage preloader will look like. Put some static text “Movie Loaded :” in Scene_1.
2. Make a dynamic TEXT box and on the its properties NAME, put per infront of it. It means per is the object name of your dynamic text box. Check the Target and give Variable name as percent.
3. Make BAR which you want to dusplay while loading movie, I have made a simple bar with Radial Gradient property. Convert it to sprite bar. Now reduce the width of bar to 2 pixels, so it will look like this.

Ok - now in your bar sprite place a Stop() action on frame number 1. Place a move
effect of 100 Frames in front of your Bar, and stretch it how big bar you want, Just like this

4. On frame number 1 of Scene (preloader) paste the following code
onEnterFrame() {
myVar = percentLoaded();
percent = myVar+”%”;
tellTarget (bar) {
gotoAndStop(myVar);
}
if (myVar >= 100) {
gotoSceneAndPlay(”Scene_2″,2);
}
}
onFrame (2) {
prevFrameAndPlay();
}
so your movie will look like

Explaination of Above Code.
—————————-
myVar = percentLoaded();
percent = myVar+”%”;
As we know percent is our dynamic text box, in this line we are displaying the percentage of movie downlaoded.
tellTarget (bar) {
gotoAndStop(myVar);
}
In the above code we are goign to next frames of BAR sprite in which our bar is placed.
if (myVar >= 100) {
gotoSceneAndPlay(”Scene_2″,1);
}
In the above code we are putting a condition that if movie is 100% loaded then goto SCENE2 (where
your main movie in placed) and Play. You can put any action you want after your movie is downloaded.
5. Insert Scene_2, and place you graphics there. So that it will be redirected to Scene 2 after your movie is 100% loaded.
You are DONE !..
Dont forget to Export your Movie with Flash Player 6. Goto Export tab,
SWF version to export : SWF6
I hope its very easy to understand. But still if you have problems, or questions. Please feel free to post.
Level : Intermediate
I assume that you can make input boxes and know how to use variables. If you dont know how to use variables and how to make input boxes then please read the following tutorial before reading this tutotial.
Inputbox to TEXT file
and
Varables
STEPS TO BE PERFORMED
1. Make 4 input boxes with the following variable names
nameVar
emailVar
subjectVar
msgVar
2. Make a dynamic text box which will display status and errors with variable name errormessage
3. Make a button with name Clear Form and paste the following code on its action.
on (release) {
nameVar=”";
emailVar=”";
subjectVar=”";
msgVar=”";
}
This will clear all the text you have entered in your input text boxes.
4. Make a button with name Send and paste the following code on
its action.
on (release) {
if((nameVar==”")||(emailVar==”")||(subjectVar==”")||(msgVar==”")){
errormessage=”Please fill all the fields”;
}
else {
errormessage=”Sending….”;
send=”yes”;
this.loadVariables(”contact.php”,’POST’);
nameVar=”";
emailVar=”";
subjectVar=”";
msgVar=”";
}
}
A. Explanining this part of code
if((nameVar==”")||(emailVar==”")||(subjectVar==”")||(msgVar==”")){
errormessage=”Please fill all the fields”;
}
This part of the code checks wether all input boxes are filled or not. In the above
code we have used || logical operator. For more details about logical operators please read the following tutorial. Read Tutorial
B. Explaining the following part of code.
else {
errormessage=”Sending….”;
send=”yes”;
this.loadVariables(”contact.php”,’POST’);
send=”no”
nameVar=”";
emailVar=”";
subjectVar=”";
msgVar=”";
}
errormessage=”Sending….”; = this line will display the message until your email
has been sent.
send=”yes”; = in this line we are putting a new value “YES” to SEND variable, we are
doing this becuase we will check this variable in our PHP file, that is SEND button pressed and all fields were given, if so then send email to the given email address in contact.php file.
this.loadVariables(”contact.php”,’POST’); = in this line we are loading variables from/to contact.php file which we will be making in our next step. It will send variables (name,email,subject and message) to that PHP file.
5. On frame number 1 of your main time, put the following code on its action
onFrame (1) {
nameVar=”";
emailVar=”";
subjectVar=”";
msgVar=”";
}
This means that there is no text in your input text boxes when you see your movie for the first time.
Everywhere you placed some code on an object (texbox) don’t forget to checkmark the TARGET box !
6. Open notepad or any text editor and paste the following code into it
<?
if ($send==”yes”) {
$to = “YouName@YourDomain.com”;
$subject = “$subjectVar”;
$body .= “$msgVar”;
$from = “$nameVar”;
$tfrom = “From: <$emailVar>”;
mail($to,$subjectVar,$msgVar,$tfrom);
}
echo “&errormessage=Email has been sent&”;
?>
save this file as contact.php.
here is the preview of the example included in this tutorial

NOTE : Dont forget to change the email address in CONTACT.PHP file.
Just input your email address, replace YouName@YourDomain.com with yuor email address.
YOU ARE DONE !
Save you SWI file to contact.swf and export it. Upload contact.swf, contact.html and contact.php to any directory and check it.
REMEMBER : You can use it in any level, means in any sprite or sub sprite. It will work fine.
if you have any questions, please feel free to ask and discuss. I hope this is really handy tutorial can is useful.