Air Combat (i) displaying HTML in air

Source: Internet
Author: User

The development of a cross-platform PC application technology is very many, more commonly used are: React Native, Nw.js, Electron, QT, Adobe Air and other technologies. React Native, Nw.js, electron and other technologies have been quite hot. QT also has many success stories. There are pros and cons between them, and there's no detailed comparison here. However, the company I recently joined chose Adobe Air to develop applications across PCs. Personally, the technology for Adobe is not very cold. Also actively study react and other technologies, waiting for the ripe replacement. However, work needs to be done in-depth study of Adobe Air. and the actual actual combat information on the Internet is too little (perhaps I did not find). It's a bit far, so let's start with the formal.

So how do we load and render HTML code in air? Just tell the Flash.html.HTMLLoader object HTML where it can be. Here's how to get started

    • Create a flex project using Flash Builder

    • The project name is Htmldemo and the desktop app is selected

    • Once created, the project path is shown in the

    • Displaying the server-side HTML in air
1 <?XML version= "1.0" encoding= "Utf-8"?>2 <s:windowedapplicationXmlns:fx= "http://ns.adobe.com/mxml/2009" 3 xmlns:s= "Library://ns.adobe.com/flex/spark" 4 xmlns:mx= "Library://ns.adobe.com/flex/mx">8     <mx:htmlwidth= "100%"Height= "100%"9  Location= "Http://www.baidu.com"/>Ten </s:windowedapplication>
    • or edit the HTML source directly in air
1 <?XML version= "1.0" encoding= "Utf-8"?>2 <s:windowedapplicationXmlns:fx= "http://ns.adobe.com/mxml/2009" 3 xmlns:s= "Library://ns.adobe.com/flex/spark" 4 xmlns:mx= "Library://ns.adobe.com/flex/mx"5 Creationcomplete= "Creationcompletehandler ();">6     <Fx:script>7         <! [Cdata[8 Private Function Creationcompletehandler (): void {9 html.htmlLoader.loadString ("Ten             } One         ]]> A     </Fx:script> -     <mx:htmlID= "html"width= "100%"Height= "100%" /> - </s:windowedapplication>

    • As shown, the server-side HTML is displayed in air, or the HTML source

  

Adobe development is really simple. With these steps, we can transform an existing Web project into a PC-side application. This desktop app looks good. But can we use air to cache page content or click a page button in a Web project to pop up the air window? These will be answered in the next section.

Air Combat (i) displaying HTML in air

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.