It's official. Apollo Alpha 1 has launched!
Before you jump too far into Apollo coding, have a scan through the online Apollo docs and avail yourself of the freely downloadable PDF of the Apollo for Adobe Flex Developers Pocket Guide.
One of the coolest Apollo features is the new HTML rendering control and its Flex framework sibling, the HTML component. This post would feel naked without some kind of code snippet, so here's a super-simple but functional web browser in just three lines of code (or a few more if you count line breaks and closing tags :) ).
<?xml version="1.0" encoding="utf-8"?>
<mx:ApolloApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:TextInput id="urlTxt"
width="100%"
enter="html.location=urlTxt.text;"
text="http://www.adobe.com/go/apollo" />
<mx:HTML id="html"
width="100%" height="100%"
location="http://www.adobe.com/go/apollo" />
</mx:ApolloApplication>
That example creates a single text field for entering a URL and an HTML component for loading the HTML and JavaScript content. When you press the Enter key in the text field, it sets the location property of the HTML control to the value of the text field, and then web page loads and displays.
You'll notice that most of the buttons and controls you expect to see in a real web browser -- Back and Next buttons, and so on -- don't come pre-packaged with the HTML component. We'll deal with that issue in the next post.
Comments