dcsimg
A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 47

Thread: “Collect All” To Make Professional Mobile Application in Flash Lite 1.1 Enable Device

  1. #21
    Senior Member
    Join Date
    Aug 2006
    Posts
    322
    Thank you hp3 to give such honor and advice me to post this as a tutorial. I think I'm not got such eligibility to make this a tutorial.

    It will be a discussion when someone join and write in it.

    To me forum is a document of tutorials when somebody gave comments or answer to it.
    But unfortunately in this thread I am the only person to answer and to discus with myself.

    So should I continue?

    Or you are indicating me to stop this writing here...


    marlopax


    Thursday, September 24, 2009

  2. #22
    Moderator
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    I spoke with other mods about this and they seemed to think it was ok for you to continue for the time being, however your tutorial would get more exposure to others if it were published in the tutorial section.

    Newly submitted tutorials appear on the home page and used to also go out in the FlashKit newsletter (not sure if this is mailed anymore). So many people will see the tutorial. Also I dont think there are many tutorials in the mobile area. It would be a helpful reference for people to have it in the tutorial section.
    aviarts.com - web development and flash development

  3. #23
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Ok! Welcome everybody.

    After a long period I am back into this discussion. Actually I’m decided to make this a m-book as hp3 gave me the suggestion to make it a mobile tutorial and also I had already in my mind to make it an useful guideline for novice to professional in the mobile area. But this will need more time and others’ help to make it success. It also needs more experiments on Flash Lite 1.1 area to make it on the pick level in the business, and I’m quite sure you will also stick with this little old 1.1 platform.

    To me all the platforms are same. We do as per the market demand. Basically to me FL 1.1 is more focused and bigger area than the other FL .x platform, although we always do it in all the other versions. A small request to “Adobe Developer Group” to fix up some bugs on Flash Lite 1.1 and do improve the flexibility of player installation on device. May be it is a OS issue but it will be more better to have more memory heap on a device.

    Let’s come back to the discussion. After the query we need to match the userName and Password with the database and return a value or string to flash.

    This code which will do the thing:

    if ($num == 1) {
    if ($Password==$pass["Password"]) {
    echo "&reason=Success&";
    }else{
    echo "&reason=Failure&";
    }
    }else{
    echo "&reason=Please register&";
    }

    The Total Code:

    <?PHP
    $Name=$_POST[“userName”];
    $Password= md5($_POST["Password"]);
    mysql_connect ("localhost", "root", "");
    mysql_select_db ("db01sep2009mob_app");
    $query = "SELECT * FROM login WHERE userName = '$Name'";
    $result = mysql_query($query);
    $num = mysql_numrows($result);
    $pass = mysql_fetch_array($result);

    if ($num == 1) {
    if ($Password==$pass["Password"]) {
    echo "&reason=Success&";
    }else{
    echo "&reason=Failure&";
    }
    }else{
    echo "&reason=Please register&";
    }
    ?>


    continue...

    marlopax


    Thursday, October 01, 2009

  4. #24
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Save the above php login code as EMI.php into the www root folder.

    Save the above php login code as EMI.php into the www root folder.

    In the EMI.fla file I use frame 8 for “About Us” section 9 and 10 for “Registration” and set the “login” from frame number 11. So give a frame label name “login” in frame number 11 and make two dynamic text field var = user and var = pass for username and password. Take a keyCatcher button and write the script bellow:

    KeyCatcher Script:

    on (keyPress "<PageDown>") {
    /:reason="";
    if (user ne "" && Pass ne "") {
    userName = user;
    Password = Pass;
    loadVariables("http://localhost/EMI.php", _root, "POST");
    gotoAndPlay("logLoop");
    } else {
    /:reason = "Required fields are empty.";
    }
    }

    And also place the fscommand2 script on this frame 11 to set the softKeys

    Frame Script:

    fscommand2("SetSoftkeys", left, right);

    continue...

    marlopax


    Thursday, October 15, 2009

  5. #25
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Confirmation of Login from the server:

    After sending the userName and Password to the server script, Flash Lite application has to stay in a loop state as a pre-loader to receive the confirmation report from the server so that it will immediately do the action when it received from the server. To make that pre-loader state we need two frames to loop.

    In frame 12 take a dynamic text field with a var name “log” and named the frame label “logName”. Write on the text field “Please Wait”. Now, on frame 13 put this script:

    Frame 13 Scripts:

    if (reason eq "Success") {
    gotoAndStop("start");
    } else if (reason eq "Failure") {
    gotoAndStop("login");
    } else if (reason eq "Please Register") {
    gotoAndStop("Register");
    } else if (reason eq "") {
    if (/:countLoad<4) {
    /:countLoad++;
    log = log add " .";
    } else {
    /:countLoad = 0;
    log = "Please Wait";
    }
    gotoAndPlay("logLoop");
    } else {
    gotoAndStop("login");

    }

    continue...

    marlopax


    Friday, October 23, 2009

  6. #26
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Registration Form in Flash Lite1.1 and PHP MySQL Interaction:

    Registering a user is something different from a login section, because you need some more information of your users to store in your database. This information will help you for further communication to the users to sent newsletters, offers, promotions etc. It is also been important for a business to gather detailed information of your users to make your own user’s list so that you can analyze and get the statistics of the business area, level, sector etc. the followings are some of the basic information for registration form.

    Information of Users:

    • First Name
    • Last Name
    • Sex
    • Age
    • Country
    • Address
    • City
    • Zip
    • Phone Number
    • E-mail
    • Create Date
    • User Name

    Login Information:

    • User Name
    • Password

    You’ll have to figure out what exactly information you need from the users for your business purposes, and then create a new table in the same database to store the information of the users. Here, for this application I’m going to store the (First Name, Last Name, Sex, Age, Country, Email ID and userName) in User Information table.


    continue...

    marlopax

    Tuesday, November 10, 2009

  7. #27
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Switching from TXT to PHP

    To get into this discussion of registering into your Flash Lite application, we need to know about SQL functions and MySQL database. The basic thing is to insert data into the database and pull the data out into it or to compare it with the user input data etc. However, to do this we need to learn/know about the database structure and the relationship of the database. This is very important that how you construct the database according to your application. In this login registration example, I will discus to construct the database to get better perform of your application on real time. Instead, to keep all the data into one database table it is always better to store data into different table of a database. This will help to organize your application and to get faster performance.

    To move further of the registration section, lets change the structure of the “EMI.fla” application. Instead, to loading the “EMI.txt” text file at the beginning of the application, with all the information of the product. Lets switch the loadVariables URL path to a new php file, which checks information whether is coming from a flash application and return the value otherwise echo a warning message to the browser. This is not for a security purposes, but if someone targets the path from a browser, it returns a custom error message. This will also be a faster process to load and check from server and take the application to the right path.

    firstLoadEMI.php

    Change the loadVariables url path from EMI.txt to “firstLoadEMI.php”. Create a php file into the www folder of that name, and instead of loading all the information of EMI.txt, just load the information to target the flash Playhead to the “login” Frame Label. Alternatively, you can just delete all the data from EMI.txt except the last line of loaded information (&loaded=data&).
    It you load the “firstLoadEMI.php” then change the 1st frame loadVariables script to the following script.

    Change loadVariables Code are:

    whatToDo="EMI";
    loadVariables("http://localhost/firstLoadEMI.php", _root,"POST");

    Here, I introduce a new variables “whatToDo” with a string value before the loadVariables and post the value to the firstLoadEMI.php file. This “whatToDo” variable will act as a condition checker and allow developers to write all the codes of login, user registration, edit user information etc. into one php file. However, for now I am doing it in separate php file, which will change later on.

    firstLoadEMI.php Code:

    <?PHP

    //This will hide the error message
    iini_set('display_errors', 0);
    $whatToDo=$_POST["whatToDo"];
    if($whatToDo=="EMI"){
    echo "&pick=login&whatToDo=login&loaded=firstLoad&feed= firstLoad&";
    }else if(!$whatToDo){
    echo "<strong>Warning:</strong> Browser Does Not Support.";
    }

    ?>

    This simple code will check with the posted value from flash application and return variables information back to the flash. Here, the “else if()” condition is to print on the browser if it run from browser. The “ini_set();” script will stop displaying the actual error occur and echo the “else if()” echo script.

    The preloader code of flash application which will check the firstLoadEMI.php and go to the login frame will be as follows:

    Preloader Code:

    iif (loaded eq feed) {
    gotoAndStop(pick);
    } else {
    if (/:CountLoad<4) {
    /:CountLoad++;
    loading = loading add " .";
    } else {
    /:CountLoad = 0;
    loading = "Loading";
    }
    gotoAndPlay(2);
    }



    This code will wait for the result from firstLoadEMI.php file from the server and jump to the frame which echoed from the php script.

    continue...

    marlopax


    Thursday, November 19, 2009
    Last edited by marlopax; 02-25-2010 at 04:10 PM.

  8. #28
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Some More Work in Login

    In EMI.fla on frame label ”login”, change the keyCatcher script.

    Code will be as bellow:

    on (keyPress "<PageDown>") {
    /:reason="";
    if (user ne "" && Pass ne "") {
    whatToDo="Login";
    userNameSent = user;
    PasswordSent = Pass;
    loadVariables("http://localhost/EMI.php", _root, "POST");
    user="";
    Pass="";
    gotoAndPlay("logLoop");
    } else {
    /:reason = "Required fields are empty.";
    }

    Now, in EMI.php file, write an “if condition” of whatToDo variables to check what the EMI application are looking for. Because we are going to write all the codes of login, registration, edit profile and so on in one php files “EMI.php”.

    The login script will be as:

    <?PHP
    $whatToDo=$_POST[“whatToDo”];
    /*--------------------Login--------------------*/
    If($whatTODo==”login”){
    $Name=$_POST[“userName”];
    $Password= md5($_POST["Password"]);
    mysql_connect ("localhost", "root", "");
    mysql_select_db ("db01sep2009mob_app");
    $query = "SELECT * FROM login WHERE userName = '$Name'";
    $result = mysql_query($query);
    $num = mysql_numrows($result);
    $pass = mysql_fetch_array($result);

    if ($num == 1) {
    if ($Password==$pass["Password"]) {
    echo "&reason=Success&";
    }else{
    echo "&reason=Failure&";
    }
    }else{
    echo "&reason=Please register&";
    }
    }
    /*--------------------Login--------------------*/

    ?>

    Therefore, when flash passes whatToDo variable with a sting value of ”login”, the code in EMI.php will execute the login function. By this way, we can write all the codes in one php file and call that php file from flash for every function of the EMI Application.

    The login script passes values into a variables in three different “if conditions”. We are going to pick the success condition with a little more work on it, because in the success state we are going to send the product data of EMI to the flash application from the EMI.txt file. So that if the login makes success it will load all the product data from the EMI.txt file into the EMI Mobile Application, otherwise it just send either of the other two state of values of their conditions, and flash will handle the rest.

    continue...

    marlopax


    Wednesday, November 25, 2009
    Last edited by marlopax; 11-24-2009 at 05:11 PM.

  9. #29
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Reading and loading data from a txt file by php

    PHP can open a txt file, read data from it and can write data into the txt file.
    Here, I will discus all the issues that need for the EMI application business.
    PHP opens a text file by the fopen() function which needs two parameters.

    1. The name of the file with extension
    2. The mode to open the file

    The possibilities of modes are in bellow

    Possible values:

    • "r" (Read only. Starts at the beginning of the file)
    • "r+" (Read/Write. Starts at the beginning of the file)
    • "w" (Write only. Opens and clears the contents of file; or creates a new file if it doesn't exist)
    • "w+" (Read/Write. Opens and clears the contents of file; or creates a new file if it doesn't exist)
    • "a" (Write only. Opens and writes to the end of the file or creates a new file if it doesn't exist)
    • "a+" (Read/Write. Preserves file content by writing to the end of the file)
    • "x" (Write only. Creates a new file. Returns FALSE and an error if file already exists)
    • "x+" (Read/Write. Creates a new file. Returns FALSE and an error if file already exists)

    PHP returns a line of a opened file by fgets() function. The feof() of PHP checks the end-of-file.

    Here I am going to discus, how php open a txt file on read mode and return each line until the end of the file.

    PHP code:

    $file = fopen("EMI.txt","r");
    while(!feof($file)){
    $data = fgets($file;
    echo $data;
    }

    Place this code in the success condition, so that it returns the product data after a successful login. It is better to put this code above the echo "&reason=Success&"; line because after loading the entire product data flash will receive the “success” value and proceed the pre-loader command.


    continue...

    marlopax


    Saturday, November 28, 2009

  10. #30
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Merry Christmas and Happy New Year to all

    Let us continue

    Now, we can discus how to build our registration form in Flash Lite 1.1 application. As we discus earlier that, for this application we are going to built the registration form with (First Name, Last Name, Sex, Age, Country, Email ID and User Name and Password) information. I used Frame Number 9 for registration form in this application and named the frame label “Register”. In this frame, built input variables text field for the above said information. Name each input text field var as the above-mentioned name. This is not mandatory to name as above (example: for First Name text field you can put “FName” or “FirstName” as var name to distinguish the input field, what will it for).

    To submit the request use one of the soft key. I used right soft Key as submit button and labeled “Submit”. I also used a cancel and back to start frame in left soft key labeled “Cancel”.

    KeyCatcher Button Script:

    on (keyPress "<PageDown>") {
    if (FName ne "" && LName ne "" && Age ne "" && Sex ne "" && Country ne "" && Email ne "" && UserName ne "" && Password ne "") {
    whatToDo = "Register";
    loadVariables("http://localhost/EMI.php", _root, "POST");
    gotoAndPlay("logLoop");
    }
    }
    on (keyPress "<PageUp>") {
    gotoAndStop("login");
    }


    continue...

    marlopax


    Tuesday, January 05, 2010
    Last edited by marlopax; 01-05-2010 at 02:20 PM.

  11. #31
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    MySQL, Relationship of database Table

    Database Relationship is a vast subject in database system, which I will discus latter, but for now, I want to give you a brief knowledge about the database relationship.

    Here, we will create two tables to store each user’s registration information. One is “login” table, which we already created in the early season, and the other is “user_information” table to store the detailed information of the users. To find out a particular user’s information you need a relationship column to relate with both the login and user_information tables. These columns must be unique in this case and both the columns in each table will hold the same unique data. In this case, userName will be the unique column for both of the tables to identify the particular information of a user.


    continue...


    marlopax


    Sunday, January 24, 2010

  12. #32
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Create “user_information” table:

    • Create a table in the same database named user_information.

    • Create required columns named First Name, Last Name, Sex, Age, Country, Email ID, Date and userName.

    userName column will be same as you did in the login table with Primary Key.

    • FirstName VARCHAR (40) user’s first name.

    • LastName VARCHAR (50) user’s last name.

    • Sex CHAR (10).

    • Age TINYINT (2) Attributes “UNSIGNED”.

    • Country VARCHAR (50).

    • Email VARCHAR (50) user’s e-mail address.

    • CreateDate DATE.


    Storing Data into Database:

    Storing data into database with php from Flash Lite 1.1 need the SQL code to INSERT into the database. The code bellow will generated from the phpadmin page from the localhost server page. You will get this option “Create PHP Code” after inserting a data from the Insert tab. You can follow both the code to know how php store data into the database table.

    Table user_information:

    $sql_01 = "INSERT INTO `db01sep2009mob_app`.`user_information` (`FName`, `LName`, `Age`, `Sex`, `Country`, `CreateDate`, `Email`, `userID`) VALUES (\'your first name\', \'your last name\', \'your age\', \'your sex\', \'your country\', \'date in this format 0000-00-00\', \'your email address\', \'your user name\');";

    Table login:

    $sql_02 = "INSERT INTO `db01sep2009mob_app`.`login` (`userID`, `Password`, `createDate`,`subscribe`) VALUES (\'your user name\', MD5(\'your password\'));";
    The above code will insert the data into two tables in the database “db01sep2009mob_app”.


    continue...

    marlopax


    Tuesday, January 26, 2010
    Last edited by marlopax; 02-15-2010 at 07:36 PM.

  13. #33
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Tables of a database

    There are many free books on web of this subject, to those who are not grew up with database and server side programming. However, the fundamental or basic reason is to manage data in an organized way so that the data can pull out much faster.

    Now, we have to write code in EMI.php file for the registration process so that the user data from flash lite application will save into the database.

    PHP Registration Code:

    if($whatToDo=="Register"){

    $userName=$_POST["UserName"];

    $Password=md5($_POST["Password"]);

    $FName=$_POST["FName"];

    $LName=$_POST["LName"];

    $Email=$_POST["Email"];

    $Age=$_POST["Age"];

    $Sex=$_POST["Sex"];

    $Country=$_POST["Country"];

    $Date=date('Y-m-d');



    mysql_connect ($host, $user, $pass);

    mysql_select_db ($database);

    $tableInfo="user_information";

    $tableLog="login";


    $resultInfo = mysql_query( "SELECT * FROM $tableInfo WHERE userID= '$userName'");

    $rowsInfo=mysql_num_rows($resultInfo);


    if($rowsInfo==1){

    echo"reason=This User Name has already taken.";

    }else{

    $resultInfo=mysql_query("INSERT $tableInfo SET
    FName = '$FNamex', LName= '$LName',Age='$Age',Sex='$Sex',Country='$Country', Email='$Email',CreateDate='$Date',userID= '$userName'");

    $resultLog=mysql_query("INSERT $tableLog SET userID= '$userName',Password= '$Password',createDate='$Date'");

    }

    }



    continue...


    marlopax


    Tuesday, February 16, 2010
    Last edited by marlopax; 02-15-2010 at 07:28 PM.

  14. #34
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Editing User Information:

    First of all, it is a thumb rule that an user has to login before editing the user information, and when user click to edit the information the form should filled up with the old entries from the database, so the user will able to change the right field.

    Therefore, to edit the user information the structure will be like this:

    1. Login before Edit

    2. When user clicks to edit, flash application will call a php script, which execute the old entries from the database of the particular userID into the flash form.

    3. When user saves the changes, the flash again call a php script, which will update the data into the database.

    4. Return success message to flash application.


    continue...

    marlopax

    Friday, February 26, 2010

  15. #35
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Edit Form and function:

    There is a big difference in logic on registration form and edit form. Registration form is a fresh blank from which every field has to fill up to register, whereas, in edit form user needs to know what is the past entries so that it will be easer to change the information to the users. It is also important which information the user is going to change. In this application, there are two types of information, the password information in login table of MySQL and the user’s personal information in the user_information table. Therefore, it is good to give the users an option of which data are going to edit. This will help to simplify the programming and error management part of mobile device as because you are going to retake the whole data into the database in two different tables, which may not return the proper error whether all the information has properly stored in both of the tables in the database. Therefore, it is better to edit one database table at a time to get better performance on mobile area.

    To create the option is simply to take a frame with two buttons in it, which will take to the right edit frame. But I decide to create the edit form using a movie clip which might be little complicated from the above process but you can reuse this edit movie clip as a Flash Lite 1.1 Edit Profile Component in other applications. In latter discussion, I will elaborate the process to reuse your creation as a component to save development time.

    To start with a movie clip edit profile system, take a frame after the registration frame. This is not necessary to take the edit frame just after the registration frame but here in this application I made this just after it. In this frame, draw a rectangle and quickly convert it into a movie clip by pressing F8 key, this rectangle will be the option window on the mobile screen when user click to edit the profile.

    Now, edit this movie clip and on the 1st frame put a stop(); action and on 2nd frame gotoAndStop(); action so that it will stick to the first “option” frame. Take two more frames, one for “change password” and other for “edit user information”. Draw a graphic button in the first frame of the Edit Profile movie clip and convert it in movie clip. Inside this button move clip make two select and non-select stages of the button graphics and put a stop(); action on the first frame in it. Copy the button movie clip and place after each options. The first option is to change password and the second is to change the user information. By dividing the task, it will be easy to work with database and php because I personally experimented in a very low bandwidth slow seed connection on Nokia N70 handset, which has Flash Lite 1.1 embedded player in it and it work fine. This is because of splitting the data for two different tasks.

    Some Experiences to be Share:

    We experimented on many devices, which have Flash Lite 1.1 embedded for network connectivity and data transfer. To grow our knowledge on this area, we tested many Flash Lite application and games downloaded from net. Including the sample application of many renowned companies, who are developing applications for mobile devices, and come to the conclusion to built applications on backend and keep the front end light as much as it can develop, with better look with extremely light in weight programming architecture.

    There is a chance for data loss in bad network condition but it can be consider for a better connectivity. Rather than that, Flash Lite performs quite good and fast on most of the devices we tested. It is always good to transfers the data as much short as it could be. Do not transfer huge data at a time from any application. It is better splitting your data for mobile applications, which helps to manage both the performance of the application and the memory management.

    After testing on some data transfer from Flash Lite 1.1 application continuously (more than fifty times) we feel the application run slow than earlier. However, it may not the cause of transferring data continuously but it may happen for the network condition also. Nevertheless, there is a good sign in Flash Lite that it automatically refreshes the memory or you can release memory from the heap by unload and null to variables. We had tested in very poor network condition on Nokia N70 and it worked.


    continue...


    marlopax


    Wednesday, March 03, 2010

  16. #36
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Extract data into Edit Profile:

    After a successful login, user will able to access the edit profile page/form in the flash application. There is a chance to take more information from your members, such as personal number, postal address etc. for that you have to construct some extra field in your database and some extra line script in php as required.

    It is not required to pull data to change password. You can directly check the old password from the login variable and can compare the password from the old one and it is the same process to check the new password with the confirm password variable. After the check with if ( ) { } else { } statement, flash can sent the new password into the database to replace from the old one through PHP.

    For editing of the personal data, it is necessary to extract the data from the database, and to do that the following PHP code will extract or to pull out the data/information into the edit profile input field.

    PHP Code:

    if($whatToDo=="Extract"){

    mysql_connect($host,$user,$pass);

    mysql_select_db($database);

    $table="user_information";

    $userName=$_POST[“userName”];

    $query = mysql_query("SELECT * FROM $table WHERE userID = '$userName'");

    $result = mysql_num_rows($query);

    $row=mysql_fetch_row($query);

    echo “&nData=".$result."&FirstName=".$row[0]."&LastName=".$row[1]."&Age=" .$row[2]."&Sex=".$row[3]."&Country=".$row[4]."&CreateDate=".date('m/d/Y',strtotime($row[5]))."&Email=".$row[6]. "&userName=".$row[7]."&";

    }


    “nData” an Extra Variable:

    In the echo part of the above php code, I use “nData” variable to send a value into flash, just for future work of EMI application. The “nData” variable sends the results of the query, means the number of rows found with the same userID, which is here always be “1” as the userID is unique and MySQL never store similar data in primary keys. Actually, this is a good habit to keep your thinking continuous towards the future of your applications. To do such things, which you can do in future, you have to keep options from the beginning. I must say that there is no end of future progress and development, but it not meant that every development had a complete plan from the beginning. Flexibility of changing things or adding new features is always been good for your work and to the business. Here, “nData” variable could help for FM (fraud Management), or to send the Error messages into your Flash Lite application. In future post, I will do something with this “nData” variable. For now just bother this extra bytes variable into your application.

    continue...

    marlopax


    Thursday, March 04, 2010
    Last edited by marlopax; 03-09-2010 at 05:48 PM.

  17. #37
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Now, the questions come around:

    How you are planning to give access to your users to edit their information. Will any users can able to destroy their information from database, or can able to change their names with just less than three letters or can submit an invalid Email ID. Many functions will possible with backend programming, even you can also do with front-end programming whenever it needed or as your application needs. The following Flash Lite front-end programming code will set the validation of the FName Input Text Field.

    Flash Lite Code:

    fscommand2("SetInputTextType", "FName", "Alpha");

    if (length(FName)<3) {

    FName="Invalid";

    }else if(FName eq "Invalid"){

    FName="";

    }else{

    FName=FName;

    }


    The Alpha in fscommand2 will only allow users to type only alphabets even it denies to type space. Therefore, nobody can type more then one word in this input text field. After all the validation, just fire the EMI.php by POST method and with whatToDo = “Edit”;. The following php code will update the data of the particular user.

    PHP Edit Profile Code:

    if($whatToDo=="Edit"){

    $userName=$_POST["userNameSent"];

    $FName=$_POST["FName"];

    $LName=$_POST["LName"];

    $Age=$_POST["Age"];

    $Sex=$_POST["Sex"];

    $Country=$_POST["Country"];

    $Email=$_POST["Email"];

    $Address=$_POST["Address"];

    $Mobile=$_POST["Mobile"];

    mysql_connect ($host, $user, $pass);

    mysql_select_db ($database);

    $table="user_information";

    $update = mysql_query("UPDATE $table SET FName = '$FName', LName ='$LName', Age = '$Age', Sex = '$Sex', Country ='$Country', Email = '$Email', Address ='$Address', Mobile = '$Mobile' WHERE userID= '$userName'");

    $result=mysql_affected_rows();

    if($result==1){

    echo "&result=Success&";

    }else{

    echo “&result=Error&”;

    }

    }


    continue...


    marlopax


    Friday, March 12, 2010

  18. #38
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Emi +

    For a professional mobile application, you need to build more and more dynamic with lots of scope in it, with full of features and multi-dynamic interaction, multi way communication to achieve the global business. EMI + is meant to build this simple Flash Lite 1.1 application into multi-dynamic application to reach its’ demand.

    On early EMI application discussion, we have an example of how to load text file data through php into Flash Lite. In the text file, we kept all the data of every company’s product with there prices, which shows as a list menu in EMI application. Its might not be a realistic approach that loads same data for different users in different locations or in different countries. For this type of EMI like application, it is always vary the prices of the product and companies in every states and countries. These applications are mainly building for the users those who work both for the product marketing and for loan department. Therefore, the focus of EMI Application Business mainly divided on three sectors (agent companies and developer), where the actual demand is. That means this is for networking business where this small application communicate with multi businesses.

    We will now discus on how to place small thoughts into big business. To make your most valuable ideas into a success, you have to build your application for global uses. Now, what is a global thought with this little application? The answer is very simple, your business and application plan should be flexible to use in every countries and in every applicable companies.

    EMI + focus on Global Business

    1. Client - - Person who are going for the Loan

    2. Agent - - Person who sell the product to the Client

    3. Product Manufacturing Company - - Who give agency to the Agent to sale their products

    4. Loan Provider or Bank - - Who give the loan to the Client through the Agent

    5. Application Developer - - Who provides the software application


    The above sectors are the areas where the flexibility of EMI application reaches on global business. That means a single application can have the ability to use anywhere it needed with every features and components. The focus features are to store data of all areas and short out data or information of different areas as needed. We are going to create an agency component in EMI applications where the agent can browse the companies according to there location and countries and get agency by registering to them. Here, your goal is vast because you can build your application as an individual independent application from where the agent can choose both the loan provider and the product company for the agency. Somehow, I assume that the EMI Application have collaboration with both the loan providers and the product manufacturers, and have a big lists of them for every countries, and from there site they can have access to your database or your domain to update or insert their product information. This collaboration is a big issue in this EMI global business. As many you have associates with the companies you will make that much of company lists for the agents. Thus, an agent will more benefited with your applications and the client can choose as there requirement.

    continue...

    marlopax


    Wednesday, March 24, 2010

  19. #39
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Agency Component in Flash Lite 1.1 PHP & MySQL:

    To start with this section of EMI +, you need separate tables in your database to put the name and descriptions and the other information of the associate companies. For the EMI discussions I have create tables in the same database.

    Company List database table:

    • Create a company list table, named – company_list

    • Create three columns to hold the name, country and company’s information data

    • Name VARCHAR (100) – the name of the company must be unique.

    • CompanyCode CHAR (20), Primary Key – code number of company

    • CompanyInfo VARCHAR (255) – brief information about the company


    Insert some company’s name, some unique company code and other information in it.

    Create another table for the agent.

    Agent List database table:

    • Create a agent list table, named – agent_list

    • Create five columns in the agent_list table

    • userID VARCHAR (50) – for user’s ID

    • Agency VARCHAR (100) – for the name of the company

    • agencyDate Date – create date of the agency

    • agencyCode VARCHAR (10), Primary Key – the agency code column holds the primary key for this agent list table.

    • agentArea VARCHAR (50) – the location of the agent


    Leave the agent list database empty, mean do not insert any data in it. Create another table named company_locate, which holds the information of which location the company have its businesses.

    Company Location database table:

    • Create a company location table, named – company_location

    • Create three columns in it

    • CompanyCode CHAR (20) – in this table it will not be a primary key

    • CountryCode CHAR (10) – it stores the code of the country

    • CountryName VARCHAR (50) – the name of the country


    In this data table, we will store the country code, company code and the name of countries. One thing keeps in mind to buildup any database is not to store unnecessary data or never construct data table columns that have no use. That will confuse your purposes and occupies space in your database. As here in this company location table, I create a column to hold the name of the countries, which will unnecessary, to get a query of a particular company location you need only the country code. However, you might have some other plan to use the data in the country column.


    continue...

    marlopax


    Thursday, March 25, 2010
    Last edited by marlopax; 03-25-2010 at 04:54 AM.

  20. #40
    Senior Member
    Join Date
    Aug 2006
    Posts
    322

    Country Code datable named “country_code”:

    Create another data table to store the country code and country name. Stop creating this manually, because we are going to talk about how to create a database table through php. In this discussion, you will know/learn how to create table and columns in it and how to insert huge data from a text file into MySQL database through PHP.

    To create a table in a database with PHP, we need to connect the database first, then to select the database and then to create the table with a name of that table. At first, we have to create a well format data in a text file with .txt extension, which we can easily use notepad to do this and save the text file in www root folder. The data we are going to store into the text file is only the country code and the country name, which will structure like the following example; you can also download the entire data in .txt format here:

    http://www.marlopax.com/countryCode/countryCode.txt

    Text File data structure:

    AC:Ascension Island
    AF:Afghanistan
    AL:Albania


    continue...


    marlopax



    Friday, April 09, 2010

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