<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Mike Chambers</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/" />
<modified>2009-07-19T08:35:37Z</modified>
<tagline>Mike Chambers. Senior Product Manager, Developer Relations at Adobe.</tagline>
<id>tag:blogs.adobe.com,2009:/mesh//334</id>
<generator url="http://www.movabletype.org/" version="4.261">Movable Type</generator>
<copyright>Copyright (c) 2007, mesh</copyright>

<entry>
<title>My Weblog Has Moved</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/my_weblog_has_m.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-24T20:35:03Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24152</id>
<created>2007-04-24T20:35:03Z</created>
<summary type="text/plain">Just a quick fyi, but I have moved my weblog to a new server and domain. http://www.mikechambers.com/blog/ Please make sure to update all of your URLs and feeds. All posts should redirect to the appropriate post on the new site....</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Just a quick fyi, but I have moved my weblog to a new server and domain.</p>

<p><a href="http://www.mikechambers.com/blog/">http://www.mikechambers.com/blog/</a></p>

<p>Please make sure to update all of your URLs and feeds.</p>

<p>All posts should redirect to the appropriate post on the new site.</p>]]>

</content>
</entry>

<entry>
<title>Apollo Chat today on IRC</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/apollo_chat_tod.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-23T17:26:50Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24151</id>
<created>2007-04-23T17:26:50Z</created>
<summary type="text/plain">Well, it appears that a lot of people are interested in an Apollo chat via IRC, so I set up a room today if anyone want to chat, or ask questions about Apollo. Server: irc.prison.net (efnet) room : #apollochat I...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Well, it appears that <a href="http://weblogs.macromedia.com/mesh/archives/2007/04/flex_apollo_irc.html">a lot of people are interested in an Apollo chat</a> via IRC, so I set up a room today if anyone want to chat, or ask questions about Apollo.</p>

<p>Server: irc.prison.net (efnet)<br />
room : #apollochat</p>

<p>I was hoping to get a room on freenet, but was having trouble registering the room, so for today, Ill hang around on efnet.</p>

<p>Ill be in and out, but if anyone wants to hang out and chat, then join up.</p>

<p>You can find information on <a href="http://en.wikipedia.org/wiki/Internet_Relay_Chat">IRC at wikipedia</a>.</p>]]>

</content>
</entry>

<entry>
<title>Ascension Application and Source Released</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/ascension_appli.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-23T16:38:02Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24150</id>
<created>2007-04-23T16:38:02Z</created>
<summary type="text/plain">Well, I know it took forever, but I have finally released the source and an AIR file for Ascension, an Apollo based mp3 player and music explorer. You can download the latest AIR file, as well as grab the source,...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Well, I know it took forever, but I have finally released the <a href="http://code.google.com/p/ascensionplayer/">source and an AIR file for Ascension</a>, an <a href="http://www.adobe.com/go/apollo">Apollo</a> based mp3 player and music explorer. You can download the latest AIR file, as well as grab the source, log bugs, and discuss the player from the <a href="http://code.google.com/p/ascensionplayer/">Ascension project page at Google Code</a>.</p>

<p>All of the source is included, and is released under an open source license.</p>]]>
<![CDATA[<p>I am sorry it took so long to release, but I am usually reluctant to release source code that I feel needs more work. Ascension was one of the first Apollo applications, and as such, has under gone a lot of changes since I first built it. Because of this, the code does need some refactoring, but I figured that in general, it was more valuable to everyone if I released the source now.</p>

<p>If you are interested working on the Ascension project, then please join the <a href="http://groups.google.com/group/ascensionplayer">Ascension mailing list</a>. There is a lot of work that needs to be done, including refactoring, adding direct mp3 support, new windowing modes, new design, and writing documentation.</p>

<p>If you run into any bugs, or have feature requests, please make sure to <a href="http://code.google.com/p/ascensionplayer/issues/list">log them</a>.</p>]]>
</content>
</entry>

<entry>
<title>Flex / Apollo IRC Channel?</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/flex_apollo_irc.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-20T00:16:37Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24149</id>
<created>2007-04-20T00:16:37Z</created>
<summary type="text/plain">There have been a couple of posts over the past couple of days with people talking about using IRC to chat about Flex and Apollo. I think this is an cool idea, and would love to get an room started...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>There have been a couple of posts over the past couple of days with people talking about using IRC to chat about Flex and Apollo. I think this is an cool idea, and would love to get an room started that stayed pretty active.</p>

<p>I would especially like to do weekly chats with the Flex, Apollo and Player teams. I think that would be a lot of fun, and enable everyone to speak directly with the people building these technologies.</p>

<p>Is anyone else interested in participating in an IRC channel for Flex / Apollo / ActionScript discussions? If so, which server should we use? What about a channel name?</p>

<p>Anyone interested? Post feedback in the comments?</p>]]>

</content>
</entry>

<entry>
<title>Apollo Camp Twitter Application Released</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/apollo_camp_twi.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-11T16:24:51Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24148</id>
<created>2007-04-11T16:24:51Z</created>
<summary type="text/plain">Daniel Dura has just released the Twitter application that we used at Apollo Camp to help coordinate back chanell conversations (it saved us from a beer disaster!). Anyways, not only can you download the application, but Danny has also open...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Daniel Dura has just released the <a href="http://www.danieldura.com/code/twittercamp/">Twitter application that we used at Apollo Camp</a> to help coordinate back chanell conversations (it saved us from a beer disaster!).</p>

<p>Anyways, not only can you download the application, but Danny has also open sourced it, and made the source available. So, now you can modify and use it for your own event.</p>

<p>You can grab the download, as well as the source, from <a href="http://www.danieldura.com/code/twittercamp/">here</a>.</p>]]>

</content>
</entry>

