<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Gerton's Corner</title>
	<atom:link href="http://gertonscorner.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gertonscorner.wordpress.com</link>
	<description>Just some thoughts, nothing else…</description>
	<lastBuildDate>Tue, 27 Oct 2009 19:32:51 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='gertonscorner.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/5fd99967916675888fca610f2ccbc96d?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Gerton's Corner</title>
		<link>http://gertonscorner.wordpress.com</link>
	</image>
			<item>
		<title>Zend Framework: Application resources</title>
		<link>http://gertonscorner.wordpress.com/2009/10/27/zend-framework-application-resources/</link>
		<comments>http://gertonscorner.wordpress.com/2009/10/27/zend-framework-application-resources/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 19:32:51 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend logging]]></category>
		<category><![CDATA[zend MVC]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=94</guid>
		<description><![CDATA[In this second part of my Zend Framework quest, i will dive in the wonderfull world of application resource plugins. Zend_Application provide several standard resource plugins for database access, session management, routing etc. You can find more info about these standard Resource Plugins here.
The fun part of these Resource Plugins is that they can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=94&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In this second part of my Zend Framework quest, i will dive in the wonderfull world of application resource plugins. Zend_Application provide several standard resource plugins for database access, session management, routing etc. You can find more info about these standard Resource Plugins <a title="Zend Framework standard Resource Plugins" href="http://framework.zend.com/manual/en/zend.application.available-resources.html" target="_blank">here</a>.</p>
<p>The fun part of these Resource Plugins is that they can be configurated completely within the application.ini (or application.xml) configuration file and are loaded automatically by the Application Bootstrapper.  For example you can define a new Route resource &#8220;myroute&#8221; referencing the module/controller/action without writing any code like this:</p>
<p><code>; Router resources<br />
resources.router.routes.myroute.route = "hello/:myname"<br />
resources.router.routes.myroute.defaults.module = "mymodule"<br />
resources.router.routes.myroute.defaults.controller = "index"<br />
resources.router.routes.myroute.defaults.action = "index"</code></p>
<p>Which will route the following url &#8220;http://localhost/hello/world&#8221; to the standard controller action from the &#8220;mymodule&#8221; module, with the request parameter &#8220;myname&#8221;  filled with &#8220;world&#8221;.</p>
<p>While Zend Framework ships with a number of standard resource plugins, the intention is that developers should write their own to encapsulate their own initialization needs. So lets begin with our own custom resource plugin for initializing application logging using Zend_Log.</p>
<p><span id="more-94"></span>The first step is to define a plugin-path and prefix path for the new custom resource in the application.ini configuration file (preferably somewhere in the beginning), like this:</p>
<p><code>pluginPaths.Custom_Resource = APPLICATION_PATH "/resources"</code></p>
<p>When the new resource class starts with &#8220;Custom_Resource&#8221;, it will be automatically loaded by the Bootstrapper.</p>
<p>Create a new file Logger.php in the APPLICATION_PATH/resources location containing the following code:</p>
<p><code>class Custom_Resource_Logger<br />
extends Zend_Application_Resource_ResourceAbstract {<br />
}</code></p>
<p>The new resource plugin should now accept options to the constructor, have mechanisms for setting and retrieving options, have mechanisms for setting and retrieving the bootstrap object, and an initialization method.</p>
<p>Now the basics are set, it is time to think about what the new logger resource can do, or better, define the configuration options. Here are the options:</p>
<ol>
<li>&#8220;registry&#8221;</li>
<li>&#8220;output&#8221;</li>
<li>&#8220;priority&#8221;</li>
<li>&#8220;file&#8221;</li>
</ol>
<p>Although Resource Plugins are put in a bootstrap container (which is basically an instance of Zend_Registry) they are not globally available. This means you need access to the bootstrap in your code to load the resource. To overcome this &#8220;problem&#8221; the Zend_Log instance is registered with the name provided in the &#8220;registry&#8221; option. This way you can get your Zend_Log instance like this:</p>
<p><code>Zend_Registry::get('[registry-option]')</code></p>
<p>The &#8220;output&#8221; option let you configure where the log messages are send: The available values are &#8220;file&#8221; or &#8220;firebug&#8221;.</p>
<p>The &#8220;priority&#8221; option will filter the log messages to the default Zend_Log priorities levels 0-7.</p>
<p>The &#8220;file&#8221; option finally defines the file location when you choose &#8220;file&#8221; as the output. It is possible to use a date within the filename, using the replace needle &#8220;%d&#8221;.</p>
<p>The full implementation (source) of the Logger.php file can be found <a title="Full source code Logger.php" href="https://gertonscorner.googlecode.com/svn/trunk/ZendFramework/application/resources/Logger.php" target="_blank">here</a>.</p>
<p>Just the final step to completion, registration off the new Resource Plugin to your bootstrap. Again this can be accomplished by adding the following line to your application.ini configuration file:</p>
<p><code>resources.logger[] = ""</code></p>
<p>The application.ini configuration should now look like this:</p>
<p><code>; Custom resource plugins<br />
pluginPaths.Custom_Resource = APPLICATION_PATH "/resources"<br />
; Logger resources<br />
resources.logger[] = ""<br />
; Option used for Global Registry location<br />
resources.logger.registry = "Zend_Log"<br />
; Use for output option: firebug or file<br />
resources.logger.output = "file"<br />
; Priorities available: 0=[EMERG]/1=ALERT/2=CRIT/3=ERR/4=WARN/5=NOTICE/6=INFO/7=[DEBUG]<br />
resources.logger.priority = 3<br />
resources.logger.file = APPLICATION_PATH "/../tmp/app-prod-%d.log"</code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=94&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2009/10/27/zend-framework-application-resources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
		<item>
		<title>Zend Framework: Project setup</title>
		<link>http://gertonscorner.wordpress.com/2009/10/07/zend-framework-setup/</link>
		<comments>http://gertonscorner.wordpress.com/2009/10/07/zend-framework-setup/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 19:39:07 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zend MVC]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=83</guid>
		<description><![CDATA[It has been a while since i last wrote a post about working with the Zend Framework and the, then rather new, package Zend_Amf. The project structure was an attempt to integrate the Zend MVC with Zend Amf (and of course try out some new features in the Flash player 10).
Since that post, Zend has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=83&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It has been a while since i last wrote a <a title="Fileupload using Zend AMF, RemoteObject and Flash 10" href="http://gertonscorner.wordpress.com/2009/04/19/fileupload-using-zend-amf-remoteobject-and-flash-10/" target="_self">post</a> about working with the <a title="Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a> and the, then rather new, package Zend_Amf. The project structure was an attempt to integrate the Zend MVC with Zend Amf (and of course try out some new features in the Flash player 10).<br />
Since that post, Zend has released some major releases with some rather big changes, like the Zend_Application package combined with the Bootstrap class.</p>
<p>Because i am not a real PHP programmer (consider myself as a junior in that area), it is rather difficult to learn all the ins-and-outs of the framework and i rely heavily on what other people write on the internet about the several topics considering the Zend Framework.</p>
<p>So i decided to bundle all my findings into one project setup and publish the sources on <a title="ZendFramework project on Google code" href="http://gertonscorner.googlecode.com/svn/trunk/ZendFramework/" target="_blank">Google code</a>. This way i always have access to these sources and i can refer to them within coming blog posts.</p>
<p><span id="more-83"></span>The first thing i did was setting up a project structure like the one shown in picture 1:</p>
<div id="attachment_84" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-84" title="project-outline" src="http://gertonscorner.files.wordpress.com/2009/10/project-outline.jpg?w=300&#038;h=245" alt="project outline zend framework" width="300" height="245" /><p class="wp-caption-text">figure 1: project outline zend framework</p></div>
<p>The root of the project contains besides the standard application, library and public folders, also folders for future unit tests and temporary files (caching, logfiles).</p>
<p>The library folder needs some explanation. Normally this folder contains a Zend folder with the Zend Framework classes. I decided not to hold a complete copy of the framework in my own Google code subversion repository, but instead a have set a subversion property svn:external, linking to the Zend Framework subversion repository.</p>
<p>When checking out the code from Google code, the Zend Framework classes will also be checked out (and automatically updated, when the svn:external property is updated) in the library folder.</p>
<p>So let start with the application folder structure. As shown the folder contains  a configs, default, modules and resources folder. When you follow the project setup explained in the <a title="Zend Framework Quick Start" href="http://framework.zend.com/docs/quickstart" target="_blank">Zend Framework Quick Start</a>, you will find some differences with the setup i use. For example all contents of the default folder are found in de Quick Start directly under the application folder and the Quick Start setup is missing the modules and resources folders.</p>
<p>I shall try to explain the rest of the project contents in some later posts, so in the meanwhile check out the sources and let me know what you think of it.</p>
<p>Here is a screenshot of what will be shown when the sources are succesfully installed within your local webserver.</p>
<div id="attachment_89" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-89" title="screenshot" src="http://gertonscorner.files.wordpress.com/2009/10/screenshot.jpg?w=300&#038;h=187" alt="Frontpage zend framework demoground" width="300" height="187" /><p class="wp-caption-text">Frontpage zend framework demoground</p></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=83&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2009/10/07/zend-framework-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>

		<media:content url="http://gertonscorner.files.wordpress.com/2009/10/project-outline.jpg?w=300" medium="image">
			<media:title type="html">project-outline</media:title>
		</media:content>

		<media:content url="http://gertonscorner.files.wordpress.com/2009/10/screenshot.jpg?w=300" medium="image">
			<media:title type="html">screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>Fileupload using Zend AMF, RemoteObject and Flash 10</title>
		<link>http://gertonscorner.wordpress.com/2009/04/19/fileupload-using-zend-amf-remoteobject-and-flash-10/</link>
		<comments>http://gertonscorner.wordpress.com/2009/04/19/fileupload-using-zend-amf-remoteobject-and-flash-10/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:12:21 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[Adobe Flex/AIR]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[remoting]]></category>
		<category><![CDATA[zend amf]]></category>
		<category><![CDATA[zend MVC]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=54</guid>
		<description><![CDATA[In one of my earlier posts i described a method for uploading files using the RemoteObject class found in the Flex SDK. For the &#8220;back end&#8221; i used the still very popular amfphp implementation of the AMF protocol.
Wade Arnold the maintainer of amfphp is also involved in another implementation of the AMF protocol which is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=54&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In one of my <a title="Fileupload using AMFPHP, RemoteObject and Flash 10" href="http://gertonscorner.wordpress.com/2009/03/15/fileupload-using-amfphp-remoteobject-and-flash-10/">earlier posts</a> i described a method for uploading files using the RemoteObject class found in the Flex SDK. For the &#8220;back end&#8221; i used the still very popular <a title="AMFPHP remoting" href="http://www.amfphp.org/docs2/index.html" target="_blank">amfphp</a> implementation of the AMF protocol.</p>
<p><a title="Wade Arnold blog" href="http://wadearnold.com/blog/" target="_blank">Wade Arnold</a> the maintainer of amfphp is also involved in another implementation of the AMF protocol which is shipped with the <a title="Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a>. After reading some blog posts about this &#8220;new&#8221; package called Zend_Amf, i decided to give it a try.</p>
<p>Download <a title="Full example code" href="http://gertonscorner.googlecode.com/files/ZendAMFUpload.zip">ZendAMFUpload.zip</a> for full example code.<br />
<span id="more-54"></span><br />
I started my quest with downloading of the latest <a title="Zend Framework library" href="http://www.zendframework.com/releases/ZendFramework-1.7.8/ZendFramework-1.7.8.zip">Zend Framework library</a>, which is now at version 1.7.8 and followed the instructions of the Quickstart guide, which can be found <a title="Zend Framework Quickstart guide" href="http://framework.zend.com/docs/quickstart" target="_blank">here</a>.</p>
<p>I also found a <a title="Zend_Amf with full Zend Framework" href="http://www.riaspace.net/2009/01/zend_amf-with-full-zend-framework/" target="_blank">great post</a> from Piotr Walczyszyn about how to merge the Zend_Amf package within the Zend Framework MVC structure and i used this approach as a starting point for my own example, but made the following changes compared to the tutorial of Piotr:</p>
<p>1)<br />
Because i don&#8217;t use a database within my example i removed all code related to the config, database and registry from my bootstrap.php file.</p>
<p>2)<br />
Somehow the disableLayout call in the MessageBrokerController init function Piotr provided resulted in an error, so i removed this line.</p>
<p>3)<br />
Instead of putting my data objects into a dto folder i used a folder named vo. It is the same, but i am used to call my remote data objects Value Objects.</p>
<p>4)<br />
During my quest i stumbled to some strange behaviour when sending Typed Objects (FileVO) from my flex client to the service layer. According to the Zend_Amf documentation you could use $_explicitType within a ValueObject for mapping serverside PHP classes with AS3 classes, but this only worked for retrieving typed objects, not for sending typed objects. Finally i found these issues related to class mapping of typed objects: <a href="http://www.zendframework.com/issues/browse/ZF-5755" target="_blank">ZF-5755</a>, <a href="http://www.zendframework.com/issues/browse/ZF-5885">ZF-5885</a> and <a href="http://www.zendframework.com/issues/browse/ZF-6130">ZF-6130</a>, and decided to use the $server-&gt;setClassMap call in my MessagebrokerController.</p>
<p>Here is the code i ended up with:</p>
<p><em>MessagebrokerController.php</em><br />
<code><br />
class MessagebrokerController extends Zend_Controller_Action {<br />
// Initialise controller with no view renderer<br />
public function init()	{<br />
$this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender(true);<br />
}<br />
// amf action<br />
public function amfAction()	{<br />
$server = new Zend_Amf_Server();<br />
$server-&gt;addDirectory(APPLICATION_PATH . '/services/');<br />
// Mapping of PHP FileVO class and AS3 FileVO class<br />
$server-&gt;setClassMap("FileVO", "FileVO");<br />
echo($server-&gt;handle());<br />
}<br />
}<br />
</code></p>
<p><em>FileVO.php</em></p>
<p><code><br />
class FileVO {<br />
public $filename;<br />
public $filedata;<br />
}<br />
</code></p>
<p><em>RemoteFile.php</em></p>
<p><code><br />
class RemoteFile {<br />
/**<br />
* Upload files!<br />
*<br />
* @param  $file as a FileVO Object<br />
* @return string<br />
**/<br />
public function upload($file) {<br />
$data = $file-&gt;filedata;<br />
file_put_contents( APPLICATION_PATH . '/uploads/' . $file-&gt;filename, $data);<br />
return 'File: ' . $file-&gt;filename .' Uploaded ';<br />
}<br />
}<br />
</code></p>
<p>I kept the flex code the same as in my earlier post except for the remote service endpoint url, which should be now something like</p>
<p>http://[some-host]/messagebroker/amf</p>
<p>Download <a title="Full example code" href="http://gertonscorner.googlecode.com/files/ZendAMFUpload.zip">ZendAMFUpload.zip</a> for full example code.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=54&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2009/04/19/fileupload-using-zend-amf-remoteobject-and-flash-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
		<item>
		<title>Fileupload using AMFPHP, RemoteObject and Flash 10</title>
		<link>http://gertonscorner.wordpress.com/2009/03/15/fileupload-using-amfphp-remoteobject-and-flash-10/</link>
		<comments>http://gertonscorner.wordpress.com/2009/03/15/fileupload-using-amfphp-remoteobject-and-flash-10/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 14:02:27 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[Adobe Flex/AIR]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[remoting]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=38</guid>
		<description><![CDATA[File upload  with Adobe Flex is a common asked feature for lots of applications. There are several posts on the internet to be found which explain, in detail, how to do this.
Most of these examples however uses the http protocol to transport the binary data. With the arrival of the Adobe Flash 10 player [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=38&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>File upload  with Adobe Flex is a common asked feature for lots of applications. There are several posts on the internet to be found which explain, in detail, how to do this.</p>
<p>Most of these examples however uses the http protocol to transport the binary data. With the arrival of the Adobe Flash 10 player and the new FileReference features that comes with it, it is now also possible to upload a file via a RemoteObject service call.</p>
<p><span id="more-38"></span></p>
<p>For the coming example it is assumed that <a title="AMFPHP remoting" href="http://www.amfphp.org/docs2/index.html" target="_blank">amfphp 1.9</a> and Flash player 10 (Flex 3.2 SDK) is installed and running. Furthermore i am using a setup as described in one of my earlier posts about <a title="RemoteObject using AMFPHP and Actionscript 3" href="http://gertonscorner.wordpress.com/2008/09/06/remoteobject-using-amfphp-and-actionscript-3/">RemoteObject and AMFPHP</a>. Download <a title="Full example code" href="http://gertonscorner.googlecode.com/files/PHPUpload.zip">PHPUpload.zip</a> for full example code.</p>
<p>Copy the services contents found in the zip to your amfphp services location (and check the amfphp/globals.php if your &#8220;vo&#8221; location is configurated to &#8220;services/vo/&#8221;).</p>
<p>Within your services directory a RemoteFile.php can be found with a public function upload, which require a parameter of type FileVO:</p>
<p><code><br />
require_once ('./vo/FileVO.php');<br />
class RemoteFile {<br />
/**<br />
* Upload files!<br />
*<br />
* @param  FileVO $file<br />
* @return string<br />
**/<br />
public function upload(FileVO $file) {<br />
$data = $file-&gt;filedata-&gt;data;<br />
file_put_contents( 'uploads/' . $file-&gt;filename, $data);<br />
return 'File: ' . $file-&gt;filename .' Uploaded ';<br />
}<br />
}<br />
</code></p>
<p>The FileVO php class has a Flex counterpart also called FileVO which is used as a so called RemoteClass. This RemoteClass has an attribute for the filename and filedata (ByteArray).</p>
<p>No we are ready to create the service class for the upload example, this class will be named RemoteFileService and extends the RemoteService super class.<code>public class RemoteFileService extends RemoteService {<br />
private static var phpServiceClass:String = "RemoteFile";<br />
//constructor<br />
public function RemoteFileService(amfChannelId:String, amfChannelEndpoint:String) {<br />
super("remotefileService","amfphp", amfChannelId, amfChannelEndpoint);<br />
}<br />
// Upload function<br />
public function upload(file:FileVO):void {<br />
remoteObject.source = phpServiceClass;<br />
remoteObject.upload.addEventListener(<br />
ResultEvent.RESULT,handleRemoteMethod);<br />
remoteObject.upload(file);<br />
}<br />
// Remote result handler<br />
protected function handleRemoteMethod(event:ResultEvent):void {<br />
var uploadStatus:String;<br />
uploadStatus = event.result.toString();<br />
Application.application.dispatchEvent(<br />
new RemoteResultEvent(RemoteResultEvent.UPLOAD_STATUS, uploadStatus));<br />
}<br />
}</code></p>
<p>The Flex application file contains a text component (which will be filled with the selected filename), a button for selecting a file and a button to start the upload. Download <a title="Full example code" href="http://gertonscorner.googlecode.com/files/PHPUpload.zip">PHPUpload.zip</a> for full example code.</p>
<p>After a succesfull upload the selected file will be placed in the amfphp/services/uploads directory (needs write privileges!) and an Alert shows a message from the server.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=38&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2009/03/15/fileupload-using-amfphp-remoteobject-and-flash-10/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
		<item>
		<title>Localized flex login using the Swiz framework</title>
		<link>http://gertonscorner.wordpress.com/2009/03/07/localized-flex-login-using-the-swiz-framework/</link>
		<comments>http://gertonscorner.wordpress.com/2009/03/07/localized-flex-login-using-the-swiz-framework/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 15:36:30 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[Adobe Flex/AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[runtime localization]]></category>
		<category><![CDATA[swiz framework]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=27</guid>
		<description><![CDATA[After reading some blogs about a relative new Flex framework called swiz, i decided to try it out some time. Swiz is a framework. started by Chris Scott, that aims to bring complete simplicity to RIA development.
To get some feeling with the framework i started to work out a login example i found on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=27&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After reading some blogs about a relative new Flex framework called <a title="Swiz framework" href="http://code.google.com/p/swizframework/" target="_blank">swiz</a>, i decided to try it out some time. Swiz is a framework. started by <a title="Blog of Chris Scott" href="http://cdscott.blogspot.com/" target="_blank">Chris Scott</a>, that aims to bring complete simplicity to RIA development.</p>
<p>To get some feeling with the framework i started to work out a login example i found on the blog from <a title="Blog of Sönke Rohde" href="http://soenkerohde.com/2008/11/mock-business-delegates-with-swiz/" target="_blank">Sönke Rohde</a>, which uses a utility for mocking service calls, which also can be found in the swiz framework. For my own example i used the following snapshot <a href="http://swizframework.googlecode.com/files/swiz-0.0.5-010609.swc">swiz-0.0.5-010609.swc</a> with mediator and event type checking support, but decided to extend the login sample with some runtime localization features.</p>
<p>These localization features consist of some xml-files which can be loaded during runtime and are used for translating labels and fault messages (bad credentials).</p>
<p>During development of the new example i found out that the mockutility in the framework only returned a result. In a real-life application faults will occur so i copied the sources of the swiz framework TestUtil class into a new class called MockUtil and added my own mockFault and mockFaultEvent methods.</p>
<p>The sources of my extended login example can be downloaded <a href="http://gertonscorner.googlecode.com/files/SwizControl.zip">here</a> (swiz library not included!). The assets/data/users.xml file contains the mock data for the login and can be modified with your own user credentials. The assets/locale directory contains sub-directories with the localization files used.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=27&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2009/03/07/localized-flex-login-using-the-swiz-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
		<item>
		<title>The Paradox of Our Age</title>
		<link>http://gertonscorner.wordpress.com/2008/12/29/the-paradox-of-our-age/</link>
		<comments>http://gertonscorner.wordpress.com/2008/12/29/the-paradox-of-our-age/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 10:00:43 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[All about nothing]]></category>
		<category><![CDATA[Dalai Lama]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=22</guid>
		<description><![CDATA[Almost 2009! So here is something to think about.
The Paradox of Our Age
&#8220;We have bigger house, but smaller families;
more convenience, but less time.
We have more degrees, but less sense;
more knowledge, but less judgement;
more experts, but more problems;
more medicines, but less healthiness.
We have been all the way to the moon and back,
but have trouble crossing the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=22&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Almost 2009! So here is something to think about.</p>
<blockquote cite="His Holiness The XIVth Dalai Lama"><p><strong>The Paradox of Our Age</strong></p>
<p>&#8220;We have bigger house, but smaller families;<br />
more convenience, but less time.<br />
We have more degrees, but less sense;<br />
more knowledge, but less judgement;<br />
more experts, but more problems;<br />
more medicines, but less healthiness.<br />
We have been all the way to the moon and back,<br />
but have trouble crossing the street to meet the<br />
new neighbour.<br />
We build more computers to hold more<br />
information to produce more copies than ever,<br />
but have less communication.<br />
We have become long on quantity,<br />
but short on quality.<br />
These are times of fast foods,<br />
but slow digestion;<br />
tall man, but short character;<br />
steep profits, but shallow relationships.<br />
It&#8217;s a time when there is much in window,<br />
but nothing in the room.&#8221;</p></blockquote>
<p><cite>His Holiness The XIVth Dalai Lama</cite></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=22&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2008/12/29/the-paradox-of-our-age/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
		<item>
		<title>RemoteObject using AMFPHP and Actionscript 3</title>
		<link>http://gertonscorner.wordpress.com/2008/09/06/remoteobject-using-amfphp-and-actionscript-3/</link>
		<comments>http://gertonscorner.wordpress.com/2008/09/06/remoteobject-using-amfphp-and-actionscript-3/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 10:11:06 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[Adobe Flex/AIR]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[remoting]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=6</guid>
		<description><![CDATA[In my daytime job i am currently involved with a Flex3/BlazeDS project.The question arises to me quickly if it was possible to use Actionscript 3 RemoteObject classes with a PHP back end. A quick search with Google showed me some examples where Flex mxml in combination with amfphp 1.9 was used. This particular version of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=6&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In my daytime job i am currently involved with a Flex3/BlazeDS project.The question arises to me quickly if it was possible to use Actionscript 3 RemoteObject classes with a PHP back end. A quick search with Google showed me some <a title="RemoteObject examples using amfphp" href="http://www.sephiroth.it/tutorials/flashPHP/flex_remoteobject/index.php" target="_blank">examples</a> where Flex mxml in combination with <a title="amfphp 1.9" href="http://www.amfphp.org/docs2/index.html" target="_blank">amfphp 1.9</a> was used. This particular version of amfphp has support for AMF3 messaging protocol and therefore can be used natively with AS3 RemoteObject.</p>
<p>In my example i wanted to do something different by using AS3 RemoteObject classes and creating Channels at runtime, so no server-config.xml is needed during compile time.</p>
<p><span id="more-6"></span></p>
<p>For the coming example it is assumed that amfphp 1.9 is installed and running. for the backend service i use a slightly changed HelloWorld.php which can be found in the <a title="first service" href="http://www.amfphp.org/docs2/first_service.html" target="_blank">amfphp examples</a>:</p>
<p><code> class HelloWorld {<br />
/**<br />
* Say hello!<br />
*<br />
* @param  string $sMessage<br />
* @return string<br />
**/<br />
public function say($sMessage) {<br />
$date = getdate();<br />
if (!$sMessage) {<br />
throw new Exception("No message has been given",10001);<br />
}<br />
return 'You said: ' . $sMessage .' on '.$date[weekday];<br />
}<br />
}<br />
?&gt;</code></p>
<p>I introduced a PHP exception when no message parameter is given.<br />
The next step involves the creation of the RemoteService super class. The constructor method is shown below (download <a title="Full example code" href="http://gertonscorner.googlecode.com/files/PHPRemoting.zip" target="_blank">PHPRemoting.zip</a> for full example code).</p>
<p><code>public function RemoteService( serviceId:String<br />
, serviceDestination:String<br />
, amfChannelId:String<br />
, amfChannelEndpoint:String<br />
)<br />
{<br />
// Create a runtime Channelset for given Channel ID and Endpoinr URI<br />
var amfChannel:AMFChannel = new AMFChannel(amfChannelId, amfChannelEndpoint);<br />
amfChannelSet = new ChannelSet();<br />
amfChannelSet.addChannel(amfChannel);<br />
// Create the remoteObject instance<br />
this.remoteObject = new RemoteObject(serviceId);<br />
this.remoteObject.channelSet = amfChannelSet;<br />
this.remoteObject.destination = serviceDestination;<br />
this.remoteObject.addEventListener(FaultEvent.FAULT,onRemoteException);<br />
}</code></p>
<p>All new service classes will extend this RemoteService super class and inherit all methods available.</p>
<p>No we are ready to create the service class for the HelloWorld example, this class will be named HelloWorldService and extends the RemoteService super class.</p>
<p><code>package remoting.services<br />
{<br />
import mx.controls.Alert;<br />
import mx.rpc.events.ResultEvent;<br />
import mx.core.Application;<br />
import remoting.events.RemoteResultEvent;<br />
/**<br />
* Class that extends the RemoteService class, therefore it makes use of the default error handling for<br />
* remote calls.<br />
*/<br />
public class HelloWorldService extends RemoteService {<br />
// Static var with the PHP classname<br />
private static var phpServiceClass:String = "HelloWorld";<br />
//Constructor<br />
public function HelloWorldService(amfChannelId:String, amfChannelEndpoint:String) {<br />
super("helloworldService","amfphp", amfChannelId, amfChannelEndpoint);<br />
}<br />
//<br />
public function say(msg:String):void {<br />
remoteObject.source = phpServiceClass;<br />
remoteObject.say.addEventListener(<br />
ResultEvent.RESULT,handleRemoteMethod);<br />
// call the PHP method<br />
remoteObject.say(msg);<br />
}<br />
// Result handler<br />
protected function handleRemoteMethod(event:ResultEvent):void {<br />
var helloworld:String;<br />
helloworld = event.result.toString();<br />
Application.application.dispatchEvent(<br />
new RemoteResultEvent(RemoteResultEvent.HELLO_WORLD, helloworld));<br />
}<br />
}<br />
}</code></p>
<p>There is only a resulthandler implemented for the remoteobject call, because the fault handler is already implemented within the RemoteService super class. Important thing is the static var phpServiceClass which contains the name of the PHP class which will be binded to the remoteObject.</p>
<p>Now the plumbing is ready (download <a title="Full example code" href="http://gertonscorner.googlecode.com/files/PHPRemoting.zip" target="_blank">PHPRemoting.zip</a> for full example code) it is time to create the Flex application file. This example application has a TextInput box for the message and a Button to call the remote method.</p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"<br />
layout="vertical"<br />
creationComplete="init();"&gt;<br />
&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
import remoting.events.RemoteExceptionEvent;<br />
import remoting.events.RemoteResultEvent;<br />
import remoting.services.HelloWorldService;<br />
import mx.controls.Alert;<br />
//<br />
private var amfChannelId:String = "my-amfphp";<br />
private var amfGateway:String = "http://localhost/amfphp/gateway.php";<br />
private var service:HelloWorldService;<br />
// Initialization<br />
private function init():void {<br />
this.addEventListener(RemoteExceptionEvent.REMOTE_EXCEPTION, handleRemoteExceptionEvent);<br />
this.addEventListener(RemoteResultEvent.HELLO_WORLD, handleRemoteResultEvent);<br />
// Create a new service instance<br />
service = new HelloWorldService( amfChannelId, amfGateway );<br />
}<br />
// Button action handler<br />
private function clickHandler():void {<br />
service.say(msg.text);<br />
}<br />
// Result handlers<br />
private function handleRemoteResultEvent(event:RemoteResultEvent):void {<br />
Alert.show(event.message);<br />
}<br />
private function handleRemoteExceptionEvent(event:RemoteExceptionEvent):void {<br />
Alert.show(event.message);<br />
}<br />
]]&gt;<br />
&lt;/mx:Script&gt;<br />
&lt;mx:TextInput id="msg"/&gt;<br />
&lt;mx:Button label="say something" click="clickHandler();"/&gt;<br />
&lt;/mx:Application&gt;</code></p>
<p>When no text is provided the PHP class will throw an exception which is shown in the Alert box. Just try it out.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gertonscorner.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gertonscorner.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=6&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2008/09/06/remoteobject-using-amfphp-and-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
		<item>
		<title>Badge installing AIR application with SWFObject</title>
		<link>http://gertonscorner.wordpress.com/2008/02/29/badge-installing-air-application-with-swfobject/</link>
		<comments>http://gertonscorner.wordpress.com/2008/02/29/badge-installing-air-application-with-swfobject/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 20:39:30 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[Adobe Flex/AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[badge]]></category>
		<category><![CDATA[SWFObject]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/?p=4</guid>
		<description><![CDATA[Adobe finally released it&#8217;s 1.0 version of AIR, so let&#8217;s go to work and create great looking applications. But how on earth do we deploy these applications to the public?
When downloading the AIR SDK a sample is provided for installing and deploying air applications using the badge installer. This badge installer consist of a badge.swf [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=4&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Adobe finally released it&#8217;s 1.0 version of AIR, so let&#8217;s go to work and create great looking applications. But how on earth do we deploy these applications to the public?</p>
<p>When downloading the <a href="http://www.adobe.com/products/air/tools/sdk/" title="Adobe AIR SDK download" target="_blank">AIR SDK</a> a sample is provided for installing and deploying air applications using the badge installer. This badge installer consist of a badge.swf file and some javascript which can be used within html and automatically installs the right version of the Adobe AIR runtime followed by your application.</p>
<p>When using flash within (x)html i personally prefer to use the <a href="http://blog.deconcept.com/swfobject/" title="SWFObject for for embedding Adobe Flash content" target="_blank">SWFObject</a> javascript file so here are the steps involved of deploying AIR applications using the badge installer and SWFObject.</p>
<p>First of all you need to change your webserver configuration to add support for the AIR mime type by adding the following line to your, for example, Apache configuration file:</p>
<p><code>AddType application/vnd.adobe.air-application-installer-package+zip air</code></p>
<p>Now it is time to use SWFObject. Simply include the <code>swfobject.js</code> Javascript file in the head section of your html, then use a small amount of Javascript on your page to embed your Flash movie. In our case this will be the badge.swf file from the AIR SDK. A complete example with the necessary variables for installing the AIR 1.0 runtime and an example &#8220;hello world&#8221; AIR application is shown below.<br />
<code><br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;<br />
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Deploy Hello World&lt;/title&gt;<br />
&lt;script type="text/javascript" src="swfobject.js"&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div id="flashcontent"&gt;<br />
This will hold the flash content<br />
&lt;/div&gt;<br />
&lt;script type="text/javascript"&gt;<br />
// &lt;![CDATA[<br />
var so = new SWFObject("your/path/to/badge.swf", "badge", "217", "180", "9.0.115", "#FFFFFF");<br />
so.addVariable( "appname", "Hello World" );<br />
so.addVariable( "appurl",   "http://your-host/HelloWorld.air" );<br />
so.addVariable( "imageurl", "test.jpg" );<br />
so.addVariable( "airversion", "1.0" );<br />
so.write("flashcontent");<br />
// ]]&gt;<br />
&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gertonscorner.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gertonscorner.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=4&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2008/02/29/badge-installing-air-application-with-swfobject/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
		<item>
		<title>On the blog train</title>
		<link>http://gertonscorner.wordpress.com/2007/06/10/on-the-blog-train/</link>
		<comments>http://gertonscorner.wordpress.com/2007/06/10/on-the-blog-train/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 14:51:09 +0000</pubDate>
		<dc:creator>Gerton</dc:creator>
				<category><![CDATA[All about nothing]]></category>

		<guid isPermaLink="false">http://gertonscorner.wordpress.com/2007/06/10/on-the-blog-train/</guid>
		<description><![CDATA[Never thought that this would happen, but i have just started a weblog.
Hopefully it will last for a long time, but hey nobody knows where this blog train will lead us.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=3&subd=gertonscorner&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Never thought that this would happen, but i have just started a weblog.</p>
<p>Hopefully it will last for a long time, but hey nobody knows where this blog train will lead us.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gertonscorner.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gertonscorner.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gertonscorner.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gertonscorner.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gertonscorner.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gertonscorner.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gertonscorner.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gertonscorner.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gertonscorner.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gertonscorner.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gertonscorner.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gertonscorner.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gertonscorner.wordpress.com&blog=1218571&post=3&subd=gertonscorner&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gertonscorner.wordpress.com/2007/06/10/on-the-blog-train/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6f94a1f04b4abb17c51bdf7fc46ee0f3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Agee</media:title>
		</media:content>
	</item>
	</channel>
</rss>