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