<entry>
<title>Apollo Cheat Sheets</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/apollo_cheat_sh.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-10T19:55:26Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24147</id>
<created>2007-04-10T19:55:26Z</created>
<summary type="text/plain">Sean Moore has put together a set of free Apollo ActionScript cheat sheets. You can download them from here....</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Sean Moore has put together a set of free <a href="http://actionscriptcheatsheet.com/blog/archives/32">Apollo ActionScript cheat sheets</a>.</p>

<p>You can download them from <a href="http://actionscriptcheatsheet.com/blog/archives/32">here</a>.</p>]]>

</content>
</entry>

<entry>
<title>Top 5 New Features in Flash CS3</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/top_5_new_featu.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-09T18:08:59Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24146</id>
<created>2007-04-09T18:08:59Z</created>
<summary type="text/plain">Read about it here....</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Read about it <a href="http://digg.com/software/The_top_5_new_features_in_Flash_CS3">here</a>.</p>]]>

</content>
</entry>

<entry>
<title>What videos do you want to see at video.onflex.org</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/04/what_videos_do.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-04-04T07:09:41Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24145</id>
<created>2007-04-04T07:09:41Z</created>
<summary type="text/plain">Well, Ted Patrick and I launched video.onflex.org a little over 3 weeks ago, and we are already nearing our twentieth video on the site. If you haven&apos;t checked it out yet, make sure to glance through some of the videos....</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>
<dc:subject>Weblog</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Well, <a href="http://www.onflex.org">Ted Patrick</a> and I launched <a href="http://video.onflex.org">video.onflex.org</a> a little over 3 weeks ago, and we are already nearing our twentieth video on the site. If you haven't checked it out yet, make sure to <a href="http://video.onflex.org">glance through some of the videos</a>.</p>

<p>Anyways, we are nearing the end of our backlog of videos, and it looks like I have some time this Thursday and Friday to create some more videos, so:</p>

<p><strong>What Flex and / or Apollo videos you want to see on video.onflex.org? What do you want us to show? Who do you want us to interview?</strong></p>

<p>Let us know by posting your thoughts in the comments.</p>]]>

</content>
</entry>

<entry>
<title>Simple HTML Based Apollo Example</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/03/simple_html_bas.html" />
<modified>2009-07-19T08:35:37Z</modified>
<issued>2007-03-28T19:36:01Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24144</id>
<created>2007-03-28T19:36:01Z</created>
<summary type="text/plain">Most of the docs and examples for the Apollo alpha are Flex / ActionScript focused (next beta will be more focused on HTML / JavaScript). However, you can build Apollo applications using just HTML and JavaScript. Here is a simple...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[Most of the docs and examples for the <a href="http://www.adobe.com/go/apollo">Apollo alpha</a> are Flex / ActionScript focused (next beta will be more focused on HTML / JavaScript). However, you can build Apollo applications using just HTML and JavaScript.

Here is a simple example that shows how to build an HTML / JavaScript Apollo application, and how to access Apollo APIs from JavaScript. The application shows how to launch a file browser from the application, and access information about the selected file (you could then easily read in the contents of the file).]]>
<![CDATA[Note, that we are working on making it a little easier to access the Apollo apis from JavaScript. 

<b>application.xml</b>
[code]<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/apollo/application/1.0.M3" 
	appId="com.adobe.mesh.HTMLFileExample" version=".4">   
	
      <properties>
            <name>HTMLFileExample</name>
            <description></description>
            <publisher>Mike Chambers</publisher>
            <copyright></copyright>
      </properties>

      <rootContent systemChrome="standard" transparent="false" visible="true">
      	fileexample.html
      </rootContent>

</application>
[/code]

<b>fileexample.html</b>
[code]<html>

<head>

	<script type="text/javascript" src="fileexample.js"></script>
</head>

<body onload="onLoad()">

<input type="button" value="Select a File" onClick="onFileClick();"><br />

<textarea rows="10" cols="40" id="output"></textarea>

</body>[/code]

<b>fileexample.js</b>
[code]
var apollo = window.runtime;

//called when page has loaded
function onLoad()
{
	//set initial size of app window
	window.resizeTo(400,300);
}

//called when button is pressed to select a file
function onFileClick()
{
	//this will trace out the string to the command line
	apollo.trace("hello");
	
	//get a reference to the desktop
	var f = apollo.flash.filesystem.File.desktopDirectory;
	
	//listen for the select event
	f.addEventListener(apollo.flash.events.Event.SELECT, onFileSelect);
	
	//open the browse dialog
	f.browse();
}


//called when user selects a file
function onFileSelect(e)
{
	//print the path of the selected file
	output.value = e.target.url;
}[/code]

You can test this by using ADL (included in the <a href="http://www.adobe.com/go/apollo">Apollo SDK</a>) from the command line like so:

[code]adl application.xml[/code]

You can download the code from <a href="/mesh/files/apollo/htmlexample.zip">here</a>.

Post any questions in the comments.]]>
</content>
</entry>

<entry>
<title>Why Apollo?</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/03/why_apollo.html" />
<modified>2009-07-19T08:35:36Z</modified>
<issued>2007-03-28T17:53:31Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24143</id>
<created>2007-03-28T17:53:31Z</created>
<summary type="text/plain">There has been a lot of excitement, interest and discussion around Apollo, especially since we released the public alpha on labs last week. One thing that has come up a couple of times, is confusion over what Apollo is as...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>There has been a lot of excitement, interest and discussion around Apollo, especially since we released the <a href="http://www.adobe.com/go/apollo">public alpha on labs last week</a>. One thing that has come up a couple of times, is confusion over what Apollo is as well as what value it provides. A lot of the discussion has focused on uncertainty about why would you want to move web applications outside of the browser. </p>

<p>A lot of times when this question gets answered, the answer focuses on specific Apollo features (file I/O API, working offline). While these are things that Apollo can do today, that are difficult if not impossible to do consistently in the browser, a feature based discussion doesn't address the fundamental question of why would you want to move applications out of the browser.</p>

