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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> <strong>Games</strong><br />

32 str += ("D" + i + "=" + rs.Fields.Item(6).Value + "&");<br />

33 rs.moveNext();<br />

34 i++;<br />

35 }<br />

36 str += ("questionTotal=" + i + "&loaded=1&");<br />

37 Response.Write(str);<br />

38<br />

39 rs.Close();<br />

40 conn.Close();<br />

41<br />

42 %><br />

Listing 14.5<br />

Getting a list of all categories<br />

The last script we will look at returns all the categories in the database, useful for creating the<br />

input engine. Much of the methodology will be familiar. The new feature is the use of the term<br />

‘DISTINCT’ which ensures that only one record for each instance is returned; if there are 25<br />

records in the ‘sport’ category only a single record ‘sport’ is returned <strong>to</strong> the recordset. The data is<br />

passed back <strong>to</strong> <strong>Flash</strong> using the MIME-encoded string method.<br />

1 <br />

2<br />

3 <br />

9 <br />

10

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

Saved successfully!

Ooh no, something went wrong!