<?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; Flash PHP</title>
	<atom:link href="http://www.webstylepress.com/category/adobe-flash/flash-php/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>
		<item>
		<title>Flash and PHP &#8211; Form Submission &#8211; Send Email Via Flash and PHP</title>
		<link>http://www.webstylepress.com/flash-and-php-form-submission-send-email-via-flash-and-php/</link>
		<comments>http://www.webstylepress.com/flash-and-php-form-submission-send-email-via-flash-and-php/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 21:01:16 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Flash PHP]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash validation]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webstylepress.com/?p=169</guid>
		<description><![CDATA[Sending email via flash can be a bit tricky. Well! Not much tricky anymore if you follow these simple instructions and download example file. Create a movie clip, name it form and copy this ActionScript over that. onClipEvent &#40;data&#41; &#123; _root.nextFrame&#40;&#41;; &#125; Whole form elements and submit button must be inside that movie clip. Create [...]<p><a href="http://www.webstylepress.com/flash-and-php-form-submission-send-email-via-flash-and-php/">Flash and PHP &#8211; Form Submission &#8211; Send Email Via Flash 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>Sending email via flash can be a bit tricky. Well! Not much tricky anymore if you follow these simple instructions and download example file. Create a movie clip, name it <strong>form</strong> and copy this ActionScript over that.</p>
<p><span id="more-169"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">nextFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Whole form elements and submit button must be inside that movie clip.<br />
Create input text fields and name them in field named as <strong>var</strong>.<br />
Create a dynamic text field for error message.</p>
<p>Suppose you have created fields named as <strong>name</strong>, <strong>email</strong>, <strong>comments</strong> and error dynamic text field named as <strong>txt</strong> then at submit button place following action script.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span> == <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        txt = <span style="color: #ff0000;">&quot;Name Missing&quot;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>email == <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        txt = <span style="color: #ff0000;">&quot;Email Missing&quot;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>comments == <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        txt = <span style="color: #ff0000;">&quot;Comments Missing&quot;</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>In the same movie clip at second frame place following actionscript.</p>

<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;sendEmail.php&quot;</span>,<span style="color: #ff0000;">&quot;POST&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>We are posting variables from flash to PHP script page to send email. Now remember we placed following actionscript over main movie containing form.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">nextFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Submit button will check whether fields are empty or not. if not it will post variables to PHP page and email will be sent.</p>
<p>You can define tabindex for fields too by adding following script at first frame where form fields are located.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">name</span>.<span style="color: #0066CC;">tabIndex</span> = <span style="color: #cc66cc;">1</span>;
email.<span style="color: #0066CC;">tabIndex</span> = <span style="color: #cc66cc;">2</span>;
comments.<span style="color: #0066CC;">tabIndex</span> = <span style="color: #cc66cc;">3</span>;
submit.<span style="color: #0066CC;">tabIndex</span> = <span style="color: #cc66cc;">4</span>;</pre></div></div>

<p>Rough and shortest PHP email script is given here which you will put in the email PHP page located in the same directory where this movie is present with page calling it.</p>

<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: #000088;">$myfrom</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$email</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$myemail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;email@server.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// place the target email address above</span>
<span style="color: #000088;">$subject</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Message From website&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
Name: <span style="color: #006699; font-weight: bold;">$name</span>
comments : <span style="color: #000099; font-weight: bold;">\n</span> <span style="color: #006699; font-weight: bold;">$comments</span>
&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$myfrom</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myemail</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Validating Flash Forms</strong></p>
<p><a rel="nofollow" target="_blank" href="http://www.adobe.com/support/flash/programs/form_validations_tut/" target="_blank">Validating Flash forms with Dreamweaver and the JavaScript Integration Kit</a></p>
<p>Following is the downloadable file containing three examples regarding flash and php email sending and flash form validation.</p>
<p><span class="downloadfile"><a href='http://www.webstylepress.com/wp-content/uploads/2008/10/php-flash-email.rar'>Download PHP Flash Email With Validation Examples</a></span></p>
<p><a href="http://www.webstylepress.com/flash-and-php-form-submission-send-email-via-flash-and-php/">Flash and PHP &#8211; Form Submission &#8211; Send Email Via Flash 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/flash-hit-counter/" title="Flash Hit Counter Using ActionScript and PHP">Flash Hit Counter Using ActionScript 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><li><a href="http://www.webstylepress.com/flash-window-or-movie-move-dragable-content/" title="Flash Window or Movie Move &#8211; Dragable Content Using ActionScript">Flash Window or Movie Move &#8211; Dragable Content Using ActionScript</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.webstylepress.com/flash-and-php-form-submission-send-email-via-flash-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

