|
Lab 7 (Due 11:00 PM Friday)
|
Materials to turn in on the server
- In your Lab07 folder:
- Lab07part1.fla (liquid GUI)
- Lab07part1.swf (liquid GUI)
- Lab07part2.php (hard-coded Flash, MySQL Database, & PHP)
- Lab07part2.fla (hard-coded Flash, MySQL Database, & PHP)
- Lab07part2.swf (hard-coded Flash, MySQL Database, & PHP)
- Lab07SQL.php (PHP code that connects to MySQL database)
- Lab07part3.php (Flash, MySQL Database, PHP with UI)
- Lab07part3.fla (Flash, MySQL Database, PHP with UI)
- Lab07part3.swf (Flash, MySQL Database, PHP with UI)
Students will learn to create a liquid GUI as well as send/receive information from a PHP that connects to a database.
- Liquid GUI
- Download or open this sample swf - try resizing it
- Create 4 layers: ActionScript, Header, Body, Footer
- Add header elements (design and text), convert to symbol, but do NOT export for AS
- After converting to symbol, be sure to name the instance in the properties panel
- Repeat for footer
- Repeat for body
- Then add this code on frame 1 of the ActionScript layer
- Obviously, the more elements you add to your fla, the more complex this code will become.
- Flash communicating with PHP and a MySQL Database
- PhpMyAdmin
- Login to PhpMyAdmin here (login & password are case-sensitive)
- Login: FlashLab9
- Pass: php
- Navigate around > learn how to see new entries in the table > make sure you are looking at the most recently added items
- PHP
(Lab07SQL.php)
- Start with this base PHP code > we'll modify it.
- First, modify it to look like this PHP code
- Save or Copy the PHP to your server space
- Navigate to the PHP in the web browser (type the URL out)
- The only thing you should see when the page loads is a SQL statement
- Check PhpMyAdmin to see if your entry is there
- Once that works, modify it to look like this PHP code
- You will not be able to check this new code until the Flash part is complete.
- Flash (Lab07part2.fla)
- On the stage
- Put a large textbox, roughly 20 tall by 700 wide, instance name: results
- Add other text on the stage with your name and lab number
- In the ActionScript
- On frame one, add ActionScript code similar to this
- NOTE:
- To get this to work while you are building it on your computer, you will need to use the full URL, like: http://cgtweb3.tech.purdue.edu/353/<yourFolder>/Lab07/Lab07SQL.php
- To get this to work after it is placed on the server and you navigate to it in the browser, you will need to replace the full URL with only the name of the php, like: Lab07SQL.php
- Publish it - make sure the html is generated > rename it to Lab07part2.php
- Copy all the files to the server space
- Navigate to the PHP in the web browser (type the URL out)
- If it works correctly, Flash should display the SQL statement containing the text you hard-coded into ActionScript.
- Check PhpMyAdmin to see if your entry is there
- Here is a link to a working solution
- Add a User Interface to the Flash/DB/PHP exercise
- PhpMyAdmin
- You will continue to use PhpMyAdmin like you did in part 2.
- PHP
- You will continue to use Lab07SQL.php for this exercise. It will not need any modification.
- Flash (Lab07part3.fla)
- Copy the part2 Flash file and rename it to Lab07part3.
- Leave the results textbox alone
- Add textbox labels for evalID, name, score, and comments
- Add editable textboxes for users to type into:
- Make sure each textbox has an instance name: tbEvalID, tbName, tbScore, tbComments
- Add a submit button, give it an instance name: btnSubmit
- On frame 1, add ActionScript code similar to this
- Publish it - make sure the html is generated > rename it to Lab09part3.php
- Copy all the files to the server space
- Navigate to the PHP in the web browser (type the URL out)
- If it works correctly, you should be able to type data into the four textboxes and Flash should refresh the results textbox to display the SQL statement containing the text you just typed.
- Check PhpMyAdmin to see if your entry is there
- Here is a link to a working solution
Grading
Part 1 |
5 pts |
Part 2 |
5 pts |
Part 3 |
5 pts |
Total Possible |
15 pts |
|
|
| |