<p>I had been planning to write up my thoughts on this, and realized that I already had as part of the <a href="http://www.adobe.com/go/apolloflexpocketguide">Apollo Pocket Guide for Flex Developers</a>. Below is chapter one from that book, which explains what Apollo is, and what problems it is trying to solve. (You can download the entire book from <a href="http://www.adobe.com/go/apolloflexpocketguide">here</a>).</p>

<p>Note that the excerpt does contain a discussion of features, but one of the primary advantages of Apollo, which isn't a specific feature, is that it allows applications to run outside of the browser. This is not a ding on browsers, or web technologies, and as I point out, the browser has some strong advantages that often outweigh its disadvantages.</p>

<p>Ultimately though, because browser based and Apollo based applications are built using the same technologies, it is possible to deploy to both platforms, taking advantages of the strengths of each. Because of this, Apollo applications compliment web applications. They do not replace them.</p>]]>
<![CDATA[<span style="font-weight: bold;">What is Apollo?</span><br><br>
Apollo is a new cross-platform desktop runtime being developed by Adobe
that allows web developers to use web technologies to build and deploy
Rich Internet Applications and web applications to the desktop. <br>
<br>
In order to better understand what Apollo enables, and which problems
it tries to address, it is useful to first take a quick look over at
the (relatively short) history of web applications. <br>
<br>
<span style="font-weight: bold;">A Short History of Web
Applications </span><br>
<br>
Over the past couple of years, there has been an accelerating trend of
applications moving from the desktop to the web browser. This has been
driven by a number of factors, which include: <br>
<br>
<ul>
  <li>The growth of the Internet as a communication medium </li>
  <li>The relative ease of deployment of web applications </li>
  <li>The ability to target multiple operating systems via the
browser </li>
  <li>The maturity of higher-level client technologies, such the
browser and the Flash Player runtime </li>
</ul>
Early web applications were built primarily with HTML and JavaScript,
which, for the most part, heavily relied on client/server interactions
and page refreshes. This page refresh model was consistent with the
document-based metaphor for which the browser was originally designed,
but provided a relatively poor user experience when displaying
applications. <br>
<br>
However, with the maturation of the Flash Player runtime, and more
recently Ajax-type functionality in the browser, it became possible for
developers to begin breaking away from page-based application flows. In
short, developers began to be able to offer richer application
experiences via the browser. In a whitepaper from March 2002,
Macromedia coined the term Rich Internet Application (RIA), to describe
these new types of applications in browsers, which &ldquo;blend
content, application logic and communications&hellip;to make the
Internet more usable and enjoyable.&rdquo; These applications
provided richer, more desktop-like experiences, while still retaining
the core cross-platform nature of the Web: <br>
<br>
Internet applications are all about reach. The promise of the web is
one of content and applications anywhere, regardless of the platform or
device. Rich clients must embrace and support all popular desktop
operating systems, as well as the broadest range of emerging device
platforms such as smart phones, PDAs, set-top boxes, game consoles, and
Internet appliances. <br>
<br>
You can find the complete whitepaper and more information on RIAs <a
 href="http://download.macromedia.com/pub/flash/whitepapers/richclient.pdf">here</a>.
<br>
<br>
The paper goes on to list some features that define RIAs: <br>
<br>
<ul>
  <li>Provide an efficient, high performance runtime for
executing code, content, and communications. </li>
  <li>Integrate content, communications, and application
interfaces into a common environment. </li>
  <li>Provide powerful and extensible object models for
interactivity. </li>
  <li>Enable rapid application development through components and
re-use. </li>
  <li>Enable the use of web and data services provided by
application servers. </li>
  <li>Embrace connected and disconnected clients. </li>
  <li>Enable easy deployment on multiple platforms and devices. </li>
</ul>
This movement toward providing richer, more desktop-like application
experiences in the browser (enabled by the Flash Player runtime, and
more recently by Ajax techniques) has led to an explosion of web
applications. <br>
<br>
Today the web has firmly established itself as an application
deployment platform that offers benefits to both developers and end
users. These benefits include the ability to:<br>
<ul>
  <li>Target multiple platforms and operating systems. </li>
  <li>Develop with relatively high-level programming and layout
languages. </li>
  <li>Allow end users to access their applications and data from
virtually any Internet-connected computer. </li>
</ul>
The growth of web applications can be seen in both the Web 2.0
movement, which consists almost entirely of web based applications and
APIs, as well as the adoption of web applications as a core business
model of major companies and organizations. <br>
<br>
<span style="font-weight: bold;">Problems with Delivering
Applications via the Browser </span><br>
<br>
As web applications have become more complex, they have begun to push
the boundaries of both the capabilities of the browser and the
usability of the application. As their popularity grows, these issues
become more apparent and important and highlight that there are still a
number of significant issues for both developers and end users when
deploying applications via the browser. <br>
<br>
The web browser was original designed to deliver and display HTML-based
documents. Indeed, the basic design of the browser has not
significantly shifted from this purpose. This fundamental conflict
between document-and application-focused functionality creates a number
of problems when deploying applications via the browser. <br>
<br>
<span style="font-weight: bold;">Conflicting UI</span><br>
&nbsp;<br>
Applications deployed via the browser have their own user interface,
which often conflicts with the user interface of the browser. This
application within an application model often results in user
interfaces that conflict with and contradict each other. This can lead
to user confusion in the best cases, and application failure in the
worst cases. The classic example of this is the browser&rsquo;s
Back button. The Back button makes sense when browsing documents, but
it does not always make sense in the context of an application.
Although there are a number of solutions that attempt to solve this
problem, they are applied to applications inconsistently; users may not
know whether a specific application supports the Back button, or
whether it will force their application to unload, causing it to lose
its state and data. <br>
<br>
<span style="font-weight: bold;">Distance from the Desktop</span>
<br>
<br>
Due in part to the web security model (which restricts access to the
users machine), applications that run in the browser often do not
support the type of user interactions with the operating system that
users expect from applications. For example, you cannot drag a file
into a browser-based application and have the application act on that
file. Nor can the web application interact with other applications on
the user&rsquo;s computer. <br>
<br>
<br>
RIAs have tried to improve on this by making richer, more desktop-like
interfaces possible in the browser, but they have not been able to
overcome the fundamental limitations and separation of the browser from
the desktop. <br>
<br>
<span style="font-weight: bold;">Primarily Online
Experience</span> <br>
<br>
Because web applications are delivered from a server and do not reside
on the users machine, web applications are a primarily online
experience. While there are attempts underway to make offline web-based
applications possible, they do not provide a consistent development
model, they fail to work across different browsers, and they often
require the user to interact with and manage their application and
browser in complex and unexpected ways. <br>
<br>
<span style="font-weight: bold;">Lowest Common Denominator</span>
<br>
<br>
Finally, as applications become richer and more complex and begin to
push the boundaries of JavaScript and DHTML, developers are
increasingly faced with differences in browser functionality and APIs.
While these issues can often be overcome with browser-specific code, it
leads to code that is more difficult to maintain and scale, and takes
time away from function-driven development. <br>
<br>
While JavaScript frameworks are a popular way to help address these
issues, they can offer only the functionality provided by the browser,
and often resort to the lowest common denominator of features between
browsers to ease the development model. While this issue
doesn&rsquo;t affect Flash-based RIAs, the end result for
JavaScript-or DHTML-based applications is a lowest common denominator
user experience and interaction model, as well as increased
development, testing, and deployment costs for the developer. <br>
<br>
The fact that web applications have flourished despite these drawbacks
is a testament to the attractiveness of having a platform with a good
development model that has the ability to deliver applications to
multiple operating systems. A platform that offered the reach and
development model of the browser, while providing the functionality and
richness of a desktop application, would provide the best of both
worlds. This is what Apollo aims to do. <br>
<br>
<br>
<span style="font-weight: bold;">Introducing the Apollo
Runtime</span> <br>
<br>
So, what is Apollo, and how can it make web application development and
deployment better? <br>
<br>
Apollo is the code name for a new cross-operating system runtime being
developed by Adobe that allows web developers to leverage their
existing web development skills (such as Flash, Flex, HTML, JavaScript,
and PDF) to build and deploy Rich Internet Applications and content to
the desktop. <br>
In essence, it provides a platform in between the desktop and the
browser, which combines the reach and ease of development of the web
model with the functionality and richness of the desktop model. <br>
<br>
It is important to step back for a second and point out what Apollo is
not. Apollo is not a general desktop runtime meant to compete with
lower-level application runtimes. This means that you probably
wouldn&rsquo;t want to build Photoshop on top of Apollo.
Apollo&rsquo;s primary use case is enabling Rich Internet and web
applications to be deployed to the desktop. This is a very important
but subtle distinction, as enabling RIAs on the desktop is the primary
use case driving the Apollo 1.0 feature set. <br>
<br>
Apollo is also not a browser. While it does allow developers to use web
technologies such as HTML, and Flash to build applications, it does not
provide any default UI to the user for browsing web pages. It is
possible to build a browser on top of Apollo, but at a basic level,
Apollo is a runtime that enables developers to build end user
applications, and is not an end user application itself.<br>
<br>
At its core, Apollo is built on top of web technologies, which allow
web developers to develop for and deploy to the desktop using the same
technologies and development models that they use today when deploying
applications on the Web. <br>
<br>
<span style="font-weight: bold;">Primary Apollo
Technologies </span><br>
<br>
There are three primary technologies included within Apollo, which fall
into two distinct categories: application technologies and document
technologies. <br>
<br>
<br style="font-weight: bold;">
<span style="font-weight: bold;">Primary Application
Technologies </span><br>
<br>
Application technologies are technologies that can be used as the basis
of an application within Apollo. Apollo contains two primary
application technologies, Flash and HTML, both of which can be used on
their own to build and deploy Apollo applications. <br>
<br>
<span style="font-weight: bold;">Flash</span> <br>
<br>
One of the core technologies Apollo is built on is the Flash Player.
Specifically, Apollo is built on top of Flash Player 9, which includes
the ECMAScript-based ActionScript 3 as well as the open source Tamarin
virtual machine (which will be used to interpret JavaScript in future
versions of Firefox). <br>
<br>
You can find more information on the open source Tamarin project at on
the Mozilla website site at http://www.mozilla.org/projects/tamarin/. <br>
<br>
Not only are all of the existing Flash Player APIs available within
Apollo, but some of those APIs have also been expanded and/or enhanced.
Some of the functionality that the Flash Player provides to Apollo
includes: <br>
<ul>
  <li>Just-in-time Interpreted ActionScript engine for speedy
application performance </li>
  <li>Full networking stack, including HTTP and RTMP, as well as
Binary and XML sockets </li>
  <li>Complete vector-based rendering engine and drawing APIs </li>
  <li>Extensive multimedia support including bitmaps, vectors,
audio, and video </li>
</ul>
Of course, the Flex 2 framework is built on top of ActionScript 3,
which means that you can also take advantage of all of the features and
functionality that Flex offers in order to build Apollo applications. <br>
<br>
<span style="font-weight: bold;">HTML</span> <br>
<br>
The second application technology within Apollo is HTML. This is a full
HTML ren&bull;dering engine, which includes support for: <br>
<ul>
  <li>HTML </li>
  <li>JavaScript </li>
  <li>CSS </li>
  <li>XHTML </li>
  <li>Document Object Model (DOM) </li>
</ul>
Yes, you read that right. You don&rsquo;t have to use Flash to
build Apollo applications. You can build a full-featured application
using just HTML and JavaScript. This usually surprises some developers
who expect Apollo to focus only on Flash. However, at its core, Apollo
is a runtime targeted at web developers using web
technologies&mdash; and what is more of a web technology than HTML
and JavaScript? <br>
<br>
The HTML engine used within Apollo is the <a
 href="http://www.webkit.org">open source WebKit engine</a>.
This is the engine behind a number of browsers, including KHTML on KDE
and Safari on Mac OS X. <br>
<br>
<span style="font-weight: bold;">Why WebKit? </span><br>
<br>
Adobe spent a considerable amount of time researching which HTML engine
to use within Apollo and used a number of criteria that ultimately led
them to settle on WebKit. <br>
<br>
<span style="font-weight: bold;">Open project</span>.
Adobe knew from the very beginning that it did not want to create and
maintain its own HTML rendering engine. Not only would this be an
immense amount of work, but it would also make it difficult for
developers, who would then have to become familiar with all of the
quirks of yet another HTML engine. <br>
<br>
WebKit provides Apollo with a full-featured HTML engine that is under
continuous development by a robust development community that includes
individual developers as well as large companies such as Nokia and
Apple. This allows Adobe to focus on bug fixes and features, and also
means that Adobe can actively contribute back to WebKit, while also
taking advantage of the contributions made by other members of the
WebKit project. <br>
<br>
<span style="font-weight: bold;">Proven technology that
web developers know</span>. As discussed earlier, one of the
biggest problems with complex web development is ensuring that content
works consis&bull;tently across browsers. While something may work
perfectly in Firefox on the Mac, it may completely fail in Internet
Explorer on Windows. Because of this, testing and debugging
browser-based content can be a nightmare for developers. <br>
<br>
Adobe wanted to ensure that developers were already familiar with the
HTML engine used within Apollo, and that they did not have to learn new
all of the quirks and bugs of a new engine. Since Safari (which is
built on top of WebKit) is the default browser for Mac OS X, developers
should be familiar with developing for it. <br>
<br>
<span style="font-weight: bold;">Minimum effect on Apollo
runtime size</span>. The target size for Apollo is between 5 and
9 MB. The WebKit code base was well-written and organized and had a
minimal impact on the final Apollo runtime size. Indeed, the current
runtime size with both Flash and HTML is just a little over 5 MB. <br>
<br>
<span style="font-weight: bold;">Proven ability to run on
mobile devices</span>. While the first release of Apollo runs
only on personal computers, the long-term vision is to extend the
Apollo runtime from the desktop to cell phones and other devices.
WebKit has a proven ability to run on such devices and has been ported
to cell phones by both Nokia and Apple. <br>
<br>
<span style="font-weight: bold;">Primary Document
Technology </span><br>
<br>
Document technologies within Apollo refer to technologies whose primary
purpose is for the rendering and interaction with electronic documents.
<br>
<br>
PDF and HTML are the primary document technologies available within
Apollo. <br>
<br>
<span style="font-weight: bold;">PDF</span> <br>
<br>
PDF functionality is not included in Alpha 1 of Apollo, so we cannot go
into too much detail of how it is implemented. However, in general
Apollo applications, both Flash- and HTML-based, will be able to
leverage and interact with PDF content. <br>
<br>
<span style="font-weight: bold;">HTML</span> <br>
<br>
HTML was originally designed as a document technology, and today it
provides rich and robust control over content and text layout and
styling. HTML can be used as a document technology within
Apollo&mdash;both within an existing HTML application as well as
within a Flash-based application. <br>
<br>
<span style="font-weight: bold;">What Does An Apollo
Application Contain?</span> <br>
<br>
Now that we know what technologies are available to applications
running on top of the Apollo runtime (see Figure 1-1), let&rsquo;s
look at how those technologies can be combined to build an Apollo
application. <br>
<br>
Applications can consist of the following combinations of technologies:
<br>
<ul>
  <li>Flash only (including Flex) </li>
  <li>Flash-based with HTML content </li>
  <li>HTML/JavaScript only </li>
  <li>HTML/JavaScript-based with Flash content </li>
</ul>
All combinations can also leverage PDF content <br>
<br>
<span style="font-weight: bold;">Technology Integration
and Script Bridging </span><br>
<br>
Because WebKit and the Flash Player are both included within the
runtime, they are integrated together on a very low level. For example,
when HTML is included within Flash content, it is actually rendered via
the Flash display pipeline, which, among other things, means that
anything that you can do to a bitmap within Flash (blur, rotate,
transform, etc.) can also be done to HTML. <br>
<br>
This low-level integration also applies to the script engines within
Apollo (that run ActionScript and JavaScript). Apollo provides script
bridging between the two languages and environments, which makes the
following possible: <br>
<ul>
  <li>JavaScript code to call ActionScript APIs </li>
  <li>ActionScript code to call JavaScript APIs </li>
  <li>ActionScript code to directly manipulate the HTML DOM </li>
  <li>Event registration both ways between JavaScript and
ActionScript </li>
</ul>
Note that the script bridging is &ldquo;pass by
reference.&rdquo; So when passing an object instance from
ActionScript to JavaScript (or vice versa), changes to that instance in
one environment will affect the instance in the other environment.
Among other things, this makes it possible to maintain a reference to
HTML nodes from within ActionScript and modify them, or to register and
listen for events. <br>
<br>
This low-level script bridging between the two environments makes it
very easy for developers to create applications that are a combination
of both HTML and Flash. <br>
<br>
The end result of all of this is that if you are a web developer, then
you already have all of the skills necessary to build an Apollo
application. <br>
<br>
<span style="font-weight: bold;">Apollo Functionality </span><br>
<br>
Apollo provides a rich set of programming APIs, as well as close
integration with the desktop that allows developers to build
applications that take advantage of the fact that they&rsquo;re
running on the user&rsquo;s desktop. <br>
<br>
<span style="font-weight: bold;">Apollo Programming APIs </span><br>
<br>
In addition to all of the functionality and APIs already offered by the
Flash Player and WebKit engine, Apollo provides additional
functionality and APIs. <br>
<br>
Apollo APIs will be exposed to both ActionScript and JavaScript. <br>
Some of the new functionality includes, but is not limited to: <br>
<ul>
  <li>Complete file I/O API </li>
  <li>Complete native windowing API </li>
  <li>Complete native menuing API </li>
  <li>Online/Offline APIs to detect when network connectivity has
changed </li>
  <li>Data Caching and Syncing APIs to make it easier to develop
applications that work on- and offline. </li>
  <li>Complete control over application chrome </li>
  <li>Local storage/settings APIs </li>
  <li>System notification APIs (that tie into OS-specific
notification mechanisms) </li>
  <li>Application update APIs </li>
</ul>
Note that functionality may be implemented directly within the Apollo
runtime or on the framework layer (in Flex and JavaScript), or by using
a combination of both. <br>
<br>
<span style="font-weight: bold;">Apollo Desktop Integration</span>
<br>
<br>
As discussed earlier, applications deployed via the browser cannot
always support the same user interactions as desktop applications. This
leads to applications that can be cumbersome for the user to interact
with, as they do not allow the type of application interactions with
which users are familiar. <br>
<br>
Because an Apollo application is a desktop application, it is able to
provide the type of application interactions and experience that users
expect from an application. This functionality includes, but is not
limited to: <br>
<br>
<ul>
  <li>Appropriate install/uninstall rituals </li>
  <li>Desktop install touchpoints (i.e., shortcuts, etc.) </li>
  <li>Rich drag-and-drop support: </li>
  <ul>
    <li>Between operating system and Apollo applications </li>
    <li>Between Apollo applications </li>
  </ul>
  <li>Between native applications and Apollo applications </li>
  <li>Rich clipboard support </li>
  <li>System notifications </li>
  <li>Native Icons </li>
  <li>Ability for applications to run in the background </li>
</ul>
Once installed, an Apollo application is just another native
application, which means that the operating system and users can
interact with it as it does with any other application. For example,
things such as OS-level application pre-fetching and switching work the
same with Apollo applications as they do with native applications. <br>
<br>
The goal is that the end user doesn&rsquo;t need to know they are
running an application that leverages Apollo. They should be able to
interact with an Apollo application in the same way that they interact
with any other application running on his desktop. <br>
<br>
<br>
<span style="font-weight: bold;">Apollo Development
Toolset </span><br>
<br>
One of the reasons web applications have been successful is that they
allow developers to easily deploy applications that users can run
regardless of which OS they are on. Whether Mac, Windows, Linux,
Solaris, or cell phones, web applications provide reach.<br>
&nbsp;<br>
However, success is based not only on cross-platform deployment, but
also on the cross-platform nature of the development environment. This
ensures that any developer can develop for&mdash;and
leverage&mdash;the technology. Neither the runtime nor the
development tools are tied to a specific OS. <br>
<br>
The same is true of Apollo. Not only does Apollo provide the
cross-platform reach of web applications, but, just as importantly,
Apollo applications can be developed and packaged on virtually any
operating system. <br>
<br>
In fact, Apollo itself does not have a compiler or specialized IDE.
Apollo applications just consist of web content, such as Flash and
HTML. Any tool that can edit an HTML or JavaScript file can also be
used to create an Apollo application. <br>
<br>
A beta version of Flex Builder with Apollo support is included with the
Apollo Alpha. Because Apollo applications are built with existing web
technologies such as HTML and Flash, you can use the same tools that
you use to create browser-based content to create Apollo applications.
The Apollo SDK provides a number of free command-line tools that make
it possible to test, debug, and package Apollo applications with
virtually any web development and design tool. <br>
<br>
The included command line tools are:<br>
<br>
<span style="font-weight: bold;">ADL</span> - Allows
Apollo applications to be run without having to first install them <br>
<span style="font-weight: bold;">ADT</span> -
Packages Apollo applications into distributable installation packages <br>
<br>
While Adobe will be adding support to its own web development and
design tools for authoring Apollo content, they are not required. Using
the Apollo command-line tools, you can create an Apollo application
with any web development tool. You can use the same web development and
design tools that you are already using today. <br>
<br>
<br>
<span style="font-weight: bold;">Is Apollo the End of Web
Applications in the Browser? </span><br>
<br>
So, by this point, you may be saying to yourself, &ldquo;Gee,
Apollo sure sounds great! Why would anyone ever want to deploy an
application to the browser again? Is Apollo the end of web applications
within the browser?&rdquo; <br>
<br>
No. <br>
<br>
Let me repeat that again: no. <br>
<br>
Apollo solves most of the problems with deploying web applications via
the browser. However, there are still advantages to deploying
applications via the browser. The fact that there are so many web
applications despite the disadvantages discussed earlier is a testament
to the advantages of running within the browser. When those advantages
outweigh the disadvantages, developers will still deploy their
applications via the web browser. <br>
<br>
But is it not necessarily an either/or question. Because Apollo
applications are built using web technologies, the application that you
deploy via the web browser can be quickly turned into an Apollo
application. You can have a web-based version that provides the
browser-based functionality, and then also have an Apollo-based version
that takes advantage of running on the desktop. Both versions could
leverage the same technologies, languages, and code base. <br>
<br>
Apollo applications complement web applications in the browser. They do
not replace them. &nbsp;<br>]]>
</content>
</entry>

