<?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>WhatwasIthinking.co.uk &#187; php</title>
	<atom:link href="http://www.whatwasithinking.co.uk/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.whatwasithinking.co.uk</link>
	<description>A Flash Development, Information Architecture, SEO &#38; Web Design Blog</description>
	<lastBuildDate>Wed, 01 Feb 2012 09:18:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>On Flash &#8211; map integration with Yahoo Maps + ActionScript (part 2)</title>
		<link>http://www.whatwasithinking.co.uk/2008/07/09/on-flash-map-integration-with-yahoo-maps-actionscript-part-2/</link>
		<comments>http://www.whatwasithinking.co.uk/2008/07/09/on-flash-map-integration-with-yahoo-maps-actionscript-part-2/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 21:42:10 +0000</pubDate>
		<dc:creator>Alexander Rehm</dc:creator>
				<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Actionscript 2.0]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[functionality]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[mash-up]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rich media application]]></category>
		<category><![CDATA[travel blog]]></category>
		<category><![CDATA[travel journal]]></category>
		<category><![CDATA[Yahoo maps]]></category>

		<guid isPermaLink="false">http://www.whatwasithinking.co.uk/?p=66</guid>
		<description><![CDATA[If you followed my entry about Map integration with Yahoo Maps and ActionScript you will probably be wondering what I have to report about the progress. As you may remember, this mash-up is about offering a client a new spin on travel bogging: being able to log in to the client&#8217;s website from anywhere in [...]<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.whatwasithinking.co.uk/2008/07/09/on-flash-map-integration-with-yahoo-maps-actionscript-part-2/' addthis:title='On Flash &#8211; map integration with Yahoo Maps + ActionScript (part 2)' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_menu"></a></div>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-67" title="On Flash - map integration with Yahoo Maps and ActionScript (part2)" src="http://www.whatwasithinking.co.uk/wp-content/uploads/2008/07/on-flashmaps-00.jpg" alt="On Flash - map integration with Yahoo Maps and ActionScript (part2)" width="170" height="140" align="right" />If you followed my entry about <a title="On Flash - map integration with Yahoo Maps + ActionScript 2.0" href="http://www.whatwasithinking.co.uk/2008/05/05/on-flash-map-integration-with-yahoo-maps-as-20/" target="_blank">Map integration with Yahoo Maps and ActionScript</a> you will probably be wondering what I have to report about the progress. As you may remember, this mash-up is about offering a client a new spin on travel bogging: being able to log in to the client&#8217;s website from anywhere in the world and give other users (and family and friends) the opportunity to see where you are going and what you are doing there.</p>
<p>Last time I wrote about this Yahoo / Flash mashup I connected the Yahoo map&#8217;s API through Flash and PHP to a MySQL database and was able to write / read from the entries. My next goals were to integrate a user-login, adding links, implementing moderation and a Flash image uploader script.<span id="more-66"></span><br />
<span style="color: #ffffff;">.</span></p>
<h3>Integrating a PHP uploader script</h3>
<p>A very important aspect for both users (and our clients) is to be able to &#8216;take part&#8217; and &#8216;be part&#8217; of shaping the user-generated content area of a site, to leave their mark. Naturally, images and content are the weapons of choice, as such the next step was to work on an image-uploader. The task:</p>
<blockquote><p>Develop an image uploader script through Flash that would allow users to upload an image from their desktop, store it online in a writeable folder on the server and reference to it from the SQL database and display the image for the relevant post for the relevant user.</p></blockquote>
<p><a href="http://www.whatwasithinking.co.uk/wp-content/uploads/2008/07/on-flashmaps-001.jpg"  rel="lightbox[roadtrip]"><img class="alignright size-thumbnail wp-image-68" title="On Flash maps - image uploader gone wrong" src="http://www.whatwasithinking.co.uk/wp-content/uploads/2008/07/on-flashmaps-001-150x150.jpg" alt="On Flash maps - image uploader gone wrong" width="150" height="99" align="right" /></a>This wasn&#8217;t such an easy task. I had a good look around how Flash tutorial websites I usually frequent handle image upload. After some working I managed to get the PHP side of things working &#8211; which also had its own issues to start with, it would not update file names properly (<em>see image to the right, click to enlarge</em>)! After some fiddling around I managed to get the php script to work, and if you like you can download it here:</p>
<blockquote><p>Please download the file here: <a href="http://www.whatwasithinking.co.uk/wp-content/uploads/2008/07/fileupload.zip">fileupload.zip</a> (~800 bytes)</p></blockquote>
<p>What the script does is it defines the maximum file dimensions (180&#215;300 max in either direction) and uploads the file to a temporary directory (<em>/tempstore/</em>) before giving it a timestamp and name-change and putting it into the <em>/images/</em> directory.</p>
<p><span style="color: #ffffff;">.</span></p>
<h3>Connecting PHP with Flash</h3>
<p>This was a bit (okay, a hell of a lot) more complicated: through the variables &#8216;<em>FileReference</em>&#8216; and &#8216;<em>browseListener</em>&#8216; and a couple of other event listeners I managed to tell Flash how to use the &#8220;Browse&#8230;&#8221; button and how to handle the uploaded image. At the moment the Flash file uploads the image to the database correctly, but it will break if the image does not have the correct size, so I need to work on getting the image-resizer to work. Once that works I&#8217;ll upload the source as well.</p>
<p><span style="color: #ffffff;">.</span></p>
<h3>Sneak Peak for the image-uploader (snapshot of 9th July 2008)</h3>
<p>The main uploader:<br />
<img class="alignnone size-full wp-image-70" title="On Flash - map integration with Yahoo Maps + Actionscript - the uploader" src="http://www.whatwasithinking.co.uk/wp-content/uploads/2008/07/on-flashmaps-01.jpg" alt="The uploader" width="600" height="440" /></p>
<p><span style="color: #ffffff;">.</span></p>
<p>The uploaded image and adding information:<br />
<img class="alignnone size-full wp-image-71" title="On Flash - map integration with Yahoo Maps + Actionscript - the uploaded image" src="http://www.whatwasithinking.co.uk/wp-content/uploads/2008/07/on-flashmaps-02.jpg" alt="The uploaded image" width="600" height="441" /></p>
<p><span style="color: #ffffff;">.</span></p>
<p>&#8230;and the result:<br />
<img class="alignnone size-full wp-image-72" title="On Flash - map integration with Yahoo maps + Actionscript - the final result" src="http://www.whatwasithinking.co.uk/wp-content/uploads/2008/07/on-flashmaps-03.jpg" alt="The final result...well, for now!" width="600" height="441" /></p>
<p><span style="color: #ffffff;">.</span></p>
<h3>Conclusion and next steps</h3>
<p>Well, so far it is looking very promising with the image-uploader! Obviously we are still some way to go with it, but I think the project is starting to take shape! Integrating browse and upload functionality in Flash took some work, but thanks to ActionScript 2.0&#8242;s event listeners it worked out reasonably well and connected to the database. Obviously we are still taking about only one user at a time, so I would need to review the php code at a later date to also make sure there is a folder structure per user present, but that should not be too much of an issue. Watch out for the next entry on this mash-up, by then I will have the uploader finished and maybe add the ability to upload multiple images to show a slideshow, we will see!</p>
<p><span style="color: #ffffff;">.</span></p>
<p>Lastly, if you enjoyed the article &#8211; or just the flash map &#8211; then please leave a comment, I would really appreciate it, as it gives me always another boost to write more <img src='http://www.whatwasithinking.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="addthis_toolbox addthis_default_style" addthis:url='http://www.whatwasithinking.co.uk/2008/07/09/on-flash-map-integration-with-yahoo-maps-actionscript-part-2/' addthis:title='On Flash &#8211; map integration with Yahoo Maps + ActionScript (part 2)' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_menu"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.whatwasithinking.co.uk/2008/07/09/on-flash-map-integration-with-yahoo-maps-actionscript-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

