02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 14.8 Setting user permissions<br />

Chapter 14: Quizzes<br />

You now have a database that the user ‘quiz’ can access <strong>to</strong> select rows from the table ‘quiz’,<br />

update the data s<strong>to</strong>red there and insert new rows.<br />

Inputting the data<br />

To make the inputting of data easy we will create a <strong>Flash</strong>-based input <strong>to</strong>ol. Open<br />

‘Examples\Chapter14\createquiz.fla’. This project uses the new <strong>Flash</strong> components <strong>to</strong> create a<br />

<strong>to</strong>ol that allows the developer <strong>to</strong> read and update the database. Access <strong>to</strong> the database is via ASP<br />

pages. ASP pages can run on your local machine if it is set up as an IIS, Internet Information<br />

Server, or you can run them on a remote server. Before we look at how the ‘createquiz.fla’ project<br />

works we will look at the ASP pages it uses.<br />

Connecting <strong>to</strong> the database using ASP<br />

When using a database the first thing we must do is <strong>to</strong> connect <strong>to</strong> it. Because all our pages will<br />

use it, we will put this code in a file that can be included in all the other files. As well as creating<br />

the connection <strong>to</strong> the database the code snippet includes the definitions of a few constants that<br />

will be used by other pages. ‘adCmdText’, ‘adCmdTable’ and ‘adCmdS<strong>to</strong>redProc’ are just useful<br />

211

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!