<entry>
<title>Fresh Apollo HTML based Aggregator uses Ext JS Library</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/03/fresh_apollo_ht.html" />
<modified>2009-07-19T08:35:36Z</modified>
<issued>2007-03-22T23:05:33Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24142</id>
<created>2007-03-22T23:05:33Z</created>
<summary type="text/plain">One of the sample apps that we have made available from the Apollo labs site, is an RSS aggregator built entirely in HTML / JavaScript and CSS named Fresh. This is a pretty cool application, and really demonstrates how you...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>One of the sample apps that we have made available from the <a href="http://www.adobe.com/go/apollo">Apollo labs site</a>, is an RSS aggregator built entirely in HTML / JavaScript and CSS named <a href="http://labs.adobe.com/wiki/index.php/Apollo:Applications:Samples">Fresh</a>. This is a pretty cool application, and really demonstrates how you can use HTML in Apollo to build desktop applications.</p>

<p>We have been showing this a lot over the past couple of days (at <a href="http://www.adobe.com/go/apollocamp">Apollo Camp</a> and <a href="http://www.webdu.com.au">webDU</a>), and have been incorrectly saying that the Yahoo UI library was used to create the app. This is incorrect, and was a mistake on the speakers (mostly my) part. It actually is built using the <a href="http://extjs.com/">Ext JS JavaScript Library and Components toolkit</a>.</p>]]>
<![CDATA[<p>What is Ext JS? From their <a href="http://extjs.com/">website</a>:</p>

<blockquote>Ext began life as an extension to the Yahoo! User Interface Javascript library. However, it quickly exploded into a full-fledged framework of its own, and was soon launched as a separate, independent library. Ext is one of the most powerful, most expressive and easiest-to-use Javascript frameworks available today.</blockquote>

<p>Basically, if you want to build Apollo applications using HTML / JavaScript, then this is the library you should start with. Not only does it provide lower level JavaScript functionality, it also provides a complete UI component toolkit, and effect library.</p>

<p>You can find more information on Ext JS <a href="http://extjs.com/">here</a>.</p>

<p>If you end up making an Apollo application that uses it, make sure to post in the comments.</p>]]>
</content>
</entry>

