<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Style Press, Best Practices from all the Web, Build Better Websites &#187; Counter</title>
	<atom:link href="http://www.webstylepress.com/category/adobe-flash/counter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webstylepress.com</link>
	<description>Web VS Style</description>
	<lastBuildDate>Mon, 26 Dec 2011 10:35:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Flash Hit Counter Using ActionScript and PHP</title>
		<link>http://www.webstylepress.com/flash-hit-counter/</link>
		<comments>http://www.webstylepress.com/flash-hit-counter/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 15:45:44 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Counter]]></category>
		<category><![CDATA[Flash PHP]]></category>
		<category><![CDATA[counting]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[hit counter]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webstylepress.com/?p=281</guid>
		<description><![CDATA[We can create a simple hit counter using flash and PHP script which uses text file for storing hits. I have used a blank count.txt file, and php file. Create a dynamic text field in flash movie and name it count and you are done. Name the flash movie counter.swf or whatever you like. PHP [...]<p><a href="http://www.webstylepress.com/flash-hit-counter/">Flash Hit Counter Using ActionScript and PHP</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
]]></description>
			<content:encoded><![CDATA[<p>We can create a simple hit counter using flash and PHP script which uses text file for storing hits. I have used a blank <strong>count.txt</strong> file, and php file. Create a dynamic text field in flash movie and name it <strong>count</strong> and you are done.  Name the flash movie counter.swf or whatever you like.</p>
<p><span id="more-281"></span></p>
<h4>PHP File Code (counter.php)</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #666666; font-style: italic;">//Reading the file</span>
<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;count.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Increasing the count</span>
<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Writing to file</span>
<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;count.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;w+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;count=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Returning the count</span>
<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;count=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Flah Movie &#8211; Dynamic Text Field Count Scripting</h4>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">loadVariables</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;counter.php&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/flash-counter.rar'>Download Flash PHP Hit Counter</a></span></p>
<p><a href="http://www.webstylepress.com/flash-hit-counter/">Flash Hit Counter Using ActionScript and PHP</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.webstylepress.com/counting-in-flash-flash-counter/" title="Counting In Flash &#8211; Flash Counter">Counting In Flash &#8211; Flash Counter</a></li><li><a href="http://www.webstylepress.com/flash-and-php-form-submission-send-email-via-flash-and-php/" title="Flash and PHP &#8211; Form Submission &#8211; Send Email Via Flash and PHP">Flash and PHP &#8211; Form Submission &#8211; Send Email Via Flash and PHP</a></li><li><a href="http://www.webstylepress.com/random-bubble-animation-in-flash/" title="Create Random Bubble Animation In Flash">Create Random Bubble Animation In Flash</a></li><li><a href="http://www.webstylepress.com/flash-random-text-animation/" title="Create Flash Random 3D Text Animation">Create Flash Random 3D Text Animation</a></li><li><a href="http://www.webstylepress.com/flash-resources-and-tutorials/" title="Flash Resources and Tutorials">Flash Resources and Tutorials</a></li><li><a href="http://www.webstylepress.com/scrollbars-in-flash-flash-content-scroll/" title="Scrollbars In flash &#8211; Flash Content Scroll">Scrollbars In flash &#8211; Flash Content Scroll</a></li><li><a href="http://www.webstylepress.com/flash-mouse-effects/" title="Flash Mouse Effects">Flash Mouse Effects</a></li><li><a href="http://www.webstylepress.com/google-search-from-flash/" title="Google Search From Flash Using ActionScript">Google Search From Flash Using ActionScript</a></li><li><a href="http://www.webstylepress.com/swap-depth-in-flash/" title="Swap Depth In Flash">Swap Depth In Flash</a></li><li><a href="http://www.webstylepress.com/flash-slide-shows/" title="Create Flash Slide Shows Using ActionScript &#8211; Example Downloads">Create Flash Slide Shows Using ActionScript &#8211; Example Downloads</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.webstylepress.com/flash-hit-counter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

