After a 20 minute hack with Apollo I’ve written an extremely simple application which takes some HTML input and renders it using an HTML component. There’s the option to save the file to a plain text .HTML file as well.
Here’s the code:
<?xml version="1.0" encoding="utf-8"?>
<mx:ApolloApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
<![CDATA[
import flash.filesystem.*;
public function saveHTMLFile():void
{
var file:File = File.desktopDirectory;
file = file.resolve("myHTML.html");
var stream:FileStream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeUTFBytes(HTMLText.text);
stream.close();
}
]]>
</mx:Script>
<mx:VBox height="100%" width="100%">
<mx:TextArea id="HTMLText"
width="100%"
height="100%"/>
<mx:HTML htmlText="{HTMLText.text}"
width="100%"
height="100%"/>
<mx:ControlBar>
<mx:Button label="Save HTML Document"
click="saveHTMLFile()"
enabled="{HTMLText.text != ''}"/>
</mx:ControlBar>
</mx:VBox>
</mx:ApolloApplication>
I can’t wait to have a proper experiment with everything. Download the Apollo runtime from the Adobe labs site and check out the sample applications.
My list of technologies to experiment with grows ever larger. So much to learn so little time!
Update: Freaky, I didn’t realise Ray Camden posted a similar application before me. It appears there’s some others out there that do pretty much the same thing, except for the save function. Looks like several people all had the same idea for their first Apollo application.