<entry>
<title>Teknision on Apollo and Branded Applications</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/03/teknision_on_ap.html" />
<modified>2009-07-19T08:35:36Z</modified>
<issued>2007-03-22T03:24:32Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24141</id>
<created>2007-03-22T03:24:32Z</created>
<summary type="text/plain">The guys over at Teknision (they built the Finetune Apollo application) have written up some of their thoughts on Apollo, and what they feel its real impact and value will be. Online applications that are pin point targeted to provide...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>The guys over at Teknision (they built the <a href="http://www.finetune.com/desktop/">Finetune Apollo application</a>) have <a href="http://blog.teknision.com/?p=12">written up some of their thoughts on Apollo</a>, and what they feel its real impact and value will be.</p>

<blockquote>Online applications that are pin point targeted to provide a specific service generate intensely loyal fans. Apollo will give us the ability to extend these applications deeper into the user’s lives by making them part of their operating environment.</blockquote>

<p>You can read the entire article <a href="http://blog.teknision.com/?p=12">here</a>.</p>]]>

</content>
</entry>

<entry>
<title>yourminis.com Alpha for Apollo</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/03/yourminiscom_al.html" />
<modified>2009-07-19T08:35:36Z</modified>
<issued>2007-03-21T04:36:05Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24140</id>
<created>2007-03-21T04:36:05Z</created>
<summary type="text/plain">Check it out. yourminis.com just launched a alpha version of yourminis for the desktop. This runs on top of Apollo, and along with Finetune, is a must have Apollo application. Really good experience. I think the coolest thing about yourminis.com...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Check it out. <a href="http://blog.yourminis.com/2007/03/desktop_widgets.html">yourminis.com</a> just launched a alpha version of yourminis for the desktop. This runs on top of <a href="http://www.adobe.com/go/apollo">Apollo</a>, and along with <a href="http://www.finetune.com/desktop/">Finetune</a>, is a must have Apollo application.</p>

