<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>Fun Flow Studios</title>
	<atom:link href="http://funflowstudios.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://funflowstudios.com</link>
	<description>A blog about flash games</description>
	<pubDate>Thu, 12 Nov 2009 00:27:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Game: Alien SOS</title>
		<link>http://funflowstudios.com/?p=43</link>
		<comments>http://funflowstudios.com/?p=43#comments</comments>
		<pubDate>Thu, 12 Nov 2009 00:27:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://funflowstudios.com/?p=43</guid>
		<description><![CDATA[Alien SOS is a new game developed by me (programming and concept) and richard postelnicu (artwork and testing)
It is fun strategy game where you have to guide an alien back to its space spaceship by removing and adding blocks of the game, Alien SOS had been in development since the summer, although about half the [...]]]></description>
			<content:encoded><![CDATA[<p>Alien SOS is a new game developed by me (programming and concept) and richard postelnicu (artwork and testing)</p>
<p>It is fun strategy game where you have to guide an alien back to its space spaceship by removing and adding blocks of the game, Alien SOS had been in development since the summer, although about half the time was waiting for sponsorship and getting the deal finalized.<br />
It&#8217;s probaly my favourite game out of the ones i&#8217;ve made and I also had a lot of fun developing it.</p>
<p>Here&#8217;s a preview image:<br />
<img src="http://funflowstudios.com/wp-content/uploads/2009/11/fun-253x300.jpg" alt="gamePoster" title="gamePoster" width="253" height="300" class="alignnone size-medium wp-image-44" /></p>
<p>Out in a couple of days!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=43</wfw:commentRss>
		</item>
		<item>
		<title>The Super Click Tester</title>
		<link>http://funflowstudios.com/?p=28</link>
		<comments>http://funflowstudios.com/?p=28#comments</comments>
		<pubDate>Thu, 12 Mar 2009 22:41:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://funflowstudios.com/?p=28</guid>
		<description><![CDATA[Sorry for the lack of posts for last month, We&#8217;ve been quite busy developing a new game that will be be released within the next few months, meanwhile here&#8217;s a small game that we created in a bit less than a day.
It was sponsored by minijuegos.com for a primary license meaning that I can still [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry for the lack of posts for last month, We&#8217;ve been quite busy developing a new game that will be be released within the next few months, meanwhile here&#8217;s a small game that we created in a bit less than a day.<br />
It was sponsored by minijuegos.com for a primary license meaning that I can still sell sitelocked versions after its release.</p>
<p><a href="http://www.minijuegos.com/juegos/jugar.php?id=7751" target="_blank"><img src="http://www.minijuegosgratis.com/imgs/superclicktester.gif" border="0" width="104" height="70" align="left" /><strong>Super Click Tester</strong></a><br />Test your clicking skills and see how fast you can click, the super clicker measures your time and works out your click speed per second. Can you beat the average of 10?<br />
<br/><br />
You can also get the facebook app <a href="http://apps.facebook.com/superclick">here</a>. I&#8217;ll be making a tutorial on how to make a facebook app exactly like this pretty soon <img src='http://funflowstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=28</wfw:commentRss>
		</item>
		<item>
		<title>Making money with flash games</title>
		<link>http://funflowstudios.com/?p=12</link>
		<comments>http://funflowstudios.com/?p=12#comments</comments>
		<pubDate>Wed, 21 Jan 2009 23:01:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://funflowstudios.com/?p=12</guid>
		<description><![CDATA[Quick guide to making money with flash games]]></description>
			<content:encoded><![CDATA[<p>Over the last two years the flash industry has changed dramatically, thanks to a few websites; small flash games have become a massive business that keeps on growing, this is largely because of the increase in portals/competition, high quality games and more people going online for flash games. A few years ago the only way to make money on a flash game was to find a sponsor, it would require e-mailing alot of the popular portals and most of time you would not even get a response or if you did the sponsorship offer wouldn&#8217;t be that much and not really worth it.<br />
This is a post to show some of the ways you can make some money on your game.</p>
<p><strong>Sponsorship:</strong></p>
<p>Usually the most you can make on a game is through sponsorship, The easiest way of searching for a sponsor is to head to <a href="http://www.flashgamelicense.com/">Flash Game License</a> and sign up, then you just submit your game and get it in front of almost 1000 sponsors. Of course your game must be quite decent to get any sponsership offers at all, but what is great about the site is that you do not have to upload your finished version, you can ask for feedback from other developers while you are in the game making process for feedback on different parts of your game. Once the game is complete and ready to be seen by sponsors, usually you wait for about 2 weeks to a month for an offer. Being patient helps.</p>
<p>You can also send a load of emails to as many portals as possible, the e-mail should ask the sponsor if they would consider the game for sponsorship and provide a link to a version of your game. You might not get a response from the popular portals, but it helps widen your chance of getting seen.</p>
<p>If you do not get a sponsor, It&#8217;s not the worst thing in the world, actually it can be a good thing, this means you are completely free with what you do with the game and means you can self sponsor for your website.</p>
<p><strong>Mochiads:</strong></p>
<p>Mochiads is a flash ad network, a great way to make money by displaying an advertisement while your player is waiting for the game to load, you can place ads wherever you want in the game. All you need to do to use this service is to sign up to <a href="mochiads.com">Mochiads</a> and click add game, you just need to follow the instructions and insert a small amount of code. Once you&#8217;ve done this you enter a few details about the game and wait for your game to get approved for paying ads. There are a few problems however with Mochiads, the amount of money you get for the eCPM (1000 ad impressions) differs on the country your game gets played in, for instance create your own TD got 20,000 views in Korea, due to there low eCPM I only got $0.20 however the same amount of ad impressions in the USA makes about $10. Another problem with Mochiads is that you only get payed every $100 which can take a very long time. </p>
<p>Games with sponsorships can also use Mochiads, but it depends on the type of deal you make and how flexible the buyer is. </p>
<p><strong>Kongregate</strong></p>
<p><a href="http://kongregate.com">Kongregate</a> is a flash game website, it does not allow any of the games on the site to show ads such as mochiads, this is because they have their own ad revenue program. the eCPM is very good and does not take that many views to get your first $25, usually around 25,000 views which isn&#8217;t that bad and is easier to get payed. There are also other sites that do an ad revenue program like this but Kongregate is most popular.</p>
<p>Good Luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>Flash login screen with PHP and mySQL - In AS3</title>
		<link>http://funflowstudios.com/?p=9</link>
		<comments>http://funflowstudios.com/?p=9#comments</comments>
		<pubDate>Sat, 06 Dec 2008 22:03:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[AS3]]></category>

		<category><![CDATA[Create]]></category>

		<category><![CDATA[flow]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[ip adress]]></category>

		<category><![CDATA[login]]></category>

		<category><![CDATA[mySQL]]></category>

		<category><![CDATA[Screen]]></category>

		<category><![CDATA[studios]]></category>

		<guid isPermaLink="false">http://funflowstudios.com/?p=9</guid>
		<description><![CDATA[In my previous post I created a login screen in AS2 however in this version we&#8217;ll be creating one in AS3, which seems slightly faster, however a bit more complicated. I&#8217;ve also changed the create account script to add the ip address of the user.
Having the ip of users is useful to track down cheaters [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post I created a login screen in AS2 however in this version we&#8217;ll be creating one in AS3, which seems slightly faster, however a bit more complicated. I&#8217;ve also changed the create account script to add the ip address of the user.<br />
Having the ip of users is useful to track down cheaters of your game. You can use an ip ban to stop the cheater playing your game, I&#8217;ll cover this in a later tutorial&#8230;</p>
<p>This tutorial is pretty much exactly the same as the last one(except for the script changes), So this tutorial assumes you have a way of testing out PHP and mySQL scipts, however if you need to know how to setup PHP refer back to the last login tutorial.</p>
<p>This is what we&#8217;ll be making&#8230;</p>
<p><object width="300" height="200"><param name="movie" value="http://funflowstudios.com/flash/loginAS3.swf"><embed src="http://funflowstudios.com/flash/loginAS3.swf" width="300" height="200"></embed></object></p>
<p>It basically the exact same thing as the last one.</p>
<p>Getting started:</p>
<p><strong>Step 1: Creating the flash document</strong></p>
<p>Create a new flash file, select a new flash document AS 3.0.<br />
Save this file and call it something like &#8216;login.php&#8217;</p>
<p>firstly, change the document class to &#8216;login&#8217;.</p>
<p>Now add the &#8216;Button&#8217; and &#8216;textInput&#8217; component to your library, these are what we will be using as our buttons and the user&#8217;s text inputs.</p>
<p>Now add a new font to your library (this will be the main font you will use), you can do this by clicking on the top right of you library and pressing New Font, choose the font you want and change the linkage or Class to mainFont.</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/fontPic.png" alt="font pic" /></p>
<p><strong>Step 2: Actionscript file</strong></p>
<p>That&#8217;s the flash document set up, now for the class file.</p>
<p>Now create a new actionscript file, save it in the same directory as the flash file.</p>
<p>add this to the that actionscript file, you might need to change lines 30 and 31 to where you have put the PHP files:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
</pre></td><td class="code"><pre class="actionscript actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">controls</span>.<span style="color: #0066CC;">Button</span>;
	<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">controls</span>.<span style="color: #006600;">TextInput</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">IOErrorEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLLoader</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequest</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLVariables</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequestMethod</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> login <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> login<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">//creating components variables</span>
			<span style="color: #000000; font-weight: bold;">var</span> submitButton:<span style="color: #0066CC;">Button</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Button</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> createAccountButton:<span style="color: #0066CC;">Button</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Button</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//font vars</span>
			<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">font</span>:mainFont = <span style="color: #000000; font-weight: bold;">new</span> mainFont<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">textFormat</span>:<span style="color: #0066CC;">TextFormat</span>=<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//text input component vars</span>
			<span style="color: #000000; font-weight: bold;">var</span> userTextInput:TextInput = <span style="color: #000000; font-weight: bold;">new</span> TextInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> passTextInput:TextInput = <span style="color: #000000; font-weight: bold;">new</span> TextInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//text vars</span>
			<span style="color: #000000; font-weight: bold;">var</span> userText:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> passText:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> mainTitle:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> statusText:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//insert the url for your pages</span>
			<span style="color: #000000; font-weight: bold;">var</span> loginURL:URLRequest=<span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://localhost/login.php&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> cUserURL:URLRequest=<span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://localhost/newAccount.php&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//loader and vars</span>
			<span style="color: #000000; font-weight: bold;">var</span> pageLoader:URLLoader = <span style="color: #000000; font-weight: bold;">new</span> URLLoader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> pageVars:URLVariables = <span style="color: #000000; font-weight: bold;">new</span> URLVariables<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//adding to stage</span>
			addChild<span style="color: #66cc66;">&#40;</span>submitButton<span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>createAccountButton<span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>userTextInput<span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>passTextInput<span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>userText<span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>passText<span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>mainTitle<span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>statusText<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//adding event listeners to our loading pages</span>
			pageLoader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, loadPageSuccessful<span style="color: #66cc66;">&#41;</span>;
			pageLoader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>IOErrorEvent.<span style="color: #006600;">IO_ERROR</span>, loadPageError<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//submit button properties + event listener</span>
			submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
			submitButton.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">170</span>;
			submitButton.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">170</span>;
			submitButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,buttonListener<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//Create Account button properties + event listener</span>
			createAccountButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Create Account&quot;</span>;
			createAccountButton.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">20</span>;
			createAccountButton.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">170</span>;
			createAccountButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,buttonListener<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">//username input text properties</span>
			userTextInput.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">150</span>, <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
			userTextInput.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">90</span>;
			userTextInput.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">50</span>;
			userTextInput.<span style="color: #0066CC;">maxChars</span>=<span style="color: #cc66cc;">25</span>;
			<span style="color: #808080; font-style: italic;">//gives protection from SQL injections</span>
			userTextInput.<span style="color: #0066CC;">restrict</span>=<span style="color: #ff0000;">&quot;a-zA-Z0-9_&quot;</span>;
			<span style="color: #808080; font-style: italic;">//password input text properties</span>
			passTextInput.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">150</span>, <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
			passTextInput.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">90</span>;
			passTextInput.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">90</span>;
			passTextInput.<span style="color: #006600;">displayAsPassword</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			passTextInput.<span style="color: #0066CC;">maxChars</span>=<span style="color: #cc66cc;">25</span>;
			<span style="color: #808080; font-style: italic;">//gives protection from SQL injections</span>
			passTextInput.<span style="color: #0066CC;">restrict</span>=<span style="color: #ff0000;">&quot;a-zA-Z0-9_&quot;</span>;
			<span style="color: #808080; font-style: italic;">//creating main font</span>
			<span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">font</span>=<span style="color: #0066CC;">font</span>.<span style="color: #006600;">fontName</span>;
			<span style="color: #0066CC;">textFormat</span>.<span style="color: #0066CC;">size</span>=<span style="color: #cc66cc;">12</span>;
			<span style="color: #808080; font-style: italic;">//setting user text properties</span>
			userText.<span style="color: #006600;">defaultTextFormat</span>=<span style="color: #0066CC;">textFormat</span>;
			userText.<span style="color: #0066CC;">selectable</span>=<span style="color: #000000; font-weight: bold;">false</span>;
			userText.<span style="color: #0066CC;">embedFonts</span>=<span style="color: #000000; font-weight: bold;">true</span>;
			userText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;username:&quot;</span>;
			userText.<span style="color: #0066CC;">width</span>=<span style="color: #cc66cc;">70</span>;
			userText.<span style="color: #0066CC;">height</span>=<span style="color: #cc66cc;">12</span>;
			userText.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">50</span>;
			userText.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">10</span>;
			<span style="color: #808080; font-style: italic;">//setting password text properties</span>
			passText.<span style="color: #006600;">defaultTextFormat</span>=<span style="color: #0066CC;">textFormat</span>;
			passText.<span style="color: #0066CC;">selectable</span>=<span style="color: #000000; font-weight: bold;">false</span>;
			passText.<span style="color: #0066CC;">embedFonts</span>=<span style="color: #000000; font-weight: bold;">true</span>;
			passText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;password:&quot;</span>;
			passText.<span style="color: #0066CC;">width</span>=<span style="color: #cc66cc;">70</span>;
			passText.<span style="color: #0066CC;">height</span>=<span style="color: #cc66cc;">12</span>;
			passText.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">90</span>;
			passText.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">10</span>;
			<span style="color: #808080; font-style: italic;">//setting mainTitle text properties</span>
			mainTitle.<span style="color: #006600;">defaultTextFormat</span>=<span style="color: #0066CC;">textFormat</span>;
			mainTitle.<span style="color: #0066CC;">autoSize</span>=TextFieldAutoSize.<span style="color: #006600;">CENTER</span>;
			mainTitle.<span style="color: #0066CC;">selectable</span>=<span style="color: #000000; font-weight: bold;">false</span>;
			mainTitle.<span style="color: #0066CC;">embedFonts</span>=<span style="color: #000000; font-weight: bold;">true</span>;
			mainTitle.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
			mainTitle.<span style="color: #0066CC;">width</span>=<span style="color: #cc66cc;">200</span>;
			mainTitle.<span style="color: #0066CC;">height</span>=<span style="color: #cc66cc;">24</span>;
			mainTitle.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">10</span>;
			mainTitle.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">120</span>;
			<span style="color: #808080; font-style: italic;">//setting the status text properties</span>
			statusText.<span style="color: #006600;">defaultTextFormat</span>=<span style="color: #0066CC;">textFormat</span>;
			statusText.<span style="color: #0066CC;">selectable</span>=<span style="color: #000000; font-weight: bold;">false</span>;
			statusText.<span style="color: #0066CC;">embedFonts</span>=<span style="color: #000000; font-weight: bold;">true</span>;
			statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Please log in&quot;</span>;
			statusText.<span style="color: #0066CC;">width</span>=<span style="color: #cc66cc;">260</span>;
			statusText.<span style="color: #0066CC;">height</span>=<span style="color: #cc66cc;">50</span>;
			statusText.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">120</span>;
			statusText.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">20</span>;
			<span style="color: #808080; font-style: italic;">//login function</span>
			<span style="color: #000000; font-weight: bold;">function</span> checkLogin<span style="color: #66cc66;">&#40;</span>user,pass<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>user<span style="color: #66cc66;">!</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&amp;&amp;</span>pass<span style="color: #66cc66;">!</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;loading...&quot;</span>;
					userTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">false</span>;
					passTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">false</span>;
					pageVars.<span style="color: #006600;">user</span>=user;
					pageVars.<span style="color: #006600;">pass</span>=pass;
					<span style="color: #808080; font-style: italic;">//telling the loginURL it wants to use the post method of sending vars</span>
					loginURL.<span style="color: #006600;">method</span>=URLRequestMethod.<span style="color: #006600;">POST</span>;
					<span style="color: #808080; font-style: italic;">//attaching vars to to the loginURL</span>
					loginURL.<span style="color: #0066CC;">data</span>=pageVars;
					<span style="color: #808080; font-style: italic;">//loading the url</span>
					pageLoader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>loginURL<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
					statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;One of the text fields are empty&quot;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #808080; font-style: italic;">//function that runs when the Create user button is pressed</span>
			<span style="color: #000000; font-weight: bold;">function</span> newAccount<span style="color: #66cc66;">&#40;</span>user,pass<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">//is there is text in both fields send out data</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>user<span style="color: #66cc66;">!</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&amp;&amp;</span>pass<span style="color: #66cc66;">!</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;loading...&quot;</span>;
					userTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">false</span>;
					passTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">false</span>;
					pageVars.<span style="color: #006600;">user</span>=user;
					pageVars.<span style="color: #006600;">pass</span>=pass;
					<span style="color: #808080; font-style: italic;">//telling the loginURL it wants to use the post method of sending vars</span>
					cUserURL.<span style="color: #006600;">method</span>=URLRequestMethod.<span style="color: #006600;">POST</span>;
					<span style="color: #808080; font-style: italic;">//attaching vars to to the loginURL</span>
					cUserURL.<span style="color: #0066CC;">data</span>=pageVars;
					<span style="color: #808080; font-style: italic;">//loading the url</span>
					pageLoader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>cUserURL<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
					statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;One of the text fields are empty&quot;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #808080; font-style: italic;">//page load success listener function</span>
			<span style="color: #000000; font-weight: bold;">function</span> loadPageSuccessful<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span> newVars:URLVariables=<span style="color: #000000; font-weight: bold;">new</span> URLVariables<span style="color: #66cc66;">&#40;</span>pageLoader.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
				userTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
				passTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>mainTitle.<span style="color: #0066CC;">text</span>==<span style="color: #ff0000;">&quot;Create Account&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">'Create User'</span>;
					<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>newVars.<span style="color: #006600;">accountStatus</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
						<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'success'</span> :
						statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">'Account Created'</span>;
						mainTitle.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
						submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
						createAccountButton.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
							<span style="color: #b1b100;">break</span>;
						<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'username'</span> :
							statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">'Username already exists'</span>;
							<span style="color: #b1b100;">break</span>;
					<span style="color: #66cc66;">&#125;</span>
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>mainTitle.<span style="color: #0066CC;">text</span>==<span style="color: #ff0000;">&quot;Log In&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">'Log In'</span>;
					<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>newVars.<span style="color: #006600;">loginStatus</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
						<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'success'</span> :
						statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">'You are now logged in!'</span>;
						mainTitle.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Welcome &quot;</span>+userTextInput.<span style="color: #0066CC;">text</span>+<span style="color: #ff0000;">&quot;.&quot;</span>;
						submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Back&quot;</span>;
						userTextInput.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
						passTextInput.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
						userText.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
						passText.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
						createAccountButton.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
							<span style="color: #b1b100;">break</span>;
						<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'username'</span> :
							statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">'that username does not exist'</span>;
							<span style="color: #b1b100;">break</span>;
						<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'password'</span> :
							statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">'incorrect password'</span>;
							<span style="color: #b1b100;">break</span>;
					<span style="color: #66cc66;">&#125;</span>
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #808080; font-style: italic;">//page load error listener function</span>
			<span style="color: #000000; font-weight: bold;">function</span> loadPageError<span style="color: #66cc66;">&#40;</span>$evt:IOErrorEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;There is an error on our server&quot;</span>;
				userTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			    passTextInput.<span style="color: #0066CC;">enabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #808080; font-style: italic;">//button click listener function</span>
			<span style="color: #000000; font-weight: bold;">function</span> buttonListener<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">label</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;Log In&quot;</span> :
						checkLogin<span style="color: #66cc66;">&#40;</span>userTextInput.<span style="color: #0066CC;">text</span>,passTextInput.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">break</span>;
					<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;Create Account&quot;</span> :
						statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;&quot;</span>;
						event.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;back&quot;</span>;
						mainTitle.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Create Account&quot;</span>;
						submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Create User&quot;</span>;
						<span style="color: #b1b100;">break</span>;
					<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;Create User&quot;</span> :
						newAccount<span style="color: #66cc66;">&#40;</span>userTextInput.<span style="color: #0066CC;">text</span>,passTextInput.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">break</span>;
					<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;back&quot;</span> :
						statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Please log in&quot;</span>;
						mainTitle.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
						submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
						createAccountButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Create Account&quot;</span>;
						<span style="color: #b1b100;">break</span>;
					<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;Back&quot;</span> :
						statusText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Please log in&quot;</span>;
						mainTitle.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
						submitButton.<span style="color: #006600;">label</span>=<span style="color: #ff0000;">&quot;Log In&quot;</span>;
						userText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;username:&quot;</span>;
						passText.<span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;password:&quot;</span>;
						createAccountButton.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
						passTextInput.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
						userTextInput.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
						<span style="color: #b1b100;">break</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Test the code out by testing the movie, if this works you can continue onto the next section.</p>
<p><strong>Step 3: mySQL database</strong></p>
<p>To use the PHP scripts you&#8217;ll need to set up your database.<br />
Create a new database, call it something like &#8216;users&#8217; or something along those lines.<br />
Use this code to create a new table within that database.</p>
<p> CREATE TABLE `users`.`users` (<br />
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,<br />
`username` VARCHAR( 25 ) NOT NULL ,<br />
`password` VARCHAR( 32 ) NOT NULL ,<br />
`ip` VARCHAR( 20 ) NOT NULL<br />
) ENGINE = MYISAM</p>
<p><strong>Step 4: PHP files</strong></p>
<p>Now create your PHP files.</p>
<p>Create one called login.php and add this, you&#8217;ll have to change the database details to your settings:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//enter mySQL details</span>
<span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="">'localhost'</span><span style="color: #339933;">,</span> <span style="">'your_username'</span><span style="color: #339933;">,</span> <span style="">'your_password'</span><span style="color: #009900;">&#41;</span>
or <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Could not connect to mysql because &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//database</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="">'your_db'</span><span style="color: #009900;">&#41;</span>
or <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Could not select database because &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="">'your_table'</span>;
<span style="color: #666666; font-style: italic;">//collecting the sent vars</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'user'</span><span style="color: #009900;">&#93;</span>;
<span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'pass'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$userQuery</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT id FROM $table WHERE username = '$user'&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//checking if username exists</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$userQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;loginStatus=username&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">exit</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//checking if the password is right</span>
<span style="color: #000088;">$passQuery</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM $table WHERE username = '$user' AND password = '$pass'&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$passQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;loginStatus=password&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">exit</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//success message</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;loginStatus=success&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>and create another file called newAccount.php</p>
<p>add this, again you&#8217;ll have to change the database settings:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//enter mySQL details</span>
<span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="">'localhost'</span><span style="color: #339933;">,</span> <span style="">'your_username'</span><span style="color: #339933;">,</span> <span style="">'your_password'</span><span style="color: #009900;">&#41;</span>
or <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Could not connect to mysql because &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//database</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="">'your_db'</span><span style="color: #009900;">&#41;</span>
or <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Could not select database because &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="">'your_table'</span>;
<span style="color: #666666; font-style: italic;">//checking if username exists</span>
<span style="color: #000088;">$userQuery</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT id FROM $table WHERE username = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//if username is used the var accountstatus gets sent back with username</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$userQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;accountStatus=username&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">exit</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//inserting values in to the database and adding md5 encryption to password</span>
<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;INSERT into $table (username,password,ip) VALUES ('&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;','&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'pass'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;','&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">getenv</span><span style="color: #009900;">&#40;</span><span style="">'REMOTE_ADDR'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;')&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;accountStatus=success&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;end=end&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>and that&#8217;s it. Just test that it works and it should be done!</p>
<p>If you have any problems here are the <a href="http://www.mediafire.com/download.php?nw2h3dniyug">source files</a></p>
<p>Enjoy <img src='http://funflowstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Fupa Kingdoms defense (create your own TD 1.6)</title>
		<link>http://funflowstudios.com/?p=8</link>
		<comments>http://funflowstudios.com/?p=8#comments</comments>
		<pubDate>Mon, 24 Nov 2008 19:59:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Fun Flow Studios]]></category>

		<category><![CDATA[Games]]></category>

		<category><![CDATA[Create Your Own Tower Defence 1.6]]></category>

		<category><![CDATA[flow]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[Fupa Kingdoms Defense]]></category>

		<category><![CDATA[Game]]></category>

		<category><![CDATA[studios]]></category>

		<guid isPermaLink="false">http://funflowstudios.com/?p=8</guid>
		<description><![CDATA[The new version of create your own TD is out and has been completely reworked
Here are just some of the improvements&#8230;
Profiles
user rankings
search bar
You can save up to three maps
Highscores table for every map
200+ tiles
you can add a map you made to your website
30 waypoints
And alot more!
You can play the full version here
Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>The new version of create your own TD is out and has been completely reworked</p>
<p>Here are just some of the improvements&#8230;</p>
<p>Profiles<br />
user rankings<br />
search bar<br />
You can save up to three maps<br />
Highscores table for every map<br />
200+ tiles<br />
you can add a map you made to your website<br />
30 waypoints<br />
And alot more!</p>
<p>You can play the full version <a href="http://www.fupa.com/towerdefense.aspx">here</a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=8</wfw:commentRss>
		</item>
		<item>
		<title>My favourite TD maps</title>
		<link>http://funflowstudios.com/?p=6</link>
		<comments>http://funflowstudios.com/?p=6#comments</comments>
		<pubDate>Thu, 06 Nov 2008 20:25:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Fun Flow Studios]]></category>

		<category><![CDATA[Games]]></category>

		<category><![CDATA[Create]]></category>

		<category><![CDATA[defence]]></category>

		<category><![CDATA[maps]]></category>

		<category><![CDATA[own]]></category>

		<category><![CDATA[tower]]></category>

		<category><![CDATA[your]]></category>

		<guid isPermaLink="false">http://funflowstudios.com/?p=6</guid>
		<description><![CDATA[I was just looking at the portal today, and found some great maps!
Here are some pictures of my favorites
Heavan Vs Hell by Sharpie markers:

The Level45 by Venima:

deathisland by lost1010:

awesome maps  
Well done to Azure who&#8217;s maps have been at the top of the portal since the game was released!
Get ready for create your own [...]]]></description>
			<content:encoded><![CDATA[<p>I was just looking at the portal today, and found some great maps!</p>
<p>Here are some pictures of my favorites</p>
<p><strong>Heavan Vs Hell</strong> by <strong>Sharpie markers:</strong></p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/im1.png" alt="" width="250" height="200" /></p>
<p><strong>The Level45</strong> by <strong>Venima</strong>:</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/im2.png" alt="" width="250" height="200" /></p>
<p><strong>deathisland</strong> by <strong>lost1010</strong>:</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/im3.png" alt="" width="250" height="200" /></p>
<p>awesome maps <img src='http://funflowstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Well done to Azure who&#8217;s maps have been at the top of the portal since the game was released!</p>
<p>Get ready for create your own TD 1.5! coming VERY soon</p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=6</wfw:commentRss>
		</item>
		<item>
		<title>Creating a flash login screen</title>
		<link>http://funflowstudios.com/?p=5</link>
		<comments>http://funflowstudios.com/?p=5#comments</comments>
		<pubDate>Sat, 25 Oct 2008 08:09:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[account]]></category>

		<category><![CDATA[Create]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[login]]></category>

		<category><![CDATA[Source]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://funflowstudios.com/?p=5</guid>
		<description><![CDATA[This series will cover some of the great things with flash, php and mySQL
In this tutorial we will create a user account login screen, and also a user creation screen. Using a mixture of PHP and mySQl.
preview:
this is what we&#8217;ll be making (sorry for the terrible graphics lol)
you can create an account, then you can [...]]]></description>
			<content:encoded><![CDATA[<p>This series will cover some of the great things with flash, php and mySQL</p>
<p>In this tutorial we will create a user account login screen, and also a user creation screen. Using a mixture of PHP and mySQl.</p>
<p><strong>preview:</strong></p>
<p>this is what we&#8217;ll be making (sorry for the terrible graphics lol)</p>
<p>you can create an account, then you can log in with it</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="300" height="200" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://funflowstudios.com/flash/login_flash.swf" /><embed type="application/x-shockwave-flash" width="300" height="200" src="http://funflowstudios.com/flash/login_flash.swf"></embed></object></p>
<p><strong><br />
</strong></p>
<p><strong>Step 1: Setting up PHP</strong></p>
<p>Before you start creating the login screen you have to be able to run PHP, skip to step 2, if you already have a way of running a PHP file</p>
<p>PHP is a server side language that can&#8217;t just be run on its own like HTML, however you can install a set of tools that let you run it from your own computer (<a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a>), or if you have a server it&#8217;s very likely PHP is already set up.</p>
<p><strong>Step 2: Creating the flash document</strong></p>
<p>Start by creating three frames, give frame one a frame label of &#8216;login&#8217;, frame two a label of &#8216;createAccount&#8217; and frame three a label of &#8216;loggedIn&#8217;.</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/frameLabel.png" alt="" width="281" height="80" /></p>
<p>In frame one (login) and frame two (createAccount) create two input text fields, give one an instance name of &#8216;username&#8217; and the other an instance of &#8216;password&#8217;.</p>
<p>Just below these text fields add a new text field and make its behaviour multiline, this text field will show any errors with the login process. Give the one on frame one an instance of &#8216;loginStatus&#8217; and the one on frame two an instance of &#8216;accountStatus&#8217;.</p>
<p>Make sure the text field &#8216;password&#8217; has a behaviour of password.</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/pic1.png" alt="" width="491" height="177" /></p>
<p>On frame three add one last text field and make it&#8217;s variable name &#8216;welcomeText&#8217;</p>
<p>Now create a &#8216;create account&#8217; button, &#8216;login&#8217; button and a &#8216;back&#8217; button, you can change the graphics to whatever you want and also give them any library name you want. however the instance names should be:</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/buttons.png" alt="" width="200" height="300" /></p>
<p>put the buttons in each frame as shown:</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/frames.png" alt="" width="500" height="150" /></p>
<p>Now to add the code <img src='http://funflowstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Create a new layer called actions, and on frame one insert this (change line 49 to where you will put your PHP files):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//helps prevent mysql injection</span>
username.<span style="color: #0066CC;">restrict</span> = <span style="color: #ff0000;">&quot;A-Za-z0-9&quot;</span>;
<span style="color: #0066CC;">password</span>.<span style="color: #0066CC;">restrict</span> = <span style="color: #ff0000;">&quot;A-Za-z0-9&quot;</span>;
<span style="color: #808080; font-style: italic;">//declaring the object you will send to the PHP script</span>
sendingVars = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
recievingVars = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//the create account release function</span>
createAccountBtn.<span style="color: #0066CC;">onRelease</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//goes to frame two</span>
	<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;createAccount&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>;
<span style="color: #808080; font-style: italic;">//when the recievingVars get sent back</span>
<span style="color: #808080; font-style: italic;">//this is where you can collect the variables</span>
recievingVars.<span style="color: #0066CC;">onLoad</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">//the var loginStatus sent from the PHP script</span>
		<span style="color: #0066CC;">Status</span> = recievingVars.<span style="color: #006600;">loginStatus</span>;
		<span style="color: #808080; font-style: italic;">//checking what the loginStatus was</span>
		<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Status</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;success&quot;</span> :
			    user = username.<span style="color: #0066CC;">text</span>;
			    welcomeText = <span style="color: #ff0000;">&quot;welcome &quot;</span>+user+<span style="color: #ff0000;">&quot; you are now logged in&quot;</span>;
				<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'loggedIn'</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">break</span>;
			<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'username'</span> :
				loginStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">'there is no such username'</span>;
				<span style="color: #b1b100;">break</span>;
			<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'password'</span> :
				loginStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">'you have entered the wrong password'</span>;
				<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">//if nothing was sent back, the text variable</span>
		<span style="color: #808080; font-style: italic;">//loginStatus will get this text</span>
		loginStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Server offline, sorry&quot;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>;
loginBtn.<span style="color: #0066CC;">onRelease</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//checking if anthing has been written in the text fields</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>username.<span style="color: #0066CC;">text</span> == <span style="color: #ff0000;">&quot;&quot;</span>||password.<span style="color: #0066CC;">text</span> == <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		loginStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;you have not put any text in one of the text fields&quot;</span>;
	<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//add the username variables to 'sendingVars'</span>
	sendingVars.<span style="color: #006600;">username</span> = username.<span style="color: #0066CC;">text</span>;
	sendingVars.<span style="color: #0066CC;">password</span> = <span style="color: #0066CC;">password</span>.<span style="color: #0066CC;">text</span>;
	<span style="color: #808080; font-style: italic;">//sending the object to the login script</span>
	sendingVars.<span style="color: #0066CC;">sendAndLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'http://yourURL/login.php'</span>,recievingVars,<span style="color: #ff0000;">&quot;POST&quot;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #808080; font-style: italic;">//add a loading message</span>
	loginStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">'loading'</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>on frame 2 insert this (change line 43 to where you will put your PHP files):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//helps prevent mysql injection</span>
username.<span style="color: #0066CC;">restrict</span> = <span style="color: #ff0000;">&quot;A-Za-z0-9&quot;</span>;
<span style="color: #0066CC;">password</span>.<span style="color: #0066CC;">restrict</span> = <span style="color: #ff0000;">&quot;A-Za-z0-9&quot;</span>;
<span style="color: #808080; font-style: italic;">//declaring the object you will send to the PHP script</span>
sendingVars = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
recievingVars = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//back button release function</span>
backBtn.<span style="color: #0066CC;">onRelease</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//goes to frame one</span>
	<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;login&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>;
<span style="color: #808080; font-style: italic;">//when the recievingVars get sent back</span>
<span style="color: #808080; font-style: italic;">//this is where you can collect the variables</span>
recievingVars.<span style="color: #0066CC;">onLoad</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">//the var accountStatus sent from the PHP script</span>
		<span style="color: #0066CC;">Status</span> = recievingVars.<span style="color: #006600;">accountStatus</span>;
		<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Status</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;success&quot;</span> :
				<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'login'</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">break</span>;
			<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'username'</span> :
				accountStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">'that username has already been taken, sorry'</span>;
				<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">//if nothing was sent back, the text variable</span>
		<span style="color: #808080; font-style: italic;">//accountStatus will get this text</span>
		accountStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Server offline, sorry&quot;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>;
createAccountBtn.<span style="color: #0066CC;">onRelease</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//checking if anthing has been written in the text fields</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>username.<span style="color: #0066CC;">text</span> == <span style="color: #ff0000;">&quot;&quot;</span>||password.<span style="color: #0066CC;">text</span> == <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		accountStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;you have not put any text in one of the text fields&quot;</span>;
	<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//add the username variables to 'sendingVars'</span>
	sendingVars.<span style="color: #006600;">username</span> = username.<span style="color: #0066CC;">text</span>;
	sendingVars.<span style="color: #0066CC;">password</span> = <span style="color: #0066CC;">password</span>.<span style="color: #0066CC;">text</span>;
	<span style="color: #808080; font-style: italic;">//sending the object to the new account script</span>
	sendingVars.<span style="color: #0066CC;">sendAndLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'http://yourURL/newAccount.php'</span>,recievingVars,<span style="color: #ff0000;">&quot;POST&quot;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #808080; font-style: italic;">//add a loading message</span>
	accountStatus.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">'loading'</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>add one last small piece of code to frame three:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;">backBtn.<span style="color: #0066CC;">onRelease</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">//goes to frame one</span>
	<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;login&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>;</pre></div></div>

<p>And thats the Flash Part set up, YAY!, although you can change the layout of the login screen to whatever you want and mess around graphics until you have it customized to your style.</p>
<p><strong>Step 3: setting up the mySQL database and tables</strong></p>
<p>using phpmyadmin or whatever program you use to edit mySQL databases, Create a new database and call it whatever you want(but remember the name), and create a new table called &#8216;users&#8217; it should have three fields &#8216;id, username, password&#8217;.<br />
Here is the table structure:</p>
<p><img src="http://i374.photobucket.com/albums/oo182/funflowstudios/dbSetup.png" alt="" /></p>
<p>now we are ready for the PHP section!</p>
<p><strong>Step 4: PHP files</strong></p>
<p>create a new file called login.php using notepad or even better an editor that supports syntax highlighting. <a href="http://notepad-plus.sourceforge.net/uk/site.htm">link</a><br />
(enter your database details on line 3 and line 5)</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//enter your mySQL info</span>
<span style="color: #000088;">$database</span> <span style="color: #339933;">=</span> <span style="">'your_database'</span>;
<span style="color: #666666; font-style: italic;">//enter mySQL user info</span>
<span style="color: #000088;">$DBinfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="">'localhost'</span><span style="color: #339933;">,</span> <span style="">'your_username'</span><span style="color: #339933;">,</span> <span style="">'your_password'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">//checks for correct user and password</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$DBinfo</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="">'could not connect to mySQL because:'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//selects your database</span>
<span style="color: #000088;">$db_selected</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$database</span><span style="color: #339933;">,</span> <span style="color: #000088;">$DBinfo</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//checks if database selected is correct</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$db_selected</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="">'cannot connect to database because: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//getting variables sent from flash</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span>;
<span style="color: #666666; font-style: italic;">//adding md5 protection to compare with the version in the database</span>
<span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//checking for username</span>
<span style="color: #000088;">$userQuery</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT id FROM users WHERE username = '$user'&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$userQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//if there is no username</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;loginStatus=username&amp;&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">exit</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//checking if password  is correct</span>
<span style="color: #000088;">$passQuery</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM users WHERE username = '$user' AND password = '$pass'&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$passQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//if password is wrong</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;loginStatus=password&amp;&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">exit</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//success message</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;loginStatus=success&amp;&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Now create a file called newAccount.php and add this code to it (again, enter your database details on line 3 and line 5):</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//enter your mySQL info</span>
<span style="color: #000088;">$database</span> <span style="color: #339933;">=</span> <span style="">'your_database'</span>;
<span style="color: #666666; font-style: italic;">//enter mySQL user info</span>
<span style="color: #000088;">$DBinfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="">'localhost'</span><span style="color: #339933;">,</span> <span style="">'your_username'</span><span style="color: #339933;">,</span> <span style="">'your_password'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">//checks for correct user and password</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$DBinfo</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="">'could not connect to mySQL because:'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//selects your database</span>
<span style="color: #000088;">$db_selected</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$database</span><span style="color: #339933;">,</span> <span style="color: #000088;">$DBinfo</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//checks if database selected is correct</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$db_selected</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="">'cannot connect to database because: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//getting variables sent from flash</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'username'</span><span style="color: #009900;">&#93;</span>;
<span style="color: #666666; font-style: italic;">//adding md5 protection to compare with the version in the database</span>
<span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #666666; font-style: italic;">//checking if username already exists</span>
<span style="color: #000088;">$userQuery</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT id FROM users WHERE username = '$user'&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$userQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//if username exists</span>
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;accountStatus=username&amp;&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">exit</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//inserting into user the user and pass</span>
<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;INSERT INTO users (username,password) VALUES ('$user','$pass')&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;accountStatus=success&amp;&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Now upload the PHP files to your server or put in htdocs of your localhost and test, everything should work <img src='http://funflowstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>if you can&#8217;t get it to work here are the <a href="http://www.mediafire.com/?jtmljjjij4m">source files</a></p>
<p>I will be converting this to as3 very soon&#8230;</p>
<p>Luke</p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=5</wfw:commentRss>
		</item>
		<item>
		<title>Create your own TD</title>
		<link>http://funflowstudios.com/?p=3</link>
		<comments>http://funflowstudios.com/?p=3#comments</comments>
		<pubDate>Sun, 19 Oct 2008 13:41:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Fun Flow Studios]]></category>

		<category><![CDATA[Games]]></category>

		<category><![CDATA[Create]]></category>

		<category><![CDATA[defence]]></category>

		<category><![CDATA[flow]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[own]]></category>

		<category><![CDATA[studios]]></category>

		<category><![CDATA[tower]]></category>

		<category><![CDATA[your]]></category>

		<guid isPermaLink="false">http://funflow.110mb.com/?p=3</guid>
		<description><![CDATA[Check out our newest game!

Create your own TD
Description
Have you ever played an element defense game but wanted to make your own one? with &#8220;create your own tower defense&#8221; you now can, you can design your own tower defense maps and upload to the tower defense portal, where people from all over the world can play [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">Check out our newest game!</p>
<p style="text-align: center;"><a href="http://www.funflowstudios.com/games/cyotd.html" target="_blank"><img src="https://sandbox.mochiads.com/c/g/create-your-own-tower-defence_v1/_thumb_100x100.jpg" alt="" width="100" height="100" /></a></p>
<p style="text-align: center;">Create your own TD</p>
<p style="text-align: left;"><strong>Description</strong></p>
<p style="text-align: left;">Have you ever played an element defense game but wanted to make your own one? with &#8220;create your own tower defense&#8221; you now can, you can design your own tower defense maps and upload to the tower defense portal, where people from all over the world can play and rate your game, create your own tower defense contains an enemy customizer, a tower editor, a wave editor, and much more to give you complete control of the game.</p>
<p style="text-align: left;">You can play it <a href="http://www.funflowstudios.com/games/cyotd.html" target="_blank">here</a></p>
<p>Wait for create your own TD 1.5&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
		<item>
		<title>Welcome to Fun Flow Studios</title>
		<link>http://funflowstudios.com/?p=1</link>
		<comments>http://funflowstudios.com/?p=1#comments</comments>
		<pubDate>Sun, 19 Oct 2008 13:39:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Fun Flow Studios]]></category>

		<category><![CDATA[flow]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[studios]]></category>

		<guid isPermaLink="false">http://funflow.110mb.com/?p=1</guid>
		<description><![CDATA[Hi,
During the next few months we will be updating this site with news, reviews, flash games, and our own games, so check back often  
Luke
]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>During the next few months we will be updating this site with news, reviews, flash games, and our own games, so check back often <img src='http://funflowstudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Luke</p>
]]></content:encoded>
			<wfw:commentRss>http://funflowstudios.com/?feed=rss2&amp;p=1</wfw:commentRss>
		</item>
	</channel>
</rss>
