Login | Register
Leveraging HTML/JavaScript and Ajax in Apollo Applications

Leveraging HTML/JavaScript and Ajax in Apollo Applications

My second seminar on Apollo was conducted by Chris Brichford and he discussed the html engine in Apollo in detail.

Even though this came later in the presentation, it's important to note early on that the Apollo html engine is based on webkit, which is the same engine Safari is based on. And later on he mentioned that not only is Adobe commited to keeping Apollo up to date with webkit, but they also intend to contribute back to the webkit project to help continue making a better browser. And he said one of the reasons they chose webkit is because it has already been ported to a Nokia phone. The only two plugins supported for html in Apollo is the Flash plugin and PDF with no plans yet to add more.

His presentation continued with explaining the reasoning behind including html in Apollo was that there are already so many pre-existing assets such as JavaScript libraries that can easily be included right into Apollo applications. He showed a very cool photo gallery application that was written completely in html, and it had transitions from image to image.

Chris then mentioned that they expect two basic use cases for using html in Apollo:

  • Embeded Browser - Integrating live html pages
  • HTML UI - using html as the interface itself; richer text fields than Flash text fields.


The cool thing about the object that embeds the html in Apollo (htmlControl) is that it is part of the display list, meaning you can do practically anything to it that you can do to other visual assets including controling its properties such as position, rotation and alpha.

He did mention that right now they are using the webkits rendering for fonts, but are considering using Flash fonts instead to give it a more consistent look.

Then he moved on to talk about one of the key pieces of using html in Apollo, script bridging. ActionScript will be to commnicate to JavaScript and vice versa. And the calls to functions across the scripting bridge will be synchronous. The integration between the two languages will be better integrated than External Interface.

He went over some information about the class itself, HTMLControl, including that it is part of the flash.html package, that it's a subclass of sprite and the default behavior acts like an iFrame. He even showed some sample code:

var html:HTMLControl = new flash.html.HTMLControl();
html.width = 100;
html.height = 100;
addChild(html);
html.loadFromURLRequest("wherever.html");

He ended with the fact that you can embed Flash into html, into Flash into html etc.. not sure why you would do that, but it's possible.

About Jens C Brynildsen

Jens has been working with Flash since version 3 came out. Since then, he's been an active member of the Flash community. He's created more than a hundred Flash games (thus the name of his blog) but he also creates web/standalone applications, does workshops and other consulting. He loves playing with new technology and he is convinced that the moment you stop learning you die (creatively speaking). Jens is also the Editor of this website.

Get new stories first

Click to follow us on Twitter!

 

Comments

No comments for this page.

Submit a comment

Only registered members can comment. Click here to login or here to register