<p>Really good experience. I think the coolest thing about yourminis.com is that you can have the widget on your yourminis page, embedded in your own website via HTML, and now on your desktop, via Apollo.</p>

<p>I also just <a href="http://video.onflex.org/2007/03/20/apollo-camp-yourminiscom-hart-woolery/">posted the video for the yourminis session at Apollo Camp</a>.</p>

<p>You can find more information <a href="http://blog.yourminis.com/2007/03/desktop_widgets.html">here</a>.</p>]]>

</content>
</entry>

<entry>
<title>Kevin Lynch on Apollo Alpha</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/03/kevin_lynch_on_2.html" />
<modified>2009-07-19T08:35:36Z</modified>
<issued>2007-03-19T22:58:22Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24139</id>
<created>2007-03-19T22:58:22Z</created>
<summary type="text/plain">Kevin Lynch (Chief Software Architect at Adobe) has posted some of his thoughts on the Apollo Alpha over on his weblog, which which he gives some insight into Adobe&apos;s thinking around Apollo. You can read the entire post here....</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[<p>Kevin Lynch (Chief Software Architect at Adobe) has <a href="http://www.klynch.com/archives/000086.html">posted some of his thoughts on the Apollo Alpha</a> over on his weblog, which which he gives some insight into Adobe's thinking around Apollo.</p>

<p>You can read the entire post <a href="http://www.klynch.com/archives/000086.html">here</a>.</p>]]>

</content>
</entry>

<entry>
<title>Simple Apollo Offline Caching Example</title>
<link rel="alternate" type="text/html" href="http://blogs.adobe.com/mesh/archives/2007/03/simple_apollo_o.html" />
<modified>2009-07-19T08:35:36Z</modified>
<issued>2007-03-19T19:52:18Z</issued>
<id>tag:blogs.adobe.com,2007:/mesh//334.24138</id>
<created>2007-03-19T19:52:18Z</created>
<summary type="text/plain">I have put together a very simple example of how to download and cache items to the files system. This can be useful if your application needs to work offline, or if you want to optimize performance and don&apos;t want...</summary>
<author>
<name>mesh</name>
<url>http://weblogs.macromedia.com/mesh/</url>
<email>mchamber@adobe.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://blogs.adobe.com/mesh/">
<![CDATA[I have put together a very simple example of how to download and cache items to the files system. This can be useful if your application needs to work offline, or if you want to optimize performance and don't want to have to keep downloading the same assets over and over.

This example uses some of the caching classes from my Ascension mp3 player, and required the <a href="">corelib library</a>.

Here is the code for the app:]]>
<![CDATA[[code]<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
	creationComplete="onCreationComplete()">
	<mx:Script>
		<![CDATA[
			import com.adobe.apps.ascension.events.URLCacheEvent;
			import com.adobe.apps.ascension.utils.URLCache;
			
			private var cache:URLCache;
			private var CACHE_NAME:String = "mycache";
			
			private function onCreationComplete():void
			{
				imagePathField.text = "http://apollocamp.eventbrite.com/img/logos/47616422.png";
				
				cache = new URLCache(CACHE_NAME);
				
				cache.addEventListener(URLCacheEvent.ITEM_READY, onItemReady);
				cache.addEventListener(URLCacheEvent.ITEM_CACHED, onItemCached);
			}
			
			private function onLoadImageClick():void
			{
				if(imagePathField.text == "")
				{
					return;
				}
				
			
				cache.cacheURL(imagePathField.text, imagePathField.text);
			}
			
			private function onItemReady(e:URLCacheEvent):void
			{
				writeToOutput("Item Ready : " + e.file.url);
				image.source = e.file.url;
			}
			
			private function onItemCached(e:URLCacheEvent):void
			{
				writeToOutput("File Cached : " + e.file.url);
			}
			
			private function writeToOutput(s:String):void
			{
				output.text += s + "\n";
			}
		]]&gt;
	</mx:Script>
	<mx:Button y="10" label="Load Image" right="10" click="onLoadImageClick()"/>
	<mx:Canvas right="10" left="10" top="40" bottom="114" borderColor="0xffffff" borderStyle="solid">
		<mx:Image width="100%" height="100%" id="image" scaleContent="true"/>
	</mx:Canvas>
	<mx:TextInput right="112" left="10" top="10" id="imagePathField"/>
	
	<mx:TextArea height="96" bottom="10" left="10" right="10" id="output"/>
</mx:Application>
[/code]

Basically, the first time you load an image, you get two events. One that the item has been cached, and one that the item is ready to use. If you try to load the same image again, then you only get the item ready event, since the item has already been downloaded and cached.

Here is what the app looks like:

<img src="/mesh/files/CacheExample.png" height="500" with="397" border="0" alt="" />

Here is the main cache class:

[code]package com.adobe.apps.ascension.utils
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.events.Event;
	import flash.net.FileReference;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.filesystem.File;
	import com.adobe.crypto.MD5;
	import com.adobe.net.DynamicURLLoader;
	import flash.events.IOErrorEvent;
	import flash.filesystem.FileStream;
	import flash.filesystem.FileMode;
	import com.adobe.apps.ascension.events.URLCacheEvent;
	import flash.net.URLLoaderDataFormat;
	import flash.utils.ByteArray;


	//todo: add event metadata

	public class URLCache extends EventDispatcher
	{
		private var _cacheName:String;
		//maybe rename to make it clearer it loads data
		public function URLCache(cacheName:String)
		{
			_cacheName = cacheName;
		}
		
		public function get cacheName():String
		{
			return _cacheName;
		}
		
		private function getStorageDir():File
		{
			return File.appStorageDirectory.resolve(_cacheName);
		}
		
		public function itemExists(key:String):Boolean
		{
			return getItemFile(key).exists;
		}
		
		public function clearCache():void
		{
			var cacheDir:File = getStorageDir();
			try
			{
				cacheDir.deleteDirectory(true);
			}
			catch (e:IOErrorEvent)
			{
				// we tried!
			}
		}
		
		public function getItemFile(key:String):File
		{
			var dir:File = getStorageDir();
			var fName:String = generateKeyHash(key);
			var file:File = dir.resolve(fName);
			
			return file;
		}
		
		public function cacheURL(url:String, key:String):void
		{
			
			var file:File = getItemFile(key);
			
			//todo: do we need to check if the dir exists?
			
			if(file.exists)
			{
				var e:URLCacheEvent = new URLCacheEvent(URLCacheEvent.ITEM_READY);
					e.key = key;
					e.file = file;
					
				dispatchEvent(e);	
				return;
			}
			
			
			var loader:DynamicURLLoader = new DynamicURLLoader();
				loader.file = file;
				loader.key = key;
				
				loader.addEventListener(Event.COMPLETE, onDataLoad);
				loader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
				
				loader.dataFormat = URLLoaderDataFormat.BINARY;
				
				loader.load(new URLRequest(url));
			
		}
		
		private function onLoadError(event:IOErrorEvent):void
		{
			trace("onLoadError : could not cache item");
		}
		
		private function onDataLoad(event:Event):void
		{
			var loader:DynamicURLLoader = DynamicURLLoader(event.target);
			
			var f:File = File(loader.file);
			var key:String = String(loader.key);
			
			var fileStream:FileStream = new FileStream();
				fileStream.open(f, FileMode.WRITE);
				fileStream.writeBytes(loader.data as ByteArray);
				fileStream.close();
				
				var g:URLCacheEvent = new URLCacheEvent(URLCacheEvent.ITEM_CACHED);
					g.key = key;
					g.file = f;
					
				dispatchEvent(g);	
				
				var e:URLCacheEvent = new URLCacheEvent(URLCacheEvent.ITEM_READY);
					e.key = key;
					e.file = f;
					
				dispatchEvent(e);	
		}
		
		
		private function generateKeyHash(key:String):String
		{
			return MD5.hash(key);
		}
	}
}[/code]

This works with any data / file types.

It still needs to be cleaned up some, but I wanted to get an example online asap.

You can download the entire example code <a href="/mesh/files/CacheExample.zip">here</a>.]]>
</content>
</entry>

</feed>