Adobe AIR HTML 开发人员指南

Size: px
Start display at page:

Download "Adobe AIR HTML 开发人员指南"

Transcription

1 ADOBE AIR HTML

2

3 iii 1 : HTML HTML AIR WebKit : AIR HTML JavaScript HTML AIR JavaScript JavaScript AIR API AIR URL HTML SWF HTML ActionScript Date RegExp : AIR HTML HTMLLoader AIR - HTML DOM Adobe AIR JavaScript : AIR HTML HTMLLoader HTML HTML HTML HTML : Vector AIR API : AIR AIR Adobe AIR HTML

4 ADOBE AIR HTML iv : AIR AIR : AIR AIR : (AIR) HTML (AIR) (AIR) (AIR) MenuBuilder : AIR Window : AIR API : AIR HTML HTML HTML HTML HTML

5 ADOBE AIR HTML v 13 : AIR HTML : AIR SQL SQL SQL SQL SQL : : ByteArray ByteArray.zip : AIR PDF PDF PDF PDF AIR PDF :

6 ADOBE AIR HTML vi 19 : System Capabilities : AIR AIR AIR : AIR AIR : TCP UDP (AIR) IPv : HTTP Web URL URL : Flash Player AIR LocalConnection AIR : JavaScript ActionScript ActionScript JavaScript ActionScript ActionScript ActionScript ActionScript : SQL SQL

7 ADOBE AIR HTML vii 27 : SQL ID

8 1 1 : HTML Adobe AIR 1.0 AIR Safari Web WebKit ( HTML JavaScript AIR API Adobe AIR Adobe Flash Player API Adobe AIR WebKit AIR WebKit AIR HTML WebKit AIR WebKit AIR WebKit AIR WebKit Safari Web AIR Safari HTMLLoader WebKit air.trace( window.htmlloader.useragent ); AIR WebKit AIR AIR WebKit 13 AIR WebKit HTML AIR API HTML JavaScript AIR HTML HTML CSS DOM JavaScript WebKit AIR AIR Web AIR AIR API AIR http: https: AIR API Web Alpha AIR HTML SWF PDF 42 HTML SWF PDF 76 Webkit DOM Safari HTML Safari CSS

9 ADOBE AIR HTML HTML 2 HTML Adobe AIR 1.0 Adobe AIR HTML JavaScript JavaScript JavaScript AIR HTMLLoader HTML HTMLLoader HTML NativeWindow NativeWindow JavaScript AIR Adobe AIR 1.0 JavaScript AIR AIR HTMLLoader AIR NativeWindow HTMLLoader window JavaScript window document htmlloader body head nativewindow h1 div table p JavaScript Document Window JavaScript runtime nativewindow htmlloader AIR ActionScript HTMLLoader window JavaScript JavaScript Window ActionScript JavaScript AIR JavaScript runtime AIR API AIR AIR API runtime File var file = new window.runtime.filesystem.file();

10 ADOBE AIR HTML HTML 3 AIR SDK JavaScript AIRAliases.js AIR air.class window.runtime.package.class new air.file() File NativeWindow window.nativewindow HTML NativeWindow HTMLLoader window.htmlloader HTML HTMLLoader htmlloader nativewindow runtime frame iframe frame parent.runtime runtime Adobe AIR 1.0 AIR HTML JavaScript AIR API load JavaScript frame iframe frame AIR sandboxroot documentroot sandboxroot mash-up AIR API frame iframe parentsandboxbridge childsandboxbridge 63 Adobe AIR HTML 10 HTML frame iframe Adobe AIR 1.0 AIR Adobe Acrobat Acrobat Adobe Reader 8.1 PDF HTMLLoader PDF SWF HTML AIR AIR WebKit 63 Adobe AIR HTML 4 HTML 10 HTML frame iframe 8 JavaScript Window 5 XMLHttpRequest 231 AIR PDF

11 ADOBE AIR HTML HTML 4 AIR WebKit Adobe AIR 1.0 Adobe AIR WebKit Safari Web AIR WebKit HTML CSS JavaScript W3C AIR WebKit HTML CSS JavaScript developer.apple.com W3C Mozilla HTML CSS DOM WebKit Mozilla AIR JavaScript Flash Player 9 Adobe AIR 1.0 AIR JavaScript AIR JavaScript Web AIR 20 JavaScript HTML Adobe AIR 1.0 AIR Web Adobe Flash Player AIR AIR HTML JavaScript AIR API JavaScript app: URL Internet frame iframe HTML AIR JavaScript eval() Adobe AIR 1.0 eval() JSON 65 eval()

12 ADOBE AIR HTML HTML 5 Adobe AIR 1.0 load Adobe AIR 1.0 HTML script JavaScript XMLHttpRequest Adobe AIR 1.0 AIR XMLHttpRequest (XHR) xmlhttp = new XMLHttpRequest(); xmlhttp.open("get", " true); xmlhttp.onreadystatechange = function() if (xmlhttp.readystate == 4) //do something with data... xmlhttp.send(null); AIR JSON XHR XHR XHR XHR AIR XMLHttpRequest frame frame iframe AIR allowcrossdomainxhr true <iframe id="mashup" src=" allowcrossdomainxhr="true" </iframe> AIR URLStream frame iframe XMLHttpRequest URL XHR iframe example.com <iframe id="mashup" src=" documentroot="app:/sandbox/" sandboxroot=" allowcrossdomainxhr="true" </iframe> sandboxroot URL XMLHttpRequest

13 ADOBE AIR HTML HTML 6 sandboxroot URL iframe <iframe id="mashup" src=" documentroot="app:/sandbox/" sandboxroot=" allowcrossdomainxhr="true" </iframe> air 10 HTML frame iframe 63 Adobe AIR HTML Cookie Adobe AIR 1.0 AIR http: https: cookie document.cookie EncryptedLocalStore SharedObject FileStream Clipboard Adobe AIR 1.0 WebKit Clipboard API copy cut paste clipboarddata clipboarddata cleardata(mimetype) getdata(mimetype) setdata(mimetype, data) mimetype MIME paste mimetype MIME mimetype MIME JavaScript AIR Clipboard var clipping = air.clipboard.generalclipboard.getdata("text/plain", air.clipboardtransfermode.original_only); MIME MIME HTML URL "text/plain" "text/html" "text/uri-list" "image/x-vnd.adobe.air.bitmap" "application/x-vnd.adobe.air.file-list"

14 ADOBE AIR HTML HTML Using the Pasteboard from JavaScript Apple Adobe AIR 1.0 HTML DOM dragstart drag dragend dragenter dragover dragleave drop datatransfer datatransfer clipboarddata drop function ondrop(dragevent) return dragevent.datatransfer.getdata("text/plain", air.clipboardtransfermode.original_only); datatransfer cleardata(mimetype) getdata(mimetype) setdata(mimetype, data) effectsallowed dropeffect mimetype MIME drop mimetype MIME mimetype MIME datatransfer MIME dragstart effectsallowed dragenter dropeffect dropeffect effectsallowed AIR 153 AIR Using the Drag-and-Drop from JavaScript Apple innerhtml outerhtml Adobe AIR 1.0 AIR innerhtml outerhtml load load innerhtml outerhtml innerhtml outerhtml innerhtml outerhtml <script> 63 Adobe AIR HTML

15 ADOBE AIR HTML HTML 8 Document.write() Document.writeln() Adobe AIR 1.0 load write() writeln() document.write() writeln() Web Document.designMode Adobe AIR 1.0 document.designmode on designmode on body contenteditable true HTML contenteditable 12 HTML contenteditable unload body frameset Adobe AIR 1.0 frameset body unload NativeApplication exiting NativeWindow closing JavaScript ("Goodbye.") var app = air.nativeapplication.nativeapplication; app.addeventlistener(air.event.exiting, closehandler); function closehandler(event) alert("goodbye."); frame iframe unload Adobe AIR JavaScript Window Adobe AIR 1.0 Window JavaScript AIR JavaScript Window AIR Window.runtime runtime AIR Flash Player API Flex AIR var preferencesfile = new window.runtime.flash.filesystem.file(); AIR SDK AIRAliases.js AIRAliases.js File var preferencesfile = new air.file(); window.runtime frame iframe 24 AIRAliases.js

16 ADOBE AIR HTML HTML 9 Window.nativeWindow nativewindow Window window.nativewindow.close(); NativeWindow JavaScript Window window.nativewindow frame iframe Window.htmlLoader htmlloader HTML AIR HTMLLoader HTML htmlloader.paintsdefaultbackground window.htmlloader.paintsdefaultbackground = false; HTMLLoader window HTML JavaScript Window HTMLLoader JavaScript window.htmlloader frame iframe Window.parentSandboxBridge Window.childSandboxBridge parentsandboxbridge childsandboxbridge 30 Window.setTimeout() Window.setInterval() AIR settimeout() setinterval() settimeout() setinterval() 22 settimeout() setinterval() Window.open() open() 68 JavaScript window.open() air.nativeapplication Adobe AIR 1.0 NativeApplication NativeApplication NativeApplication.nativeApplication JavaScript var app = window.runtime.flash.desktop.nativeapplication.nativeapplication; AIRAliases.js var app = air.nativeapplication.nativeapplication; NativeApplication NativeApplication 261 AIR JavaScript URL Adobe AIR 1.0 JavaScript URL href="javascript:alert('test')"

17 ADOBE AIR HTML HTML 10 AIR HTML Adobe AIR 1.0 AIR WebKit HTML 10 HTML frame iframe 11 HTML HTML frame iframe Adobe AIR 1.0 AIR frame iframe sandboxroot sandboxroot src sandboxroot URL XMLHttpRequest documentroot documentroot sandboxroot URL src URL sandboxroot URL documentroot frame <iframe src=" documentroot="app:/sandbox/" sandboxroot=" child.html sandbox child.html URL sandbox AIR app:/sandbox/ allowcrossdomainxhr allowcrossdomainxhr="allowcrossdomainxhr" XMLHttpRequest XHR XHR allowcrossdomainxhr frame iframe XHR 0 f n allowcrossdomainxhr deny XHR ondominitialize dominitialize AIR dominitialize dominitialize AIR iframe child.html <iframe src=" documentroot="app:/sandbox/" sandboxroot=" XMLHttpRequest child.html

18 ADOBE AIR HTML HTML 11 <iframe src=" documentroot="app:/sandbox/" sandboxroot=" XMLHttpRequest child.html <iframe src=" documentroot="app:/sandbox/" sandboxroot=" allowcrossdomainxhr="allowcrossdomainxhr"/> child.html <iframe src="file:///templates/child.html" documentroot="app:/sandbox/" sandboxroot="app-storage:/templates/"/> dominitialize child.html <html> <head> <script> var bridgeinterface = ; bridgeinterface.testproperty = "Bridge engaged"; function engagebridge() document.getelementbyid("sandbox").parentsandboxbridge = bridgeinterface; </script> </head> <body> <iframe id="sandbox" src=" documentroot="app:/" sandboxroot=" ondominitialize="engagebridge()"/> </body> </html> child.html <html> <head> <script> document.write(window.parentsandboxbridge.testproperty); </script> </head> <body></body> </html> Adobe AIR HTML HTML Adobe AIR 1.0 AIR WebKit DOM DOM

19 ADOBE AIR HTML HTML 12 oncontextmenu oncopy oncut ondominitialize ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop onerror oninput onpaste onscroll onselectstart Command frame iframe DOM DOM HTML contenteditable Adobe AIR 1.0 HTML contenteditable HTML p <html> <head/> <body contenteditable="true"> <h1>de Finibus Bonorum et Malorum</h1> <p contenteditable="false">sed ut perspiciatis unde omnis iste natus error.</p> <p>at vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis.</p> </body> </html> document.designmode on contenteditable designmode off contenteditable true 8 Document.designMode Data: URL Adobe AIR 2 AIR data: URL img

20 ADOBE AIR HTML HTML 13 input type= image CSS URL Base64 CSS HTML data: URL <html> <head> <style> body backgroundimage:url('data:image/png;base64,ivborw0kggoaaaansuheugaaagqaaabkcamaaabhpgvmaaaagxrfwhrtb2z0d2fyzqbbzg9i ZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF%2F6cA%2F%2F%2F%2Fgxp3lwAAAAJ0Uk5T%2FwDltzBKAAABF0lEQVR42uzZQQ7CMAxE0e%2F 7X5oNCyRocWzPiJbMBZ6qpIljE%2BnwklgKG7kwUjc2IkIaxkY0CPdEsCCasws6ShXBgmBBmEagpXQQLAgWBAuSY2gaKaWPYEGwIEwg0F RmECwIFoQeQjJlhJWUEFazjFDJCkI5WYRWMgjtfEGYyQnCXD4jTCdm1zmngFpBFznwVNi5RPSbwbWnpYr%2BBHi%2FtCTfgPLEPL7jBct AKBRptXJ8M%2BprIuZKu%2BUKcg4YK1PLz7kx4bSqHyPaT4d%2B28OCJJiRBo4FCQsSA0bziT3XubMgYUG6fc5fatmGBQkL0hoJ1IaZMi QsSFiQ8vRscTjlQOI2iHZwtpHuf%2BJAYiOiJSkj8Z%2FIQ4ABANvXGLd3%2BZMrAAAAAElFTkSuQmCC'); background-repeat:repeat; </style> </head> <body> </body> </html> data: URL AIR CSS Adobe AIR 1.0 WebKit CSS -webkit WebKit CSS Webkit CSS Webkit Safari CSS AIR WebKit Adobe AIR 1.0 AIR WebKit Safari 4 window.postmessage AIR API CSS Web (WOFF) SVG HTML AIR PrintJob API SVG WAI-ARIA

21 ADOBE AIR HTML HTML 14 WebSocket AIR Socket API Web workers WebKit SQL API AIR API WebKit geolocation API AIR geolocation API WebKit API WebKit AIR (WML) AIR JavaScript API HTML CSS JavaScript Window applicationcache() console opendatabase() postmessage() document.print() HTML audio video HTML aria-* draggable formnovalidate list novalidate onbeforeload onhashchange onorientationchange onpagehide onpageshow onpopstate ontouchstart ontouchmove ontouchend ontouchcancel onwebkitbeginfullscreen onwebkitendfullscreen pattern

22 ADOBE AIR HTML HTML 15 required sandbox JavaScript beforeload hashchange orientationchange pagehide pageshow popstate touchstart touchmove touchend touchcancel webkitbeginfullscreen webkitendfullscreen CSS background-clip background-origin -webkit-background-origin background-repeat-x background-repeat-y background-size -webkit-background-size border-bottom-left-radius border-bottom-right-radius border-radius border-top-left-radius border-top-right-radius text-rendering -webkit-animation-play-state -webkit-background-clip -webkit-color-correction -webkit-font-smoothing CSS media-volume-slider-container

23 ADOBE AIR HTML HTML 16 media-volume-slider media-volume-sliderthumb outer-spin-button border-box background-clip background-origin contain (background-size) content-box background-clip background-origin cover (background-size) afar amharic amharic-abegede cjk-earthly-branch cjk-heavenly-stem ethiopic ethiopic-abegede ethiopic-abegede-am-et ethiopic-abegede-gez ethiopic-abegede-ti-er ethiopic-abegede-ti-et ethiopic-halehame-aa-er ethiopic-halehame-aa-et ethiopic-halehame-am-et ethiopic-halehame-gez ethiopic-halehame-om-et ethiopic-halehame-sid-et ethiopic-halehame-so-et ethiopic-halehame-ti-er ethiopic-halehame-ti-et ethiopic-halehame-tig hangul hangul-consonant lower-norwegian oromo sidama somali

24 ADOBE AIR HTML HTML 17 tigre tigrinya-er tigrinya-er-abegede tigrinya-et tigrinya-et-abegede upper-greek upper-norwegian -wap-marquee

25 18 2 : AIR HTML JavaScript Adobe AIR 1.0 HTML JavaScript Adobe AIR HTML AIR HTMLLoader mx:html Flex HTML JavaScript SWF AIR HTML AIR Adobe AIR 1.0 AIR HTML Web HTML JavaScript AIR Adobe Dreamweaver Dreamweaver AIR AIR SDK ADL AIR ADL ADT AIR AIR ADL Dreamweaver 4 ADT Dreamweaver AIR Adobe AIR 1.0 HTML API

26 ADOBE AIR HTML AIR HTML JavaScript 19 HTML <html> <head> <title>sample application</title> <script type="text/javascript" src="airaliases.js"></script> <script> function getdesktopfilelist() var log = document.getelementbyid("log"); var files = air.file.desktopdirectory.getdirectorylisting(); for (i = 0; i < files.length; i++) log.innerhtml += files[i].name + "<br/>"; </script> </head> <body onload="getdesktopfilelist();" style="padding: 10px"> <h2>files and folders on the desktop:</h2> <div id="log" style="width: 450px; height: 200px; overflow-y: scroll;" /> </body> </html> AIR Debug Launcher (ADL) Web getdesktopfilelist() File API script AIRAliases.js AIR SDK AIR API air.file AIR File 24 AIRAliases.js File.desktopDirectory File File File.desktopDirectory File getdirectorylisting() File File.desktopDirectory.getDirectoryListing() File File name getdesktopfilelist() for div innerhtml AIR HTML Adobe AIR 1.0 AIR AIR API AIR API eval() API Ajax eval() API AIR AIR API Web eval() AIR API AIR API 30

27 ADOBE AIR HTML AIR HTML JavaScript 20 JavaScript Adobe AIR runtime security violation for JavaScript code in the application security sandbox JavaScript Adobe AIR 20 JavaScript 63 Adobe AIR HTML JavaScript Adobe AIR 1.0 JavaScript Adobe AIR runtime security violation for JavaScript code in the application security sandbox JavaScript Adobe AIR JavaScript Adobe AIR 1.0 load load JavaScript JavaScript eval() settimeout() setinterval() Function JavaScript JavaScript javascript: URL innerhtml outerhtml onevent JavaScript document.write() document.writeln() load load XMLHttpRequests 65 Adobe Ajax JavaScript Adobe AIR 1.0 JavaScript 30 AIR API 31

28 ADOBE AIR HTML AIR HTML JavaScript 21 eval() Flash Player 9 Adobe AIR 1.0 eval() load load eval() eval() Adobe AIR 1.0 eval("obj." + propname + " = " + val); obj[propname] = val; Adobe AIR 1.0 function compile(var1, var2) eval("var fn = function() this."+var1+"(var2) "); return fn; function compile(var1, var2) var self = this; return function() self[var1](var2) ; Adobe AIR 1.0 JavaScript var CustomClass = Utils: Parser: function() alert('constructor'), Data: ; var constructorclassname = "CustomClass.Utils.Parser"; eval() var myobj; eval('myobj=new ' + constructorclassname +'()')

29 ADOBE AIR HTML AIR HTML JavaScript 22 eval() function getter(str) var obj = window; var names = str.split('.'); for(var i=0;i<names.length;i++) if(typeof obj[names[i]]=='undefined') var undefstring = names[0]; for(var j=1;j<=i;j++) undefstring+="."+names[j]; throw new Error(undefstring+" is undefined"); obj = obj[names[i]]; return obj; try var Parser = getter(constructorclassname); var a = new Parser(); catch(e) alert(e); settimeout() setinterval() Adobe AIR 1.0 settimeout("alert('timeout')", 100); settimeout(function()alert('timeout'), 100); this this.apptimer = setinterval("obj.customfunction();", 100); var _self = this; this.apptimer = setinterval(function()obj.customfunction.apply(_self);, 100); Function Adobe AIR 1.0 new Function(param, body) load javascript: URL Adobe AIR 1.0 javascript: URL JavaScript javascript: URL

30 ADOBE AIR HTML AIR HTML JavaScript 23 <a href="javascript:code()">click Me</a> <a href="#" onclick="code()">click Me</a> innerhtml outerhtml onevent Adobe AIR 1.0 innerhtml outerhtml DOM onclick onmouseover id addeventlistener() <div id="container"></div> document.getelementbyid('container').innerhtml = '<a href="#" onclick="code()">click Me.</a>'; document.getelementbyid('container').innerhtml = '<a href="#" id="smith">click Me.</a>'; document.getelementbyid('smith').addeventlistener("click", function() code(); ); JavaScript Adobe AIR document.write() document.writeln() Adobe AIR 1.0 load document.write() document.writeln() DOM load load XMLHttpRequests Adobe AIR 1.0 load load XMLHttpRequests XMLHttpRequests load load XMLHttpRequests Adobe AIR 1.0 innerhtml document.createelement()

31 ADOBE AIR HTML AIR HTML JavaScript 24 JavaScript AIR API Adobe AIR 1.0 Webkit HTML JavaScript AIR SQL AIR API File flash.filesystem JavaScript File var myfile = new window.runtime.flash.filesystem.file(); runtime JavaScript AIR HTML JavaScript runtime flash Flash runtime flash.filesystem flash.filesystem File ActionScript frame iframe runtime runtime JavaScript window.runtime.flash.desktop.nativeapplication AIR SDK AIRAliases.js air.nativeapplication AIR API HTML Flash Player API HTML Adobe AIR API SWF (Flash Player) ActionScriptJavaScript ActionScript ECMAScript JavaScript HTML ActionScript SWF JavaScript Dictionary XML XMLList ActionScript 290 ActionScript JavaScript ActionScript AIRAliases.js Adobe AIR 1.0 window.runtime.flash.desktop.nativeapplication window.runtime.flash.desktop.clipboardmanager window.runtime.flash.filesystem.filestream window.runtime.flash.data.sqldatabase AIR SDK AIRAliases.js

32 ADOBE AIR HTML AIR HTML JavaScript 25 air.nativeapplication air.clipboard air.filestream air.sqldatabase AIRAliases.js HTML Adobe AIR API AIRAliases.js window.runtime.trace() window.runtime.flash.net.navigatetourl() window.runtime.flash.net.sendtourl() air.trace() air.navigatetourl() air.sendtourl() AIRAliases.js HTML script <script src="airaliases.js"></script> src JavaScript HTML AIRAliases.js AIR URL Adobe AIR 1.0 AIR HTML img frame iframe script src link href URL URL URL file file:///c:/air Test/test.txt app app:/images app-storage AIR app-storage:/settings/prefs.xml http HTTP https HTTPS AIR URL 273 URI AIR API File Loader URLStream Sound URLRequest URL URLRequest URL URLRequest Adobe var urlreq = new air.urlrequest(" URLRequest 271 HTTP

33 ADOBE AIR HTML AIR HTML JavaScript 26 HTML SWF Adobe AIR 1.0 AIR HTML SWF object embed SWF Web object embed HTML SWF AIR W3C object AIR HTML object embed HTML SWF NativeWindow (wmode) window AIR SWF HTML SWF wmode opaque transparent window wmode HTML object HTML SWF wmode opaque NativeWindow SWF AIR URL SWF AIR <object type="application/x-shockwave-flash" width="100%" height="100%"> <param name="movie" value="app:/swffile.swf"></param> <param name="wmode" value="opaque"></param> </object> object urlstring SWF elementid ID <script> function showswf(urlstring, elementid) var displaycontainer = document.getelementbyid(elementid); var flash = createswfobject(urlstring, 'opaque', 650, 650); displaycontainer.appendchild(flash); function createswfobject(urlstring, wmodestring, width, height) var SWFObject = document.createelement("object"); SWFObject.setAttribute("type","application/x-shockwave-flash"); SWFObject.setAttribute("width","100%"); SWFObject.setAttribute("height","100%"); var movieparam = document.createelement("param"); movieparam.setattribute("name","movie"); movieparam.setattribute("value",urlstring); SWFObject.appendChild(movieParam); var wmodeparam = document.createelement("param"); wmodeparam.setattribute("name","wmode"); wmodeparam.setattribute("value",wmodestring); SWFObject.appendChild(wmodeParam); return SWFObject; </script> HTMLLoader alpha 1.0 SWF AIR wmode SWF SWF HTML SWF SWF HTML SWF

34 ADOBE AIR HTML AIR HTML JavaScript 27 var imageloader; function showswf(urlstring, elementid) var displaycontainer = document.getelementbyid(elementid); imageloader = createswfobject(urlstring,650,650); displaycontainer.appendchild(imageloader); function createswfobject(urlstring, width, height) var SWFObject = document.createelement("object"); SWFObject.setAttribute("type","application/x-shockwave-flash"); SWFObject.setAttribute("width","100%"); SWFObject.setAttribute("height","100%"); var movieparam = document.createelement("param"); movieparam.setattribute("name","movie"); movieparam.setattribute("value",urlstring); SWFObject.appendChild(movieParam); var flashvars = document.createelement("param"); flashvars.setattribute("name","flashvars"); //Load the asset inside the SWF content. flashvars.setattribute("value","imgpath=air.jpg"); SWFObject.appendChild(flashVars); return SWFObject; function loadimage() showswf("imageloader.swf", "imagespot"); ActionScript HTML

35 ADOBE AIR HTML AIR HTML JavaScript 28 package import flash.display.sprite; import flash.display.loaderinfo; import flash.display.stagescalemode; import flash.display.stagealign; import flash.display.loader; import flash.net.urlrequest; public class ImageLoader extends Sprite public function ImageLoader() var flashvars = LoaderInfo(this.loaderInfo).parameters; if(flashvars.imgpath) var imageloader = new Loader(); var image = new URLRequest(flashvars.imgPath); imageloader.load(image); addchild(imageloader); imageloader.x = 0; imageloader.y = 0; stage.scalemode=stagescalemode.no_scale; stage.align=stagealign.top_left; HTML ActionScript Adobe AIR 1.0 AIR HTML SWF ActionScript myclasses.swf lib HTML script <script src="lib/myclasses.swf" type="application/x-shockwave-flash"></script> type="application/x-shockwave-flash" SWF Flash Player 10 AIR 1.5 SWF XML AIR 1.5 AIR lib myclasses.swf JavaScript Window runtime var libraryobject = new window.runtime.libraryclass(); SWF LibraryClass utilities var libraryobject = new window.runtime.utilities.libraryclass(); ActionScript SWF AIR HTML acompc acompc Flex SDK Flex SDK

36 ADOBE AIR HTML AIR HTML JavaScript 29 ActionScript HTML DOM JavaScript Adobe AIR 1.0 <script> SWF ActionScript HTML JavaScript window document ActionScript JavaScript HTML <html> <script src="aslibrary.swf" type="application/x-shockwave-flash"></script> <script> num = 254; function getstatus() return "OK."; function runasfunction(window) var obj = new runtime.asclass(); obj.accessdom(window); </script> <body onload="runasfunction"> <p id="p1">body text.</p> </body> </html> HTML num JavaScript getstatus() JavaScript window window.document P ID p1 ActionScript ASLibrary.swf ASClass ASClass accessdom() JavaScript accessdom() JavaScript Window Window DOM public class ASClass public function accessdom(window:*):void trace(window.num); // 254 trace(window.document.getelementbyid("p1").innerhtml); // Body text.. trace(window.getstatus()); // OK. ActionScript HTML p1 foo JavaScript public function modifydom(window:*):void window.document.getelementbyid("p1").innerhtml = "Bye"; window.foo = 66; Date RegExp Adobe AIR 1.0 JavaScript ActionScript Date RegExp Date RegExp ActionScript jsdate JavaScript Date ActionScript Date var asdate:date = new Date(jsDate.getMilliseconds());

37 ADOBE AIR HTML AIR HTML JavaScript 30 ActionScript jsregexp JavaScript RegExp ActionScript RegExp var flags:string = ""; if (jsregexp.dotall) flags += "s"; if (jsregexp.extended) flags += "x"; if (jsregexp.global) flags += "g"; if (jsregexp.ignorecase) flags += "i"; if (jsregexp.multiline) flags += "m"; var asregexp:regexp = new RegExp(jsRegExp.source, flags); Adobe AIR 1.0 AIR JavaScript Adobe AIR 1.0 AIR AIR frame iframe example.com example.com JavaScript AIR API AIR XMLHttpRequest 10 HTML frame iframe 63 Adobe AIR HTML 5 XMLHttpRequest Adobe AIR 1.0 frame iframe

38 ADOBE AIR HTML AIR HTML JavaScript 31 AIR frame sandboxroot documentroot sandboxroot URL documentroot sandboxroot URL sandboxroot URL file: http: https: URL URL documentroot file: app: app-storage: URL sandbox <iframe src=" sandboxroot=" documentroot="app:/sandbox/"> </iframe> ui.html sandbox javascript <script src=" <script src=" sandboxroot URL URL AIR XMLHttpRequest Adobe AIR 1.0 window childsandboxbridge parentsandboxbridge Adobe AIR 1.0 childsandboxbridge childsandbox var interface = ; interface.calculateprice = function() return ".45 cents"; interface.storeid = "abc" window.childsandboxbridge = interface; iframe ID child frame childsandboxbridge var childinterface = document.getelementbyid("child").contentwindow.childsandboxbridge; air.trace(childinterface.calculateprice()); //traces ".45 cents" air.trace(childinterface.storeid)); //traces "abc"

39 ADOBE AIR HTML AIR HTML JavaScript 32 Adobe AIR 1.0 parentsandboxbridge parentsandbox frame var interface = ; interface.save = function(text) var savefile = air.file("app-storage:/save.txt"); //write text to file document.getelementbyid("child").contentwindow.parentsandboxbridge = interface; frame save.txt save var texttosave = "A string."; window.parentsandboxbridge.save(texttosave); Adobe AIR 1.0 DOM DOM Window frame iframe dominitialize dominitialize frame dominitialize <html> <head> <script> var bridgeinterface = ; bridgeinterface.testproperty = "Bridge engaged"; function engagebridge() document.getelementbyid("sandbox").contentwindow.parentsandboxbridge = bridgeinterface; </script> </head> <body> <iframe id="sandbox" src=" documentroot="app:/" sandboxroot=" ondominitialize="engagebridge()"/> </body> </html> child.html

40 ADOBE AIR HTML AIR HTML JavaScript 33 <html> <head> <script> document.write(window.parentsandboxbridge.testproperty); </script> </head> <body></body> </html> dominitialize window.open() window var childwindow = window.open(); childwindow.addeventlistener("dominitialize", engagebridge()); childwindow.document.location = " child.html HTMLLoader createrootwindow() createrootwindow()

41 34 3 : AIR HTML Adobe AIR 1.0 Adobe AIR (DOM) 3 HTMLLoader Adobe AIR 1.0 HTMLLoader Adobe ActionScript 3.0 htmldominitialize complete htmlboundschanged locationchange locationchanging HTML DOM HTML DOM HTML onload contentwidth / contentheight HTMLLoader location JavaScript HTMLLoader load() loadstring() reload() historygo() historyforward() historyback() locationchanging preventdefault() locationchanging HTMLLoader scroll uncaughtscriptexception HTML Scroll # window.scrollto() scroll HTMLLoader JavaScript JavaScript AIR - HTML DOM Adobe AIR 1.0 HTML DOM HTML on <div id="mydiv" onclick="myhandler()"> document.getelementbyid("mydiv").onclick

42 ADOBE AIR HTML AIR HTML 35 addeventlistener() document.getelementbyid("mydiv").addeventlister("click", clickhandler) DOM AIR addeventlistener() JavaScript AIR AIR Event AIR I/O I/O IOErrorEvent function eventresponse(eventobject) // Actions performed in response to the event go here. eventtarget.addeventlistener(eventtype.event_name, eventresponse); addeventlistener() Adobe AIR 1.0 AIR AIR AIR NativeWindow closing preventdefault() FileStream OutputProgressEvent MP3 Sound id3 ID3 Event API JavaScript EventDispatcher Adobe AIR 1.0 AIR SWF ActionScript 3.0 ActionScript 3.0 SWF HTML DOM DOM AIR HTML HTML DOM ActionScript 3.0 AIR

43 ADOBE AIR HTML AIR HTML 36 Adobe AIR Adobe AIR 1.0 AIR API Event AIR API Event Event Event Event Event Adobe AIR 1.0 Event Event.type Event.cancelable AIR SWF ActionScript 3.0 Adobe AIR 1.0 Event.type filereadhandler() myfilestream complete myfilestream.addeventlistener(event.complete, filereadhandler); AIR Event COMPLETE CLOSING ID3 HTML Adobe AIR API Event JavaScript myfilestream.addeventlistener(event.complete, htmlrenderhandler); myfilestream.addeventlistener("complete", htmlrenderhandler); Adobe AIR 1.0 cancelable cancelable preventdefault() 37

44 ADOBE AIR HTML AIR HTML 37 Event Adobe AIR 1.0 Event SWF ActionScript Event Adobe AIR 1.0 Event clone() tostring() Adobe AIR 1.0 preventdefault() isdefaultprevented() preventdefault() isdefaultprevented() preventdefault() preventdefault() API cancelable Event Event Adobe AIR 1.0 Event Event AIR API Event InvokeEvent Event FileListEvent directorylisting selectmultiple JavaScript Adobe AIR 1.0 addeventlistener() addeventlistener() closing

45 ADOBE AIR HTML AIR HTML 38 window.nativewindow.addeventlistener(air.nativewindow.closing, handlewindowclosing); addeventlistener() type AIR API type Adobe AIR 1.0 HTML movehandler() move NativeWindowBoundsEvent <html> <script src="airaliases.js" /> <script> function init() writevalues(); window.nativewindow.addeventlistener(air.nativewindowboundsevent.move, movehandler); function writevalues() document.getelementbyid("xtext").value = window.nativewindow.x; document.getelementbyid("ytext").value = window.nativewindow.y; function movehandler(event) air.trace(event.type); // move writevalues(); </script> <body onload="init()" /> <table> <tr> <td>window X:</td> <td><textarea id="xtext"></textarea></td> </tr> <tr> <td>window Y:</td> <td><textarea id="ytext"></textarea></td> </tr> </table> </body> </html> textarea X Y movehandler() event type move listener addeventlistener() movehandler() addeventlistener(event.move, movehandler) addeventlistener() HTML Adobe AIR API usecapture priority useweakreference

46 ADOBE AIR HTML AIR HTML 39 Adobe AIR 1.0 removeeventlistener() eventname listener addeventlistener() HTML Adobe AIR 1.0 HTML HTML HTML HTML JavaScript (The application attempted to reference a JavaScript object in an HTML page that is no longer loaded.) HTML JavaScript HTMLLoader window unload JavaScript uncaughtscriptexception window.onunload = cleanup; window.htmlloader.addeventlistener('uncaughtscriptexception', uncaughtscriptexception); function cleanup() window.htmlloader.removeeventlistener('uncaughtscriptexception', uncaughtscriptexceptionhandler); HTML cleanup NativeWindow (window.nativewindow) closing JavaScript uncaughtscriptexception window.nativewindow.addeventlistener(air.event.closing, cleanup); function cleanup() window.htmlloader.removeeventlistener('uncaughtscriptexception', uncaughtscriptexceptionhandler); JavaScript HTMLLoader createrootwindow() html complete complete removeeventlistener() var html = runtime.flash.html.htmlloader.createrootwindow(true); html.addeventlistener('complete', htmlcompletelistener); function htmlcompletelistener() html.removeeventlistener(complete, arguments.callee) // handler code.. html.load(new runtime.flash.net.urlrequest("second.html"));

47 ADOBE AIR HTML AIR HTML 40 Adobe AIR 1.0 haseventlistener() Adobe AIR 1.0 AIR Debug Launcher ErrorEvent text StatusEvent level text level error StatusEvent AIR Debug Launcher AIR

48 41 4 : AIR HTML Adobe AIR 1.0 Adobe AIR HTMLLoader HTML HTML HTML HTMLHost HTMLLoader HTMLLoader HTMLHost HTML HTMLHost AIR HTML HTMLHost defaultbehavior true HTMLHost HTMLHost HTMLLoader htmlhost HTMLHost HTMLLoader HTMLHost ActionScript HTML HTMLHost SWF window.htmlloader <script src="htmlhostlibrary.swf" type="application/x-shockwave-flash"></script> <script> window.htmlloader.htmlhost = new window.runtime.htmlhostimplementation(); </script> HTMLLoader Adobe AIR 1.0 HTMLLoader Adobe Flash Player Sprite HTML SWF PDF HTML HTML HTMLLoader Adobe AIR 1.0 HTMLLoader HTML HTMLLoader x y width height visible

49 ADOBE AIR HTML AIR HTML 42 HTML HTMLLoader width height 0 HTML HTML HTMLLoader HTML CSS HTMLLoader HTMLLoader width 0 contentwidth contentheight HTMLLoader HTML CSS HTMLLoader HTMLLoader scalex scaley HTMLLoader Adobe AIR 1.0 HTMLLoader paintsdefaultbackground true HTMLLoader paintsdefaultbackground false HTMLLoader HTML body HTML style="background-color:gray" HTML HTMLLoader opaquebackground paintsdefaultbackground false opaquebackground PNG HTML Alpha HTML HTMLLoader Adobe AIR 1.0 HTMLLoader 1.0 HTMLLoader HTMLLoader HTML SWF PDF Adobe AIR 1.0 HTMLLoader SWF PDF HTMLLoader 1.0 HTMLLoader alpha 1.0 HTMLLoader PDF object embed wmode opaque transparent HTML SWF wmode window SWF wmode AIR wmode HTML SWF HTMLLoader 26 HTML SWF 231 AIR PDF

50 ADOBE AIR HTML AIR HTML 43 Adobe AIR 1.0 HTMLLoader HTMLLoader alpha filters graphics opaquebackground rotation scalex scaley transform HTML HTML HTML paintsdefaultbackground false paintsdefaultbackground false HTMLLoader HTML SWF PDF 1 HTML SWF PDF HTML HTML HTML SWF PDF filters HTML var blur = new window.runtime.flash.filters.blurfilter(); var filters = [blur]; window.htmlloader.filters = filters; HTML Sprite BlurFilter HTML Adobe AIR API AIRAliases.js Adobe Flash Platform ActionScript 3.0 HTML Adobe AIR 1.0 HTMLLoader HTML window.history HTMLLoader HTML historylength historyposition gethistoryat() URLRequest

51 ADOBE AIR HTML AIR HTML 44 historyback() historyforward() historygo() HTMLHistoryItem HTMLHistoryItem ispost originalurl title url HTML POST true HTML URL HTML HTML URL HTML Adobe AIR 1.0 HTMLLoader useragent HTMLLoader load() HTMLLoader useragent HTMLLoader load() URLRequest useragent URLRequestDefaults.userAgent HTMLLoader URLRequestDefaults URLRequest HTMLLoader load() URLRequest HTMLLoader useragent URLRequestDefaults.userAgent HTMLLoader useragent URLRequestDefaults.userAgent AIR Mac OS Windows "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0" "Mozilla/5.0 (Windows; U; en) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0" HTML Adobe AIR 1.0 HTML meta meta http-equiv="content-type" content="text/html" charset="iso "; HTMLLoader textencodingoverride window.htmlloader.textencodingoverride = "ISO "; HTMLLoader textencodingfallback HTML HTMLLoader window.htmlloader.textencodingfallback = "ISO ";

52 ADOBE AIR HTML AIR HTML 45 textencodingoverride HTML textencodingoverride HTML textencodingfallback HTML textencodingoverride textencodingfallback HTML Adobe AIR 1.0 JavaScript API HTML AIR HTMLHost API ActionScript HTMLHost HTML ActionScript (SWF) ActionScript HTML 28 HTML ActionScript HTMLHost Adobe AIR 1.0 AIR HTMLHost JavaScript window.status window.document.title window.location window.blur() window.close() window.focus() window.moveby() window.moveto() window.open() window.resizeby() window.resizeto() new HTMLLoader() HTMLLoader JavaScript HTMLHost JavaScript API HTMLHost HTMLHost HTMLHost defaultbehaviors true var defaulthost = new HTMLHost(true); AIR HTMLLoader createrootwindow() HTML HTMLHost HTMLLoader htmlhost HTMLHost null AIR HTMLHost HTML AIR JavaScript window.open()

53 ADOBE AIR HTML AIR HTML 46 HTMLHost Adobe AIR 1.0 HTMLHost HTMLLoader Flex 1 HTMLHost 2 CustomHost window.open() window.document.title window.open() HTML window.document.title HTML <title> package import flash.html.*; import flash.display.stagescalemode; import flash.display.nativewindow; import flash.display.nativewindowinitoptions; public class CustomHost extends HTMLHost import flash.html.*; override public function createwindow(windowcreateoptions:htmlwindowcreateoptions):htmlloader var initoptions:nativewindowinitoptions = new NativeWindowInitOptions(); var bounds:rectangle = new Rectangle(windowCreateOptions.x, windowcreateoptions.y, windowcreateoptions.width, windowcreateoptions.height); var htmlcontrol:htmlloader = HTMLLoader.createRootWindow(true, initoptions, windowcreateoptions.scrollbarsvisible, bounds); htmlcontrol.htmlhost = new HTMLHostImplementation(); if(windowcreateoptions.fullscreen) htmlcontrol.stage.displaystate = StageDisplayState.FULL_SCREEN_INTERACTIVE; return htmlcontrol; override public function updatetitle(title:string):void htmlloader.stage.nativewindow.title = title; 3 HTMLLoader HTMLHost HTMLLoader htmlhost Flex CustomHost

54 ADOBE AIR HTML AIR HTML 47 <?xml version="1.0" encoding="utf-8"?> <mx:windowedapplication xmlns:mx=" layout="vertical" applicationcomplete="init()"> <mx:script> <![CDATA[ import flash.html.htmlloader; import CustomHost; private function init():void var html:htmlloader = new HTMLLoader(); html.width = container.width; html.height = container.height; var urlreq:urlrequest = new URLRequest("Test.html"); html.htmlhost = new CustomHost(); html.load(urlreq); container.addchild(html); ]]> </mx:script> <mx:uicomponent id="container" width="100%" height="100%"/> </mx:windowedapplication> HTML <html> <head> <title>test</title> </head> <script> function openwindow() window.runtime.trace("in"); document.title = "foo" window.open('test.html'); window.runtime.trace("out"); </script> <body> <a href="#" onclick="openwindow()">window.open('test.html')</a> </body> </html> Flash Professional 1 AIR Flash CustomHostExample CustomHostExample.fla 2 CustomHost.as ActionScript HTMLHost CustomHost window.open() window.document.title window.open() HTML window.document.title HTML <title>

55 ADOBE AIR HTML AIR HTML 48 package import flash.display.stagescalemode; import flash.display.nativewindow; import flash.display.nativewindowinitoptions; import flash.events.event; import flash.events.nativewindowboundsevent; import flash.geom.rectangle; import flash.html.htmlloader; import flash.html.htmlhost; import flash.html.htmlwindowcreateoptions; import flash.text.textfield; public class CustomHost extends HTMLHost public var statusfield:textfield; public function CustomHost(defaultBehaviors:Boolean=true) super(defaultbehaviors); override public function windowclose():void htmlloader.stage.nativewindow.close(); override public function createwindow( windowcreateoptions:htmlwindowcreateoptions ):HTMLLoader var initoptions:nativewindowinitoptions = new NativeWindowInitOptions(); var bounds:rectangle = new Rectangle(windowCreateOptions.x, windowcreateoptions.y, windowcreateoptions.width, windowcreateoptions.height); var htmlcontrol:htmlloader = HTMLLoader.createRootWindow(true, initoptions, windowcreateoptions.scrollbarsvisible, bounds); htmlcontrol.htmlhost = new HTMLHostImplementation(); if(windowcreateoptions.fullscreen) htmlcontrol.stage.displaystate = StageDisplayState.FULL_SCREEN_INTERACTIVE; return htmlcontrol; override public function updatelocation(locationurl:string):void trace(locationurl); override public function set windowrect(value:rectangle):void htmlloader.stage.nativewindow.bounds = value;

56 ADOBE AIR HTML AIR HTML 49 override public function updatestatus(status:string):void statusfield.text = status; trace(status); override public function updatetitle(title:string):void htmlloader.stage.nativewindow.title = title + "- Example Application"; override public function windowblur():void htmlloader.alpha = 0.5; override public function windowfocus():void htmlloader.alpha = 1; 3 CustomHostExample.as ActionScript HTMLLoader CustomHost package import flash.display.sprite; import flash.html.htmlloader; import flash.net.urlrequest; import flash.text.textfield; public class CustomHostExample extends Sprite function CustomHostExample():void var html:htmlloader = new HTMLLoader(); html.width = 550; html.height = 380; var host:customhost = new CustomHost(); html.htmlhost = host; var urlreq:urlrequest = new URLRequest("Test.html"); html.load(urlreq); addchild(html); var statustxt:textfield = new TextField(); statustxt.y = 380; statustxt.height = 20; statustxt.width = 550; statustxt.background = true; statustxt.backgroundcolor = 0xEEEEEEEE; addchild(statustxt); host.statusfield = statustxt; HTML

57 ADOBE AIR HTML AIR HTML 50 <html> <head> <title>test</title> <script> function openwindow() document.title = "Test" window.open('test.html'); </script> </head> <body bgcolor="#eeeeee"> <a href="#" onclick="window.open('test.html')">window.open('test.html')</a> <br/><a href="#" onclick="window.document.location=' window.document.location = ' <br/><a href="#" onclick="window.moveby(6, 12)">moveBy(6, 12)</a> <br/><a href="#" onclick="window.close()">window.close()</a> <br/><a href="#" onclick="window.blur()">window.blur()</a> <br/><a href="#" onclick="window.focus()">window.focus()</a> <br/><a href="#" onclick="window.status = new Date().toString()">window.status=new Date().toString()</a> </body> </html> 1 ActionScript HTMLHostImplementation.as 2 HTMLHost 3 CustomHost window.open() window.document.title window.open() HTML window.document.title HTML <title>

58 ADOBE AIR HTML AIR HTML 51 package import flash.html.htmlhost; import flash.html.htmlloader; import flash.html.htmlwindowcreateoptions; import flash.geom.rectangle; import flash.display.nativewindowinitoptions; import flash.display.stagedisplaystate; public class HTMLHostImplementation extends HTMLHost public function HTMLHostImplementation(defaultBehaviors:Boolean = true):void super(defaultbehaviors); override public function updatetitle(title:string):void htmlloader.stage.nativewindow.title = title + " - New Host"; override public function createwindow(windowcreateoptions:htmlwindowcreateoptions):htmlloader var initoptions:nativewindowinitoptions = new NativeWindowInitOptions(); var bounds:rectangle = new Rectangle(windowCreateOptions.x, windowcreateoptions.y, windowcreateoptions.width, windowcreateoptions.height); var htmlcontrol:htmlloader = HTMLLoader.createRootWindow(true, initoptions, windowcreateoptions.scrollbarsvisible, bounds); htmlcontrol.htmlhost = new HTMLHostImplementation(); if(windowcreateoptions.fullscreen) htmlcontrol.stage.displaystate = StageDisplayState.FULL_SCREEN_INTERACTIVE; return htmlcontrol; 4 acompc SWF acompc -source-path. -include-classes HTMLHostImplementation -output Host.zip acompc Flex SDK AIR SDK AIR SDK SWF HTML compc acompc 5 Host.zip Library.swf 6 Library.swf HTMLHostLibrary.swf SWF HTML 7 <script> HTML <script src="htmlhostlibrary.swf" type="application/x-shockwave-flash"></script> 8 HTMLHost HTMLLoader window.htmlloader.htmlhost = new window.runtime.htmlhostimplementation(); HTML HTMLHost updatetitle() createwindow()

59 ADOBE AIR HTML AIR HTML 52 <html> <head> <title>htmlhost Example</title> <script src="htmlhostlibrary.swf" type="application/x-shockwave-flash"></script> <script language="javascript"> window.htmlloader.htmlhost = new window.runtime.htmlhostimplementation(); function test() window.open('child.html', 'Child', 'fullscreen'); </script> </head> <body> <button onclick="test()">create Window</button> </body> </html> child.html HTML window.location Adobe AIR 1.0 locationchange() HTML URL JavaScript window.location locationchange() URL override public function updatelocation(locationurl:string):void htmlloader.load(new URLRequest(locationURL)); HTMLHost htmlloader HTMLLoader window.moveby() window.moveto() window.resizeto() window.resizeby() JavaScript Adobe AIR 1.0 set windowrect() HTML JavaScript window.moveby() window.moveto() window.resizeto() window.resizeby() set windowrect() override public function set windowrect(value:rectangle):void htmlloader.stage.nativewindow.bounds = value; window.open() JavaScript Adobe AIR 1.0 createwindow() window.open() JavaScript createwindow() HTMLLoader HTMLLoader HTMLLoader.createRootWindow() HTMLLoader createwindow() NativeWindow HTMLLoader

60 ADOBE AIR HTML AIR HTML 53 override public function createwindow(windowcreateoptions:htmlwindowcreateoptions):htmlloader var initoptions:nativewindowinitoptions = new NativeWindowInitOptions(); var bounds:rectangle = new Rectangle(windowCreateOptions.x, windowcreateoptions.y, windowcreateoptions.width, windowcreateoptions.height); var htmlcontrol:htmlloader = HTMLLoader.createRootWindow(true, initoptions, windowcreateoptions.scrollbarsvisible, bounds); htmlcontrol.htmlhost = new HTMLHostImplementation(); if(windowcreateoptions.fullscreen) htmlcontrol.stage.displaystate = StageDisplayState.FULL_SCREEN_INTERACTIVE; return htmlcontrol; HTMLHost window.open() htmlhost null createwindow() HTMLWindowCreateOptions HTMLWindowCreateOptions window.open() features HTMLWindowCreateOptions fullscreen height locationbarvisible menubarvisible resizeable scrollbarsvisible statusbarvisible toolbarvisible width x y window.open() JavaScript features fullscreen height location menubar resizable scrollbars status toolbar width left screenx top screeny HTMLLoader feature JavaScript window.open() createwindow() HTMLLoader window.close() JavaScript Adobe AIR 1.0 windowclose() window.close() JavaScript window.close() override public function windowclose():void htmlloader.stage.nativewindow.close();

61 ADOBE AIR HTML AIR HTML 54 window.close() JavaScript HTMLLoader override public function windowclose():void htmlloader.parent.removechild(htmlloader); window.status Adobe AIR 1.0 updatestatus() window.status JavaScript override public function updatestatus(status:string):void trace(status); updatestatus() HTMLLoader window.document.title Adobe AIR 1.0 updatetitle() window.document.title JavaScript Sample override public function updatetitle(title:string):void htmlloader.stage.nativewindow.title = title + " - Sample"; HTML document.title updatetitle() document.title HTMLLoader window.blur() window.focus() JavaScript Adobe AIR 1.0 windowblur() windowfocus() window.blur() window.focus() JavaScript override public function windowblur():void htmlloader.alpha = 0.5; override public function windowfocus():void htmlloader.alpha = 1.0; NativeApplication.nativeApplication.activate(htmlLoader.stage.nativeWindow); AIR API

62 ADOBE AIR HTML AIR HTML 55 HTML Adobe AIR 1.0 HTMLLoader HTMLLoader.createRootWindow() HTMLLoader NativeWindow visible windowinitoptions scrollbarsvisible bounds (true) (false) NativeWindowInitOptions NativeWindowInitOptions NativeWindow (true) (false) Rectangle HTMLLoader.createRootWindow() HTMLLoader var initoptions = new air.nativewindowinitoptions(); var bounds = new air.rectangle(10, 10, 600, 400); var html2 = air.htmlloader.createrootwindow(true, initoptions, true, bounds); var urlreq2 = new air.urlrequest(" html2.load(urlreq2); html2.stage.nativewindow.activate(); JavaScript createrootwindow() HTML JavaScript Window opener parent null HTMLHost createwindow() createrootwindow() opener parent HTML

63 56 5 : Adobe AIR 1.5 Vector Vector AIR API NativeProcess NetworkInfo Vector Adobe AIR JavaScript Vector air.vector AIRAliases.js Adobe AIR 1.5 Vector Vector Vector Vector Vector Vector Vector Array Vector Array Vector null Vector Vector Vector (length - 1) [length] Vector Vector Array Vector Array Vector Vector Vector Vector Array Vector Array Vector Array Array Vector ([]) Vector T Vector T Type T

64 ADOBE AIR HTML 57 Vector Vector (.) (<>) Vector.<T> T Vector AIR 1.5 air.vector["<t>"]() Vector Vector type Vector Vector (<>) var v = new air.vector["<string>"](); v String String air.vector["<t>"]() Vector Vector length Vector["<T>"]() var names = new air.vector["<string>"](); air. trace(names.length); // output: 0 Vector Vector Vector length Vector null null Number null ages Vector Number NaN var ages = new air.vector["<number>"](3); air.trace(ages); // output: NaN, NaN, NaN Vector["<T>"]() Vector true fixed Vector Vector AIR window.runtime Vector Vector ActionScript 3.0 File Vector var files = new air.vector["flash.filesystem.file"](3); Adobe AIR 1.5 ([]) songtitles[5] = "Happy Birthday"; Vector Vector Vector length Vector myvector[myvector.length] = valuetoadd; Vector push() unshift() splice()

65 ADOBE AIR HTML 58 Vector fixed true Vector push() Vector Adobe AIR 1.5 ([]) var myfavoritesong = songtitles[3]; Vector RangeError Array Vector pop() shift() splice() var vegetables = new air.vector["<string>"]; vegetables.push("spinach"); vegetables.push("green pepper"); vegetables.push("cilantro"); vegetables.push("onion"); var spliced = vegetables.splice(2, 2); air.trace(spliced); // output: spinach,green pepper length length length 1 Vector fixed true Vector Vector Vector Vector Adobe AIR 1.5 Array Vector reverse() Vector sort() Vector Vector sorton() HTML Adobe AIR Vector AIR API Adobe AIR 1.5 Adobe AIR NetworkInfo findinterfaces() NetworkInterface NativeProcessStartupInfo arguments

66 ADOBE AIR HTML 59 AIR API Adobe AIR 2.0 NetworkInfo findinterfaces() NetworkInterface var netinfo = air.networkinfo; var interfaces = netinfo.findinterfaces(); for (i = 0; i < interfaces.length; i++) air.trace(interfaces[i].name]; air.trace(" hardware address: ", interface.hardwareaddress); NetworkInfo for NetworkInterface interfaces InterfaceAddress var netinfo = air.networkinfo; var interfaces = netinfo.findinterfaces(); for (i = 0; i < interfaces.length; i++) air.trace(interfaces[i].name]; air.trace(" hardware address: ", interface.hardwareaddress); air.trace(" addresses: ", traceaddresses(i); function traceaddresses(i) returnstring = new String(); for (j = 0; j < interfaces[i].addresses.length; j++) returnstring += interfaces[i],addresses[j].address + " "; AIR API Adobe AIR 2.0 NativeProcessStartupInfo arguments air.vector() push() var arguments = new air.vector["<string>"](); arguments.push("test"); arguments.push("44"); var startupinfo = new air.nativeprocessstartupinfo(); startupinfo.arguments = arguments; startupinfo.executable = File.applicationDirectory.resolvePath("myApplication.exe"); process = new air.nativeprocess(); process.start(startupinfo); API

67 60 6 : AIR Adobe AIR 1.0 AIR Adobe AIR 1.0 AIR AIR AIR Adobe AIR Adobe Flash Player AIR SWF JavaScript HTML AIR Adobe AIR 1.0 AIR air AIR Windows EXE Android APK Adobe AIR AIR AIR AIR Adobe AIR 1.0 AIR SWF Flash Player Mac OS /Library/Frameworks/ Windows C:\Program Files\Common Files\Adobe AIR Linux /opt/adobe AIR/

68 ADOBE AIR HTML AIR 61 Mac OS Windows Linux ios AIR AIR Web Adobe AIR 1.0 Adobe AIR SWF SWF SWF Adobe AIR 1.0 AIR HTML AIR AIR Adobe AIR 1.0 AIR AIR AIR Web AIR AIR AIR AIR AIR Adobe AIR Mac OS ~/Applications/ Windows XP C:\Program Files\ Windows Vista ~/Apps/ Linux /opt/

69 ADOBE AIR HTML AIR 62 installfolder AIR Adobe AIR 1.0 AIR AIR Windows AIR AIR exe Linux AIR AIR bin Mac OS AIR app Finder AIR app AIR Windows.exe Linux.bin Mac OS.app AIR Adobe AIR 1.0 AIR app-storage:/ app-storage:/ Mac OS <appdata>/<appid>/local Store/ <appdata> /Users/<user>/Library/Preferences Windows <appdata>\<appid>\local Store\ <appdata> CSIDL_APPDATA C:\Documents and Settings\<user>\Application Data Linux <appdata>/<appid>/local Store/ <appdata> /home/<user>/.appdata air.file.applicationstoragedirectory File resolvepath() 126 Adobe AIR Adobe AIR 1.0 AIR

70 ADOBE AIR HTML AIR 63 AIR Adobe AIR 1.0 AIR API Updater.update() AIR AIR Updater AIR versionnumber AIR Adobe AIR 1.0 AIR AIR AIR Windows Adobe AIR 1.0 Windows AIR Windows HKLM\Software\Policies\Adobe\AIR AppInstallDisabled AIR 0 1 UntrustedAppInstallDisabled AIR 0 1 UpdateDisabled 0 1 Adobe AIR HTML Adobe AIR 1.0 AIR HTML iframe HTML HTML SWF HTML JavaScript JavaScript HTML JavaScript SWF iframe frame frame iframe AIR SDK HTML HTMLLoader JavaScript AIR API

71 ADOBE AIR HTML AIR 64 StageWebView HTML AIR StageWebView AIR StageWebView Webkit HTMLLoader AIR HTML StageWebView HTML StageWebView Web TextField HTML JavaScript 20 JavaScript HTML Adobe AIR 1.0 Frame iframe AIR HTML Frame AIR HTML HTML HTML frame iframe AIR Web frame iframe frame cookie AIR HTML AIR HTML load AIR eval() HTML frame iframe eval() JavaScript JavaScript 65 AIR HTML AIR frame Adobe AIR 1.0 AIR sandboxroot documentroot HTML frame iframe sandboxroot documentroot frame URL file: http: https: URL frame URL file: app: app-storage: URL sandbox <iframe src="ui.html" sandboxroot=" documentroot="app:/sandbox/"> </iframe>

72 ADOBE AIR HTML AIR 65 frame Adobe AIR 1.0 AIR childsandboxbridge parentsandboxbridge frame window frame childsandboxbridge childsandboxbridge frame frame childsandbox frame frame frame frame var interface = ; interface.calculateprice = function() return ; interface.storeid = "abc" window.childsandboxbridge = interface; ID "child" iframe frame childsandboxbridge var childinterface = document.getelementbyid("child").childsandboxbridge; air.trace(childinterface.calculateprice()); //traces "1.65" air.trace(childinterface.storeid)); //traces "abc" parentsandboxbridge parentsandboxbridge frame frame frame parentsandbox frame frame frame frame save var interface = ; interface.save = function(text) var savefile = air.file("app-storage:/save.txt"); //write text to file document.getelementbyid("child").parentsandboxbridge = interface; frame save.txt save var texttosave = "A string."; window.parentsandboxbridge.save(texttosave); parentsandboxbridge SecurityError childsandboxbridge SecurityError Adobe AIR Adobe AIR HTML HTML JavaScript API Adobe AIR runtime security violation for JavaScript code in the application security sandbox JavaScript Adobe AIR 20 JavaScript

73 ADOBE AIR HTML AIR 66 JavaScript eval() Adobe AIR 1.0 HTML body onload onload API DOM innerhtml (JavaScript) DOM JavaScript eval() onload eval() eval() eval("null"); eval("3 +.14"); eval("'foo'"); prop1: val1, prop2: val2 setter/getter get prop1()..., set prop1(v)... [ val1, val2, val3 ] a.b.c onload onload eval("alert(44)"); eval("myfunction(44)"); eval("nativeapplication.applicationid"); eval() eval() innerhtml DOM script innerhtml DOM script src script src JavaScript javascript URL href="javascript:alert('test')"

74 ADOBE AIR HTML AIR 67 setinterval() settimout() settimeout('x = 4', 1000) document.write() document.writeln() eval() JSON JSON JavaScript JSON Ajax JavaScript AIR JavaScript 70 Adobe Ajax JavaScript eval() AIR API Adobe AIR 1.0 JavaScript window.runtime AIR API TypeError try window.runtime.flash.system.nativeapplication.nativeapplication.exit(); catch (e) alert(e); TypeError window.runtime 70 XMLHttpRequest Adobe AIR 1.0 HTML XMLHttpRequest HTML onload HTML JavaScript XMLHttpRequest frame iframe allowcrosscomainxhr iframe JavaScript XMLHttpRequest <iframe id="ui" src=" sandboxroot=" allowcrossdomainxhr="true" documentroot="app:/"> </iframe> 68

75 ADOBE AIR HTML AIR 68 CSS frame iframe img Adobe AIR 1.0 HTML URL CSS frame iframe img HTML CSS frame iframe img JavaScript window.open() Adobe AIR 1.0 JavaScript window.open() JavaScript window.open() window.open() settimeout() window.open() window.open() window.open() window.open() Adobe AIR 1.0 JavaScript Adobe AIR runtime security violation for JavaScript code in the application security sandbox JavaScript Adobe AIR 20 JavaScript HTML Adobe AIR 1.0 HTMLLoader loadstring() HTML Internet HTML loadstring() HTML AIR API HTMLLoader placeloadstringcontentinapplicationsandbox true loadstring() HTML HTML Adobe AIR 1.0 AIR

76 ADOBE AIR HTML AIR 69 AIR Adobe AIR 1.0 AIR AIR parentsandboxbridge childsandboxbridge parentsandboxbridge SecurityError childsandboxbridge SecurityError (HTML) Adobe AIR 1.0 HTML parentsandboxbridge childsandboxbridge JavaScript window HTML 31 API Adobe AIR 1.0 API readfile(path) readapplicationsetting() API 30 Adobe AIR 1.0 Web Web Web Flash Player SWF Cookie AIR 71

77 ADOBE AIR HTML AIR 70 AIR URL URL app:/ app-storage:/ file:/// AIR app: URL AIR app-storage:/ app-storage:/ Mac OS <appdata>/<appid>/local Store/ <appdata> /Users/<user>/Library/Preferences Windows <appdata>\<appid>\local Store\ <appdata> CSIDL_APPDATA C:\Documents and Settings\<userName>\Application Data Linux <appdata>/<appid>/local Store/ <appdata> /home/<user>/.appdata 71 Adobe AIR 1.0 AIR Adobe AIR 1.0 AIR AIR SWF API SWF AIR 68

78 ADOBE AIR HTML AIR 71 Adobe AIR 1.0 AIR Web AIR AIR Adobe AIR 1.0 app-storage:/ AIR AIR SecurityError app:/ URL AIR API Loader.loadBytes() JavaScript eval() Adobe AIR 1.0 AIR URL Adobe AIR 1.0 EncryptedLocalStore 218 HTTPS: (TLS)

79 ADOBE AIR HTML AIR 72 Adobe AIR 1.0 Adobe AIR 1.0 AIR (CA) AIR CA SDK adt Flash Flash Builder adt

80 73 7 : AIR Adobe AIR 1.0 Adobe AIR API AIR Adobe AIR 1.0 AIR Adobe Developer Connection AIR API Flash Flex HTML AIR Mac Apple Windows Microsoft Linux Flex Alpha AIR Adobe AIR 1.0 AIR API ActionScript NativeWindow API ActionScript Flash Professional NativeWindow NativeWindow HTML JavaScript Window Web JavaScript Window Flex mx:windowedapplication mx:window NativeWindow Flex Flex AIR WindowedApplication Application Flex ActionScript NativeWindow Flash Player NativeWindow HTML HTML HTML CSS JavaScript HTML HTML DOM HTML NativeWindow AIR HTML nativewindow NativeWindow NativeWindow JavaScript Window moveto() close()

81 ADOBE AIR HTML AIR 74 Flex Framework Flex Framework mx:windowedapplication mx:window HTML AIR AIR AIR initialwindow SWF AIR NativeWindow SWF HTML AIR HTML HTML Adobe AIR 1.0 API flash.display NativeWindow NativeWindowInitOptions NativeWindowDisplayState NativeWindowResize NativeWindowSystemChrome NativeWindowType flash.events NativeWindowBoundsEvent NativeWindowDisplayStateEvent Adobe AIR NativeWindow displaystatechanging 2 3 NativeWindow displaystatechange NativeWindow a b move resize NativeWindow

82 ADOBE AIR HTML AIR 75 dispatchevent() API HTML Adobe AIR API Flash Player 9 Adobe AIR 1.0 type systemchrome transparent owner window NativeWindowInitOptions AIR type normal transparent true type lightweight systemchrome standard Adobe AIR 1.0 AIR NativeWindowType AIR Normal Utility Lightweight Windows Mac OS X Windows Mac OS X Windows Mac OS X Windows (Alt+Space) type systemchrome none Adobe AIR 1.0 systemchrome standard none standard none NativeWindowSystemChrome transparent false type normal utility

83 ADOBE AIR HTML AIR 76 Adobe AIR 1.0 Alpha transparent true transparent Alpha 1 Alpha Linux Mac OS X Windows HTML SWF PDF 42 HTML SWF PDF NativeWindow.supportsTransparency Mac Windows Linux HTML Adobe AIR 1.0 HTML HTMLLoader HTML HTML paintsdefaultbackground false HTMLLoader var htmlview:htmlloader = new HTMLLoader(); htmlview.paintsdefaultbackground = false; JavaScript HTML window.htmlloader.paintsdefaultbackground = false; HTML PNG

84 ADOBE AIR HTML AIR 77 NativeWindow.owner Christian Cantrell AIR 2.6 Adobe AIR 1.0 Mac OS X Windows Linux Mac OS X Microsoft Windows Linux * Type normal SystemChrome standard Transparent false Type utility SystemChrome standard Transparent false

85 ADOBE AIR HTML AIR 78 Mac OS X Microsoft Windows Linux * Type Any SystemChrome none Transparent false Type Any SystemChrome none Transparent true mxwindowedapplication mx:window Type Any SystemChrome none Transparent true * Ubuntu Compiz AIR Mac OS X Mac OS X Windows Adobe AIR 1.0 AIR NativeWindow HTML HTMLLoader createrootwindow() HTML JavaScript window.open() NativeWindow HTMLLoader HTMLLoader HTML JavaScript window.nativewindow JavaScript NativeWindow AIR

86 ADOBE AIR HTML AIR 79 <visible>false</visible> false NativeWindow HTMLLoader createrootwindow() HTML visible false NativeWindow activate() visible true Adobe AIR 1.0 systemchrome type transparent owner maximizable minimizable resizable standard normal false null true true true AIR AIR type normal visible width height NativeWindowInitOptions HTML NativeWindowInitOptions NativeWindow HTMLLoader createrootwindow() NativeWindowInitOptions var options = new air.nativewindowinitoptions(); options.systemchrome = air.nativewindowsystemchrome.standard; options.type = air.nativewindowtype.utility options.transparent = false; options.resizable = false; options.maximizable = false; transparent true type lightweight systemchrome standard JavaScript window.open() HTMLHost 52 window.open() JavaScript Adobe AIR 1.0 HTML AIR HTML HTML HTML DOM AIR runtime htmlloader nativewindow JavaScript Window JavaScript nativewindow

87 ADOBE AIR HTML AIR 80 HTML AIR JavaScript load <html> <head> <script language="javascript" type="text/javascript" src="airaliases.js"></script> <script language="javascript"> window.onload=init; function init() window.nativewindow.activate(); </script> </head> <body></body> </html> AIRAliases.js AIR AIR SDK frameworks NativeWindow Adobe AIR 1.0 NativeWindow NativeWindowInitOptions NativeWindow var options = new air.nativewindowinitoptions(); options.systemchrome = air.nativewindowsystemchrome.standard; options.transparent = false; var newwindow = new air.nativewindow(options); visible true activate() Flash scalemode noscale StageScaleMode.NO_SCALE Flash AIR HTML noscale NativeWindow var maxossize = air.nativewindow.systemmaxsize; var minossize = air.nativewindow.systemminsize; HTML Adobe AIR 1.0 HTML JavaScript Window.open() AIR HTMLLoader createrootwindow() HTML JavaScript Window.open() open() open() URL newwindow = window.open("xmpl.html", "logwindow", "height=600, width=400, top=10, left=10");

88 ADOBE AIR HTML AIR 81 ActionScript HTMLHost JavaScript window.open() 45 HTMLHost HTMLLoader.createRootWindow() JavaScript 300x400 var options = new air.nativewindowinitoptions(); options.systemchrome = "none"; options.type = "lightweight"; var windowbounds = new air.rectangle(200,250,300,400); newhtmlloader = air.htmlloader.createrootwindow(true, options, true, windowbounds); newhtmlloader.load(new air.urlrequest("xmpl.html")); window AIR runtime nativewindow htmlloader HTML SWF SWF object embed wmode opaque transparent wmode window SWF wmode PDF AIR SWF createrootwindow() JavaScript Window parent opener null createrootwindow() HTMLLoader Window newhtmlloader.window JavaScript Window JavaScript ActionScript createrootwindow() mx:window Adobe AIR 1.0 mx:window mx:window MXML Window Window mx:window var newwindow:window = new Window(); newwindow.systemchrome = NativeWindowSystemChrome.NONE; newwindow.transparent = true; newwindow.title = "New Window"; newwindow.width = 200; newwindow.height = 200; newwindow.open(true); Adobe AIR 1.0 AIR MXML HTML SWF Flex Flash HTML JavaScript SWF HTML AIR app: URL AIR API AIR API JavaScript JavaScript Window runtime nativewindow htmlloader

89 ADOBE AIR HTML AIR 82 HTML 60 AIR HTML NativeWindow HTML NativeWindow HTMLLoader HTML HTMLLoader HTMLLoader.createRootWindow() HTMLLoader 300 x 500 HTML //newwindow is a NativeWindow instance var htmlview:htmlloader = new HTMLLoader(); htmlview.width = 300; htmlview.height = 500; //set the stage so display objects are added to the top-left and not scaled newwindow.stage.align = "TL"; newwindow.stage.scalemode = "noscale"; newwindow.stage.addchild( htmlview ); //urlstring is the URL of the HTML page to load htmlview.load( new URLRequest(urlString) ); HTML Flex Flex HTML transparent true HTML SWF SWF object embed wmode opaque transparent wmode window SWF wmode PDF HTMLLoader HTMLLoader alpha 1.0 SWF PDF SWF HTML HTML NativeWindow Flash HTML HTML window.nativewindow.stage addchild() addchild() HTML window.nativewindow.stage addchildat() index HTML HTML HTMLlLoader paintsdefaultbackground false body Flash HTML shape HTML shape enterframe

90 ADOBE AIR HTML AIR 83 <html> <head> <title>bouncers</title> <script src="airaliases.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> air.shape = window.runtime.flash.display.shape; function Bouncer(radius, color) this.radius = radius; this.color = color; //velocity this.vx = -1.3; this.vy = -1; //Create a Shape object and draw a circle with its graphics property this.shape = new air.shape(); this.shape.graphics.linestyle(1,0); this.shape.graphics.beginfill(this.color,.9); this.shape.graphics.drawcircle(0,0,this.radius); this.shape.graphics.endfill(); //Set the starting position this.shape.x = 100; this.shape.y = 100; //Moves the sprite by adding (vx,vy) to the current position this.update = function() this.shape.x += this.vx; this.shape.y += this.vy; //Keep the sprite within the window if( this.shape.x - this.radius < 0) this.vx = -this.vx; if( this.shape.y - this.radius < 0) this.vy = -this.vy; if( this.shape.x + this.radius > window.nativewindow.stage.stagewidth) this.vx = -this.vx; if( this.shape.y + this.radius > window.nativewindow.stage.stageheight) this.vy = -this.vy; ; function init() //turn off the default HTML background window.htmlloader.paintsdefaultbackground = false; var bottom = new Bouncer(60,0xff2233); var top = new Bouncer(30,0x2441ff); //listen for the enterframe event window.htmlloader.addeventlistener("enterframe",function(evt) bottom.update();

91 ADOBE AIR HTML AIR 84 ); top.update(); //add the bouncing shapes to the window stage window.nativewindow.stage.addchildat(bottom.shape,0); window.nativewindow.stage.addchild(top.shape); </script> <body onload="init();"> <h1>de Finibus Bonorum et Malorum</h1> <p>sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> <p style="background-color:#ffff00; color:#660000;">this paragraph has a background color.</p> <p>at vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p> </body> </html> AIR JavaScript ActionScript ActionScript Adobe ActionScript 3.0 JavaScript Window nativewindow htmlloader HTML HTML Adobe AIR 1.0 function createnativewindow() //create the init options var options = new air.nativewindowinitoptions(); options.transparent = false; options.systemchrome = air.nativewindowsystemchrome.standard; options.type = air.nativewindowtype.normal; //create the window var newwindow = new air.nativewindow(options); newwindow.title = "A title"; newwindow.width = 600; newwindow.height = 400; //activate and show the new window newwindow.activate(); Adobe AIR 1.0 NativeWindow

92 ADOBE AIR HTML AIR 85 Flex mx:windowedapplication mx:window NativeWindow NativeWindow Adobe AIR 1.0 var nativewin = new air.nativewindow(initoptions); stage var nativewin = window.htmlloader.stage.nativewindow; target function onnativewindowevent(event) var nativewin = event.target; HTML nativewindow var nativewin = window.nativewindow; NativeApplication activewindow openedwindows var win = NativeApplication.nativeApplication.activeWindow; var firstwindow = NativeApplication.nativeApplication.openedWindows[0]; NativeApplication.nativeApplication.activeWindow AIR null NativeApplication.nativeApplication.openedWindows AIR Flex mx:windowedapplication mx:window stage MXML <?xml version="1.0" encoding="utf-8"?> <mx:windowedapplication xmlns:mx=" applicationcomplete="init();"> <mx:script> <![CDATA[ import flash.display.nativewindow; public function init():void var appwindow:nativewindow = this.stage.nativewindow; //set window properties appwindow.visible = true; ]]> </mx:script> </WindowedApplication Flex WindowedApplication Window stage null Flex Application WindowedApplication Window creationcomplete NativeWindow applicationcomplete NativeWindow

93 ADOBE AIR HTML AIR 86 Adobe AIR 1.0 NativeWindow activate() visible true activate() activate visible true visible false Mac OS X Mac OS X visible false Adobe AIR 1.0 AIR alwaysinfront true alwaysinfront false AIR alwaysinfront true AIR alwaysinfront ordertofront() alwaysinfront true ordertofront() NativeWindow

94 ADOBE AIR HTML AIR 87 alwaysinfront false false true true false alwaysinfront ordertofront() orderinfrontof() ordertoback() orderbehind() activate() visible false Linux alwaysinfront true alwaysinfront true Adobe AIR 1.0 NativeWindow.close() NativeWindow.close() close close NativeWindow IllegalOperationError closed NativeWindow.visible false Nativeapplication.autoExit true close Adobe AIR 1.0 closing preventdefault() dispatchevent()

95 ADOBE AIR HTML AIR 88 function onclosecommand(event) var closingevent = new air.event(air.event.closing,true,true); dispatchevent(closingevent); if(!closingevent.isdefaultprevented()) win.close(); preventdefault() dispatchevent() false false isdefaultprevented() Adobe AIR 1.0 NativeWindow maximize() window.nativewindow.maximize(); NativeWindow minimize() window.nativewindow.minimize(); NativeWindow restore() window.nativewindow.restore(); AIR Mac OS X AIR Linux maximizable minimizable Linux NativeWindow displaystatechange displaystatechange 91 Adobe AIR 1.0 HTML NativeWindow maximize() minimize() restore() close()

96 ADOBE AIR HTML AIR 89 <html> <head> <title>change Window Display State</title> <script src="airaliases.js"/> <script type="text/javascript"> function onmaximize() window.nativewindow.maximize(); function onminimize() window.nativewindow.minimize(); function onrestore() window.nativewindow.restore(); function onclose() window.nativewindow.close(); </script> </head> <body> <h1>air window display state commands</h1> <button onclick="onmaximize()">maximize</button> <button onclick="onminimize()">minimize</button> <button onclick="onrestore()">restore</button> <button onclick="onclose()">close</button> </body> </html> Adobe AIR 1.0 NativeWindow 85 NativeWindow NativeWindow startresize() mousedown mouseup startresize() width height bounds Linux Y Y Linux NativeWindow resize resize 91

97 ADOBE AIR HTML AIR 90 NativeWindow startmove() startresize() mousedown startmove() mouseup startresize() startmove() HTML Adobe AIR API x y bounds Linux NativeWindow move move 91 Adobe AIR 1.0 <html xmlns=" <head> <script src="airaliases.js"/> <script type="text/javascript"> function onresize(type) nativewindow.startresize(type); function onnativemove() nativewindow.startmove(); </script> <style type="text/css" media="screen">.drag width:200px; height:200px; margin:0px auto; padding:15px; border:1px dashed #333; background-color:#eee;.resize background-color:#ff0000; padding:10px;

98 ADOBE AIR HTML AIR 91.left float:left;.right float:right; </style> <title>move and Resize the Window</title> </head> <body> <div class="resize left" onmousedown="onresize(air.nativewindowresize.top_left)">drag to resize</div> <div class="resize right" onmousedown="onresize(air.nativewindowresize.top_right)">drag to resize</div> <div class="drag" onmousedown="onnativemove()">drag to move</div> <div class="resize left" onmousedown="onresize(air.nativewindowresize.bottom_left)">drag to resize</div> <div class="resize right" onmousedown="onresize(air.nativewindowresize.bottom_right)">drag to resize</div> </body> </html> Adobe AIR 1.0 closing window.nativewindow.addeventlistener(air.event.closing, onclosingevent); target closing close closing window close() closing close closing window dispatchevent() Event activate deactivate closing close Mac OS X Quit NativeWindowBoundsEvent moving

99 ADOBE AIR HTML AIR 92 move resizing resize NativeWindowBoundsEvent beforebounds afterbounds NativeWindowDisplayStateEvent displaystatechanging displaystatechange NativeWindowDisplayStateEvent beforedisplaystate afterdisplaystate Linux Adobe AIR 1.0 Stage displaystate StageDisplayState.FULL_SCREEN_INTERACTIVE SWF Esc Linux Flex AIR

100 ADOBE AIR HTML AIR 93 <?xml version="1.0" encoding="utf-8"?> <mx:windowedapplication xmlns:mx=" layout="vertical" applicationcomplete="init()" backgroundcolor="0x003030" focusrect="false"> <mx:script> <![CDATA[ private function init():void stage.displaystate = StageDisplayState.FULL_SCREEN_INTERACTIVE; focusmanager.setfocus(terminal); terminal.text = "Welcome to the dumb terminal app. Press the ESC key to exit..\n"; terminal.selectionbeginindex = terminal.text.length; terminal.selectionendindex = terminal.text.length; ]]> </mx:script> <mx:textarea id="terminal" height="100%" width="100%" scroll="false" backgroundcolor="0x003030" color="0xccff00" fontfamily="lucida Console" fontsize="44"/> </mx:windowedapplication> Flash ActionScript import flash.display.sprite; import flash.display.stagedisplaystate; import flash.text.textfield; import flash.text.textformat; public class FullScreenTerminalExample extends Sprite public function FullScreenTerminalExample():void var terminal:textfield = new TextField(); terminal.multiline = true; terminal.wordwrap = true; terminal.selectable = true; terminal.background = true; terminal.backgroundcolor = 0x ; this.stage.displaystate = StageDisplayState.FULL_SCREEN_INTERACTIVE; addchild(terminal); terminal.width = 550; terminal.height = 400; terminal.text = "Welcome to the dumb terminal application. Press the ESC key to exit.\n_"; var tf:textformat = new TextFormat(); tf.font = "Courier New"; tf.color = 0x00CCFF00; tf.size = 12; terminal.settextformat(tf); terminal.setselection(terminal.text.length - 1, terminal.text.length); HTML

101 ADOBE AIR HTML AIR 94 <html> <head> <title>fullscreen Mode</title> <script language="javascript" type="text/javascript"> function setdisplaystate() window.nativewindow.stage.displaystate = runtime.flash.display.stagedisplaystate.full_screen_interactive; </script> <style type="text/css"> body,.mono font-family: Courier New, Courier, monospace; font-size: x-large; color:#ccff00; background-color:#003030; </style> </head> <body onload="setdisplaystate();"> <p class="mono">welcome to the dumb terminal app. Press the ESC key to exit...</p> <textarea name="dumb" class="mono" cols="100" rows="40">%</textarea> </body> </html>

102 95 8 : AIR Adobe AIR 1.0 Adobe AIR Screen flash.display.screen AIR Adobe AIR 1.0 API Screen AIR Screen (#1) (0,0) #2 #1 API HTML Adobe AIR API

103 ADOBE AIR HTML AIR 96 Adobe AIR 1.0 Screen.screens Screen.mainScreen Screen.getScreensForRectangle() Screen Screen Mac OS X Windows Screen Screen API screens Screen.getScreensForRectangle() <html> <head> <script src="airaliases.js" type="text/javascript"></script> <script type="text/javascript"> function onkey(event) if(air.screen.screens.length > 1) switch(event.keycode) case air.keyboard.left : moveleft(); break; case air.keyboard.right : moveright(); break; case air.keyboard.up : moveup(); break; case air.keyboard.down : movedown(); break; function moveleft() var currentscreen = getcurrentscreen(); var left = air.screen.screens; left.sort(sorthorizontal); for(var i = 0; i < left.length - 1; i++) if(left[i].bounds.left < window.nativewindow.bounds.left) window.nativewindow.x += left[i].bounds.left - currentscreen.bounds.left; window.nativewindow.y += left[i].bounds.top - currentscreen.bounds.top; function moveright() var currentscreen = getcurrentscreen(); var left = air.screen.screens;

104 ADOBE AIR HTML AIR 97 left.sort(sorthorizontal); for(var i = left.length - 1; i > 0; i--) if(left[i].bounds.left > window.nativewindow.bounds.left) window.nativewindow.x += left[i].bounds.left - currentscreen.bounds.left; window.nativewindow.y += left[i].bounds.top - currentscreen.bounds.top; function moveup() var currentscreen = getcurrentscreen(); var top = air.screen.screens; top.sort(sortvertical); for(var i = 0; i < top.length - 1; i++) if(top[i].bounds.top < window.nativewindow.bounds.top) window.nativewindow.x += top[i].bounds.left - currentscreen.bounds.left; window.nativewindow.y += top[i].bounds.top - currentscreen.bounds.top; break; function movedown() var currentscreen = getcurrentscreen(); var top = air.screen.screens; top.sort(sortvertical); for(var i = top.length - 1; i > 0; i--) if(top[i].bounds.top > window.nativewindow.bounds.top) window.nativewindow.x += top[i].bounds.left - currentscreen.bounds.left; window.nativewindow.y += top[i].bounds.top - currentscreen.bounds.top; break; function sorthorizontal(a,b) if (a.bounds.left > b.bounds.left) return 1; else if (a.bounds.left < b.bounds.left) return -1; else return 0; function sortvertical(a,b) if (a.bounds.top > b.bounds.top) return 1; else if (a.bounds.top < b.bounds.top) return -1;

105 ADOBE AIR HTML AIR 98 else return 0; function getcurrentscreen() var current; var screens = air.screen.getscreensforrectangle(window.nativewindow.bounds); (screens.length > 0)? current = screens[0] : current = air.screen.mainscreen; return current; function init() window.nativewindow.stage.addeventlistener("keydown",onkey); </script> <title>screen Hopper</title> </head> <body onload="init()"> <p>use the arrow keys to move the window between monitors.</p> </body> </html>

106 99 9 : Flash Player 9 Adobe AIR 1.0 Adobe AIR API Flash Player 9 Adobe AIR 1.0 AIR Adobe Developer Connection AIR NativeMenu Mac OS X Windows Linux AIR Cmd Flash Player AIR Flash Player 9 Adobe AIR 1.0 flash.display NativeMenu NativeMenuItem flash.events Event Flash Player 9 Adobe AIR 1.0 AIR Command SWF HTML Flash Player ContextMenu ContextMenuItem AIR NativeMenu ContextMenu AIR HTML Webkit HTML JavaScript API HTML

107 ADOBE AIR HTML 100 AIR Mac OS X Windows Linux Mac OS X AIR API AIR NativeMenu NativeWindow menu Windows Linux Mac OS X AIR Mac OS X Windows Linux NativeMenu Mac OS X Windows Linux AIR AIR NativeMenu display() Flash HTML MXML ActionScript JavaScript AIR AIR AIR Mac OS X Mac OS X HTML TextField TextField (AIR) Adobe AIR 1.0 NativeMenu NativeMenuItem NativeMenuItem NativeMenu

108 ADOBE AIR HTML 101 File Edit File Open Recent Edit NativeMenu NativeMenuItem NativeMenu File NativeMenuItem NativeMenuItem NativeMenuItem New Save Open Recent NativeMenu Open Recent NativeMenuItem NativeMenuItem NativeMenuItem GreatGatsby.pdf WarAndPeace.pdf Iliad.pdf NativeMenuItem Edit NativeMenu Edit NativeMenuItem NativeMenuItem NativeMenuItem NativeMenuItem Copy Paste Preferences NativeMenu NativeMenuItem NativeMenuItem NativeMenu NativeMenuItem NativeMenuItem submenu NativeMenu 108 (AIR) Adobe AIR 1.0 NativeMenu NativeMenuItem preparing displaying select Preparing preparing preparing Adobe AIR 2.6 Displaying displaying preparing displaying displaying preparing select

109 ADOBE AIR HTML 102 target currenttarget preparing displaying Select select select select select select target currenttarget ContextMenu ContextMenuItem menuitemselect menuselect select preparing displaying (AIR) Adobe AIR 1.0 select keyequivalent Shift Mac OS X Command (Keyboard.COMMAND) Windows Linux Control (Keyboard.CONTROL) keyequivalentmodifiers keyequivalent Shift Keyboard Windows Keyboard.COMMAND Ctrl Ctrl+Shift+G var item = new air.nativemenuitem("ungroup"); item.keyequivalent = "G"; Ctrl+Shift+G var item = new air.nativemenuitem("ungroup"); item.keyequivalent = "G"; item.keyequivalentmodifiers = [air.keyboard.control]; (AIR) Adobe AIR 1.0 Linux Mac OS X Windows Mac OS X Return mnemonicindex

110 ADOBE AIR HTML 103 Windows Enter Linux mnemonicindex 0 r Format mnemonicindex 2 var item = new air.nativemenuitem("format"); item.mnemonicindex = 2; Adobe AIR 1.0 checked enabled checked true var item = new air.nativemenuitem("format"); item.checked = true; enabled true false select var item = new air.nativemenuitem("format"); item.enabled = false; Adobe AIR 1.0 NativeMenuItem data Open Recent File var file = air.file.applicationstoragedirectory.resolvepath("greatgatsby.pdf") var menuitem = docmenu.additem(new air.nativemenuitem(file.name)); menuitem.data = file; (AIR) Adobe AIR 1.0 AIR Adobe AIR 1.0 NativeMenu NativeMenu var root = new air.nativemenu();

111 ADOBE AIR HTML 104 additemat() Mac OS var root = new air.nativemenu(); if (air.nativeapplication.supportsmenu) air.nativeapplication.nativeapplication.menu = root; else if (NativeWindow.supportsMenu) nativewindow.menu = root; Mac OS NativeMenu NativeApplication menu Adobe Flex FlexNativeMenu Flex FlexNativeMenu NativeMenu air.nativeapplication.nativeapplication.icon.menu = root; Mac OS X NativeMenu DockIcon menu root.display(window.nativewindow.stage, x, y); AIR Adobe AIR 1.0 NativeMenuItem NativeMenu submenu AIR addsubmenu() var editmenuitem = root.addsubmenu(new air.nativemenu(), "Edit"); submenu var editmenuitem = root.additem("edit", false); editmenuitem.submenu = new air.nativemenu();

112 ADOBE AIR HTML 105 Adobe AIR 1.0 NativeMenuItem var copy = new air.nativemenuitem("copy", false); copy.addeventlistener(air.event.select, oncopycommand); editmenu.additem(copy); select select select Adobe AIR 1.0 NativeMenuItem isseparator true var separatora = new air.nativemenuitem("a", true); editmenu.additem(separatora); HTML (AIR) Adobe AIR 1.0 HTMLLoader HTML contextmenu contextmenu preventdefault() function showcontextmenu(event) event.preventdefault(); DHTML AIR display() HTML contextmenu

113 ADOBE AIR HTML 106 <html> <head> <script src="airaliases.js" language="javascript" type="text/javascript"></script> <script language="javascript" type="text/javascript"> function showcontextmenu(event) event.preventdefault(); contextmenu.display(window.nativewindow.stage, event.clientx, event.clienty); function createcontextmenu() var menu = new air.nativemenu(); var command = menu.additem(new air.nativemenuitem("custom command")); command.addeventlistener(air.event.select, oncommand); return menu; function oncommand() air.trace("context command invoked."); var contextmenu = createcontextmenu(); </script> </head> <body> <p oncontextmenu="showcontextmenu(event)" style="-khtml-user-select:auto;">custom context menu.</p> </body> </html> (AIR) Adobe AIR 1.0 display() NativeMenu popupmenu NativeMenu function onmouseclick(event) popupmenu.display(window.nativewindow.stage, event.clientx, event.clienty); display() Flash Player 9 Adobe AIR 1.0

114 ADOBE AIR HTML 107 Flash Player 9 Adobe AIR 1.0 Object NativeMenu (AIR) Event.PREPARING Adobe AIR 2.6 Event.DISPLAYING Event.SELECT NativeMenuItem (AIR) Event.PREPARING Adobe AIR 2.6 Event.SELECT Event.DISPLAYING Adobe AIR 1.0 select NativeMenuItem var menucommandx = new NativeMenuItem("Command X"); menucommand.addeventlistener(air.event.select, docommandx) select select target var colormenuitem = new air.nativemenuitem("choose a color"); var colormenu = new air.nativemenu(); colormenuitem.submenu = colormenu; var red = new air.nativemenuitem("red"); var green = new air.nativemenuitem("green"); var blue = new air.nativemenuitem("blue"); colormenu.additem(red); colormenu.additem(green); colormenu.additem(blue); if(air.nativeapplication.supportsmenu) air.nativeapplication.nativeapplication.menu.additem(colormenuitem); air.nativeapplication.nativeapplication.menu.addeventlistener(air.event.select, colorchoice); else if (air.nativewindow.supportsmenu) var windowmenu = new air.nativemenu(); window.nativewindow.menu = windowmenu; windowmenu.additem(colormenuitem); windowmenu.addeventlistener(air.event.select, colorchoice); function colorchoice(event) var menuitem = event.target; air.trace(menuitem.label + " has been selected");

115 ADOBE AIR HTML 108 ContextMenuItem select menuitemselect menuitemselect Adobe AIR 1.0 displaying displaying ContextMenu menuselect AIR 2.6 preparing (AIR) Adobe AIR (AIR) Windows Mac OS X MenuExample NativeWindow NativeApplication supportsmenu NativeWindow.supportsMenu true NativeMenu File Edit NativeApplication.supportsMenu true File Edit Mac OS X select select displaying Open Recent Documents displaying <html> <head> <script src="airaliases.js" type="text/javascript"></script> <script type="text/javascript"> var application = air.nativeapplication.nativeapplication; var recentdocuments = new Array(new air.file("app-storage:/greatgatsby.pdf"), new air.file("app-storage:/warandpeace.pdf"), new air.file("app-storage:/iliad.pdf")); function MenuExample() var filemenu; var editmenu; if (air.nativewindow.supportsmenu && nativewindow.systemchrome!= air.nativewindowsystemchrome.none) nativewindow.menu = new air.nativemenu(); nativewindow.menu.addeventlistener(air.event.select, selectcommandmenu); filemenu = nativewindow.menu.additem(new air.nativemenuitem("file")); filemenu.submenu = createfilemenu(); editmenu = nativewindow.menu.additem(new air.nativemenuitem("edit")); editmenu.submenu = createeditmenu();

116 ADOBE AIR HTML 109 if (air.nativeapplication.supportsmenu) application.menu.addeventlistener(air.event.select, selectcommandmenu); filemenu = application.menu.additem(new air.nativemenuitem("file")); filemenu.submenu = createfilemenu(); editmenu = application.menu.additem(new air.nativemenuitem("edit")); editmenu.submenu = createeditmenu(); function createfilemenu() var filemenu = new air.nativemenu(); filemenu.addeventlistener(air.event.select,selectcommandmenu); var newcommand = filemenu.additem(new air.nativemenuitem("new")); newcommand.addeventlistener(air.event.select, selectcommand); var savecommand = filemenu.additem(new air.nativemenuitem("save")); savecommand.addeventlistener(air.event.select, selectcommand); var openfile = filemenu.additem(new air.nativemenuitem("open Recent")); openfile.submenu = new air.nativemenu(); openfile.submenu.addeventlistener(air.event.displaying, updaterecentdocumentmenu); openfile.submenu.addeventlistener(air.event.select, selectcommandmenu); return filemenu; function createeditmenu() var editmenu = new air.nativemenu(); editmenu.addeventlistener(air.event.select,selectcommandmenu); var copycommand = editmenu.additem(new air.nativemenuitem("copy")); copycommand.addeventlistener(air.event.select,selectcommand); copycommand.keyequivalent = "c"; var pastecommand = editmenu.additem(new air.nativemenuitem("paste")); pastecommand.addeventlistener(air.event.select, selectcommand); pastecommand.keyequivalent = "v"; editmenu.additem(new air.nativemenuitem("", true)); var preferencescommand = editmenu.additem(new air.nativemenuitem("preferences")); preferencescommand.addeventlistener(air.event.select,selectcommand); return editmenu; function updaterecentdocumentmenu(event) air.trace("updating recent document menu."); var docmenu = air.nativemenu(event.target); for (var i = docmenu.numitems - 1; i >= 0; i--) docmenu.removeitemat(i); for (var file in recentdocuments) var menuitem = docmenu.additem(new air.nativemenuitem(recentdocuments[file].name)); menuitem.data = recentdocuments[file]; menuitem.addeventlistener(air.event.select, selectrecentdocument); function selectrecentdocument(event) air.trace("selected recent document: " + event.target.data.name);

117 ADOBE AIR HTML 110 function selectcommand(event) air.trace("selected command: " + event.target.label); function selectcommandmenu(event) if (event.currenttarget.parent!= null) var menuitem = finditemformenu(event.currenttarget); if(menuitem!= null) air.trace("select event for \"" + event.target.label + "\" command handled by menu: " + menuitem.label); else air.trace("select event for \"" + event.target.label + "\" command handled by root menu."); function finditemformenu(menu) for (var item in menu.parent.items) if (item!= null) if (item.submenu == menu) return item; return null; </script> <title>air menus</title> </head> <body onload="menuexample()"></body> </html> MenuBuilder Adobe AIR 1.0 Adobe AIR JavaScript MenuBuilder XML JSON AIR AIR 99 MenuBuilder Adobe AIR 1.0 MenuBuilder XML JSON Mac OS X MenuBuilder Adobe AIR SDK AIRMenuBuilder.js <script type="text/javascript" src="airmenubuilder.js"></script> MenuBuilder

118 ADOBE AIR HTML 111 air.ui.menu MenuBuilder Adobe AIR 1.0 MenuBuilder 1 XML JSON 113 MenuBuilder 2 Menu Menu.createFromXML() Menu.createFromJSON() NativeMenu 3 Menu Menu.setAsMenu() Menu.setAsContextMenu() DOM Menu.setAsIconMenu() setasmenu() HTML onload DOM setascontextmenu() DOM <script> HTML </body> Adobe AIR 1.0 XML JSON Menu.createFromXML() XML Menu.createFromJSON() JSON NativeMenu windowmenu.xml HTML var windowmenu = air.ui.menu.createfromxml("windowmenu.xml"); menus contextmenu.js var contextmenu = air.ui.menu.createfromjson("menus/contextmenu.js"); NativeMenu NativeMenu Mac OS X MenuBuilder NativeMenu MenuBuilder 113 MenuBuilder

119 ADOBE AIR HTML 112 Adobe AIR 1.0 MenuBuilder Menu.setAsMenu() setasmenu() NativeMenu XML var windowmenu = air.ui.menu.createfromxml("windowmenu.xml"); air.ui.menu.setasmenu(windowmenu); setasmenu() window.nativewindow Mac OS X Edit Window Menu.setAsMenu() NativeMenu NativeMenu Edit Window true setasmenu() air.ui.menu.setasmenu(windowmenu, true); DOM Adobe AIR 1.0 MenuBuilder DOM Menu.createFromXML() Menu.createFromJSON() NativeMenu Menu.setAsContextMenu() DOM NativeMenu DOM Menu.setAsContextMenu() NativeMenu DOM ID var treecontextmenu = air.ui.menu.createfromxml("treecontextmenu.xml"); air.ui.menu.setascontextmenu(treecontextmenu, "navtree"); DOM HTML HTML null HTML air.ui.menu.setascontextmenu(null); DOM setascontextmenu() null ID Adobe AIR 1.0 DOM Adobe AIR Menu.createFromXML() Menu.createFromJSON() NativeMenu Menu.setAsIconMenu() NativeMenu

120 ADOBE AIR HTML 113 NativeMenu BitmapData application.xml application.xml // Assumes that icons are specified in the application.xml file. // Otherwise the icons would need to be specified using a second // parameter to the setasiconmenu() function. var iconmenu = air.ui.menu.createfromxml("iconmenu.xml"); air.ui.menu.setasiconmenu(iconmenu); Mac OS X OS MenuBuilder Adobe AIR 1.0 Menu.createFromXML() Menu.createFromJSON() NativeMenu XML NativeMenu NativeMenuItem MenuBuilder XML (attribute) (property) XML XML XML XML Adobe AIR 1.0 XML JSON Adobe AIR type (attribute) (property) normal check separator normal select onselect preparing displaying check NativeMenuItem checked true false select onselect true separator XML XML JSON items (attribute) (property) Adobe AIR 1.0 XML (attribute) (property)

121 ADOBE AIR HTML 114 (attribute) (property) altkey Boolean Alt cmdkey Boolean Command defaultkeyequivalentmodifiers ctrlkey Boolean Ctrl defaultkeyequivalentmodifiers defaultkeyequivalentmodifiers Boolean Mac OS X Command Windows Ctrl MenuBuilder true enabled Boolean (true) (false) MenuBuilder true items Array JSON keyequivalent String Shift label String separator mnemonicindex Integer onselect String Function (String) Function 118 MenuBuilder shiftkey String Shift keyequivalent keyequivalent Shift toggled Boolean MenuBuilder false type String separator check MenuBuilder type MenuBuilder (property) XML (attribute)

122 ADOBE AIR HTML 115 XML MenuBuilder Adobe AIR 1.0 MenuBuilder XML JSON 116 JSON MenuBuilder textcontextmenu.xml menuitem XML XML <?xml version="1.0" encoding="utf-8"?> <root> <menuitem label="menuitem A"/> <menuitem label="menuitem B" type="check" toggled="true"/> <menuitem label="menuitem C" enabled="false"/> <menuitem type="separator"/> <menuitem label="menuitem D"> <menuitem label="submenuitem D-1"/> <menuitem label="submenuitem D-2"/> <menuitem label="submenuitem D-3"/> </menuitem> </root> application.xml HTML <html> <head> <title>xml-based menu data source example</title> <script type="text/javascript" src="airaliases.js"></script> <script type="text/javascript" src="airmenubuilder.js"></script> <style type="text/css"> #contextenabledtext margin-left: auto; margin-right: auto; margin-top: 100px; width: 50% </style> </head> <body> <div id="contextenabledtext">this block of text is context menu enabled. Right click or Commandclick on the text to view the context menu.</div> <script type="text/javascript"> // Create a NativeMenu from "textcontextmenu.xml" and set it // as context menu for the "contextenabledtext" DOM element: var textmenu = air.ui.menu.createfromxml("textcontextmenu.xml"); air.ui.menu.setascontextmenu(textmenu, "contextenabledtext"); // Remove the default context menu from the page: air.ui.menu.setascontextmenu(null); </script> </body> </html>

123 ADOBE AIR HTML 116 JSON MenuBuilder Adobe AIR 1.0 MenuBuilder JSON XML 115 XML MenuBuilder textcontextmenu.js [ ] label: "MenuItem A", label: "MenuItem B", type: "check", toggled: "true", label: "MenuItem C", enabled: "false", type: "separator", label: "MenuItem D", items: [ label: "SubMenuItem D-1", label: "SubMenuItem D-2", label: "SubMenuItem D-3" ] application.xml HTML <html> <head> <title>json-based menu data source example</title> <script type="text/javascript" src="airaliases.js"></script> <script type="text/javascript" src="airmenubuilder.js"></script> <style type="text/css"> #contextenabledtext margin-left: auto; margin-right: auto; margin-top: 100px; width: 50% </style> </head> <body> <div id="contextenabledtext">this block of text is context menu enabled. Right click or Commandclick on the text to view the context menu.</div> <script type="text/javascript"> // Create a NativeMenu from "textcontextmenu.js" and set it // as context menu for the "contextenabledtext" DOM element: var textmenu = air.ui.menu.createfromjson("textcontextmenu.js"); air.ui.menu.setascontextmenu(textmenu, "contextenabledtext"); // Remove the default context menu from the page: air.ui.menu.setascontextmenu(null); </script> </body> </html>

124 ADOBE AIR HTML 117 MenuBuilder Adobe AIR 1.0 Adobe AIR Adobe AIR 1.0 NativeMenuItem select onselect 102 (AIR) MenuBuilder keyequivalent MenuBuilder altkey ctrlkey cmdkey shiftkey true Windows Ctrl Mac OS X Command false defaultkeyequivalentmodifiers XML keyequivalentmenu.xml <?xml version="1.0" encoding="utf-8"?> <root> <menuitem label="file"> <menuitem label="new" keyequivalent="n"/> <menuitem label="open" keyequivalent="o"/> <menuitem label="save" keyequivalent="s"/> <menuitem label="save As..." keyequivalent="s" shiftkey="true"/> <menuitem label="close" keyequivalent="w"/> </menuitem> <menuitem label="edit"> <menuitem label="cut" keyequivalent="x"/> <menuitem label="copy" keyequivalent="c"/> <menuitem label="paste" keyequivalent="v"/> </menuitem> </root> keyequivalentmenu.xml <html> <head> <title>xml-based menu with key equivalents example</title> <script type="text/javascript" src="airaliases.js"></script> <script type="text/javascript" src="airmenubuilder.js"></script> </head> <body> <script type="text/javascript"> // Create a NativeMenu from "keyequivalentmenu.xml" and set it // as the application/window menu var keyequivmenu = air.ui.menu.createfromxml("keyequivalentmenu.xml"); air.ui.menu.setasmenu(keyequivmenu); </script> </body> </html>

125 ADOBE AIR HTML 118 Adobe AIR (AIR) MenuBuilder label (_) MenuBuilder XML A <menuitem label="save _As"/> NativeMenu label XML mnemonicindex MenuBuilder Adobe AIR 1.0 NativeMenu NativeMenuItem MenuBuilder NativeMenu NativeMenuItem NativeMenu MenuBuilder NativeMenu NativeMenuItem 101 MenuBuilder select onselect XML MenuBuilder dosave() <menuitem label="save" onselect="dosave"/> XML onselect String JSON String JSON JSON Function onload JavaScript select Event null altkey cmdkey ctrlkey defaultkeyequivalentmodifiers enabled keyequivalent label mnemonicindex onselect

126 ADOBE AIR HTML 119 shiftkey toggled type NativeMenu XML <ul> <li> JSON <html> <head> <title>menu event handling example</title> <script type="text/javascript" src="airaliases.js"></script> <script type="text/javascript" src="airmenubuilder.js"></script> <script type="text/javascript" src="printobject.js"></script> <script type="text/javascript"> function filemenucommand(event, data) print("filemenucommand", event, data); function editmenucommand(event, data) print("editmenucommand", event, data); function moveitemup(event, data) print("moveitemup", event, data); function moveitemdown(event, data) print("moveitemdown", event, data); function print(command, event, data) var result = ""; result += "<h1>command: " + command + '</h1>'; result += "<p>" + printobject(event) + "</p>"; result += "<p>data:</p>"; result += "<ul>"; for (var s in data) result += "<li>" + s + ": " + printobject(data[s]) + "</li>"; result += "</ul>"; var o = document.getelementbyid("output"); o.innerhtml = result; </script> <style type="text/css"> #contextlist position: absolute; left: 0; top: 25px; bottom: 0; width: 100px; background: #eeeeee; #output position: absolute; left: 125px; top: 25px; right: 0; bottom: 0; </style> </head> <body> <div id="contextlist"> <ul>

127 ADOBE AIR HTML 120 <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ul> </div> <div id="output"> Choose menu commands. Information about the events displays here. </div> <script type="text/javascript"> var mainmenu = air.ui.menu.createfromxml("mainmenu.xml"); air.ui.menu.setasmenu(mainmenu); var listcontextmenu = air.ui.menu.createfromjson("listcontextmenu.js"); air.ui.menu.setascontextmenu(listcontextmenu, "contextlist") // clear the default context menu air.ui.menu.setascontextmenu(null); </script> </body> </html> mainmenu.xml <?xml version="1.0" encoding="utf-8"?> <root> <menuitem label="file"> <menuitem label="new" keyequivalent="n" onselect="filemenucommand"/> <menuitem label="open" keyequivalent="o" onselect="filemenucommand"/> <menuitem label="save" keyequivalent="s" onselect="filemenucommand"/> <menuitem label="save As..." keyequivalent="s" onselect="filemenucommand"/> <menuitem label="close" keyequivalent="w" onselect="filemenucommand"/> </menuitem> <menuitem label="edit"> <menuitem label="cut" keyequivalent="x" onselect="editmenucommand"/> <menuitem label="copy" keyequivalent="c" onselect="editmenucommand"/> <menuitem label="paste" keyequivalent="v" onselect="editmenucommand"/> </menuitem> </root> listcontextmenu.js [ ] label: "Move Item Up", onselect: "moveitemup", label: "Move Item Down", onselect: "moveitemdown" printobject.js printobject()

128 ADOBE AIR HTML 121 function printobject(obj) if (!obj) if (typeof obj == "undefined") return "[undefined]"; ; if (typeof obj == "object") return "[null]"; ; return "[false]"; else if (typeof obj == "boolean") return "[true]"; ; if (typeof obj == "object") if (typeof obj.length == "number") var ret = []; for (var i=0; i<obj.length; i++) ret.push(printobject(obj[i])); return ["[", ret.join(", "), "]"].join(" "); else var ret = []; var hadchildren = false; for (var k in obj) hadchildren = true; ret.push ([k, " => ", printobject(obj[k])]); if (hadchildren) return ["\n", ret.join(",\n"), "\n"].join(""); if (typeof obj == "function") return "[Function]"; return String(obj);

129 : AIR Adobe AIR 1.0 Mac OS X Adobe AIR NativeApplication.nativeApplication.icon flash.desktop.nativeapplication flash.desktop.dockicon flash.desktop.systemtrayicon Adobe AIR 1.0 AIR NativeApplication.nativeApplication.icon DockIcon SystemTrayIcon NativeApplication.supportsDockIcon NativeApplication.supportsSystemTrayIcon AIR InteractiveIcon InteractiveIcon width height bitmaps DockIcon SystemTrayIcon NativeApplication.nativeApplication.icon.bitmaps bitmaps AIR air.nativeapplication.nativeapplication.icon.bitmaps = [bmp16x16.bitmapdata, bmp128x128.bitmapdata]; bitmaps enterframe timer Windows Linux Mac OS X bitmaps air.nativeapplication.nativeapplication.icon.bitmaps = []; Adobe AIR 1.0 AIR NativeApplication.supportsDockIcon true NativeApplication.nativeApplication.icon AIR Mac OS X

130 ADOBE AIR HTML AIR 123 Adobe AIR 1.0 NativeMenu NativeApplication.nativeApplication.icon.menu Adobe AIR 1.0 NativeApplication.nativeApplication.icon.bounce() bounce() priority informational critical priority NotificationType Adobe AIR 1.0 NativeApplication invoke invoke Adobe AIR 1.0 NativeApplication.supportsSystemTrayIcon true AIR Windows Linux Windows Linux BitmapData bitmaps bitmaps bitmaps null Adobe AIR 1.0 NativeMenu NativeApplication.nativeApplication.icon.menu Adobe AIR 1.0 tooltip air.nativeapplication.nativeapplication.icon.tooltip = "Application name";

131 ADOBE AIR HTML AIR 124 Adobe AIR 1.0 NativeApplication.nativeApplication.icon SystemTrayIcon click mousedown mouseup rightclick rightmousedown rightmouseup ScreenMouseEvent Adobe AIR 1.0 AIR visible true Flex WindowedApplication WindowedApplication visible false <html> <head> <script src="airaliases.js" language="javascript" type="text/javascript"></script> <script language="javascript" type="text/javascript"> var iconloadcomplete = function(event) air.nativeapplication.nativeapplication.icon.bitmaps = [event.target.content.bitmapdata]; air.nativeapplication.nativeapplication.autoexit = false; var iconload = new air.loader(); var iconmenu = new air.nativemenu(); var exitcommand = iconmenu.additem(new air.nativemenuitem("exit")); exitcommand.addeventlistener(air.event.select,function(event) air.nativeapplication.nativeapplication.icon.bitmaps = []; air.nativeapplication.nativeapplication.exit(); ); if (air.nativeapplication.supportssystemtrayicon) air.nativeapplication.nativeapplication.autoexit = false; iconload.contentloaderinfo.addeventlistener(air.event.complete,iconloadcomplete); iconload.load(new air.urlrequest("icons/airapp_16.png")); air.nativeapplication.nativeapplication.icon.tooltip = "AIR application"; air.nativeapplication.nativeapplication.icon.menu = iconmenu; if (air.nativeapplication.supportsdockicon) iconload.contentloaderinfo.addeventlistener(air.event.complete,iconloadcomplete); iconload.load(new air.urlrequest("icons/airapp_128.png")); air.nativeapplication.nativeapplication.icon.menu = iconmenu; </script> </head> <body> </body> </html> icons AIRApp_16.png AIRApp_128.png AIR SDK

132 ADOBE AIR HTML AIR 125 Window Adobe AIR 1.0 Mac OS X Microsoft Windows Linux Adobe AIR 1.0 Mac OS X 123 Windows Linux NativeWindow notifyuser() type NotificationType.CRITICAL NotificationType.INFORMATIONAL Linux notifyuser() window.nativewindow.notifyuser(air.notificationtype.informational); NativeWindow.notifyUser() NativeWindow.supportsNotification Adobe AIR 1.0 Windows utility lightweight normal NativeApplication autoexit false <initalwindow> <visible>false</visible> visible true activate() NativeWindowInitOption type NativeWindowType.UTILITY NativeWindowType.LIGHTWEIGHT Mac OS X nativewindowdisplaystate visible false function preventminimize(event) if(event.afterdisplaystate == air.nativewindowdisplaystate.minimized) event.preventdefault(); event.target.visible = false; visible false Mac OS X

133 : Flash Player 9 Adobe AIR 1.0 Adobe AIR API flash.filesystem.file flash.filesystem.filestream AIR API Adobe AIR 1.0 Adobe AIR API FileMode FileStream API AIR Adobe AIR 1.0 AIR Adobe Developer Connection XML Adobe AIR flash.filesystem Adobe AIR runtime.flash.filesystem

134 ADOBE AIR HTML 127 File File FileMode FileStream File file FileMode FileStream open() openasync() filemode filemode FileStream FileStream File FileStream File File.copyTo() File.copyToAsync() File.deleteDirectory() File.deleteDirectoryAsync() File.deleteFile() File.deleteFileAsync() File.getDirectoryListing() File.getDirectoryListingAsync() File.moveTo() File.moveToAsync() File.moveToTrash() File.moveToTrashAsync() FileStream FileStream open() openasync() File FileStream addeventlistener() AIR File Adobe AIR 1.0 File File FileReference Adobe Flash Player AIR FileReference File Flash Player SWF File Adobe AIR 1.0 File

135 ADOBE AIR HTML 128 File FileStream File File File File Adobe AIR 1.0 File nativepath url Windows c:\sample directory\test.txt Mac OS /Sample directory/test.txt nativepath Windows (\) Mac OS Linux (/) file URL Windows file:///c:/sample%20directory/test.txt Mac OS file:///sample%20directory/test.txt file URL 134 AIR URL File Mac OS Windows Linux File.applicationStorageDirectory AIR File.applicationDirectory File.desktopDirectory File.documentsDirectory File.userDirectory File.documentsDirectory File.desktopDirectory File.userDirectory Mac Windows File.desktopDirectory resolvepath() preferences.xml var prefsfile:file = air.file.applicationstoragedirectory; prefsfile = prefsfile.resolvepath("preferences.xml"); File C:\Documents and Settings\joe\ Windows File File.documentsDirectory

136 ADOBE AIR HTML 129 Linux /opt/filename/share /home/username/.appdata/applicationid/local Store /home/username/desktop /home/username/documents /tmp/flashtmp.randomstring /home/username Mac /Applications/filename.app/Contents/Resources /Users/userName/Library/Preferences/applicationID/Local Store /Users/userName/Desktop /Users/userName/Documents /private/var/folders/jy/randomstring/temporaryitems/flashtmp /Users/userName Windows C:\Program Files\filename C:\Documents and settings\username\applicationdata\applicationid\local Store C:\Documents and settings\username\desktop C:\Documents and settings\username\my Documents C:\Documents and settings\username\local Settings\Temp\randomString.tmp C:\Documents and settings\username File AIR applicationid filename ID ID ID username File Adobe AIR 1.0 File Adobe AIR 1.0 File File AIR Test var file = air.file.userdirectory.resolvepath("air Test"); Adobe AIR 1.0 File File AIR Test

137 ADOBE AIR HTML 130 var file = air.file.documentsdirectory.resolvepath("air Test"); Adobe AIR 1.0 File File AIR Test var file = air.file.desktopdirectory.resolvepath("air Test"); Adobe AIR 1.0 File AIR File prefs.xml var file = air.file.applicationstoragedirectory; file = file.resolvepath("prefs.xml"); ID File.applicationStorage app-storage: URI Mac OS /Users/user name/library/preferences/applicationid/local Store/ /Users/babbage/Library/Preferences/com.example.TestApp/Local Store Windows Documents and Settings C:\Documents and Settings\user name\application Data\applicationID\Local Store\ C:\Documents and Settings\babbage\Application Data\com.example.TestApp\Local Store Linux /home/user name/.appdata/applicationid/local Store/ /home/babbage/.appdata/com.example.testapp/local Store ID ID File.applicationStorageDirectory File URL url app-storage URL 134 AIR URL var dir = air.file.applicationstoragedirectory; dir = dir.resolvepath("prefs.xml"); air.trace(dir.url); // app-storage:/preferences Adobe AIR 1.0 File File.applicationDirectory File images

138 ADOBE AIR HTML 131 var dir = air.file.applicationdirectory; dir = dir.resolvepath("images"); File.applicationDirectory File URL url app URL 134 AIR URL var dir = air.file.applicationdirectory; dir = dir.resolvepath("images"); air.trace(dir.url); // app:/images Adobe AIR 1.0 File.getRootDirectories() Windows C: Mac OS Linux / StorageVolumeInfo.getStorageVolumes() 142 Adobe AIR 1.0 File nativepath File Windows var file = new air.file(); file.nativepath = "C:\\AIR Test"; Windows File File.applicationStorageDirectory resolvepath() Adobe AIR 1.0 resolvepath() File AIR Test var file = air.file.userdirectory; file = file.resolvepath("air Test"); File url URL var urlstr = "file:///c:/air Test/"; var file = new air.file() file.url = urlstr; 133 Adobe AIR 1.0 File browsefordirectory() browsefordirectory() File select cancel

139 ADOBE AIR HTML 132 var file = new air.file(); file.addeventlistener(air.event.select, dirselected); file.browsefordirectory("select a directory"); function dirselected(event) alert(file.nativepath); Adobe AIR 1.0 InvokeEvent currentdirectory 255 File Adobe AIR 1.0 File Adobe AIR 1.0 C:/foo.txt Windows File File.applicationStorageDirectory resolvepath() 133 File url URL var urlstr = "file:///c:/air Test/test.txt"; var file = new air.file() file.url = urlstr; URL File() var urlstr = "file:///c:/air Test/test.txt"; var file = new air.file(urlstr); url URL URI %20 file.url = "file:///c:/air Test"; alert(file.url); // file:///c:/air%20test File nativepath Windows File C: AIR Test test.txt var file = new air.file(); file.nativepath = "C:/AIR Test/test.txt"; File() var file = new air.file("c:/air Test/test.txt"); (/) nativepath Windows (\) 133

140 ADOBE AIR HTML 133 Adobe AIR 1.0 File getdirectorylisting() File 138 Adobe AIR 1.0 File browseforopen() browseforsave() browseforopenmultiple() browseforsave() browseforopen() browseforsave() select browseforopen() browseforsave() File browseforopenmultiple() selectmultiple selectmultiple FileListEvent files File Open var filetoopen = air.file.documentsdirectory; selecttextfile(filetoopen); function selecttextfile(root) var txtfilter = new air.filefilter("text", "*.as;*.css;*.html;*.txt;*.xml"); root.browseforopen("open", new window.runtime.array(txtfilter)); root.addeventlistener(air.event.select, fileselected); function fileselected(event) trace(filetoopen.nativepath); Adobe AIR 1.0 resolvepath() nativepath url File Windows file1 = air.file.documentsdirectory; file1 = file1.resolvepath("air Test"); alert(file1.nativepath); // C:\Documents and Settings\userName\My Documents\AIR Test var file2 = air.file.documentsdirectory; file2 = file2.resolvepath(".."); alert(file2.nativepath); // C:\Documents and Settings\userName var file3 = air.file.documentsdirectory; file3.nativepath += "/subdirectory"; alert(file3.nativepath); // C:\Documents and Settings\userName\My Documents\subdirectory var file4 = new air.file(); file4.url = "file:///c:/air Test/test.txt"; alert(file4.nativepath); // C:\AIR Test\test.txt

141 ADOBE AIR HTML 134 nativepath (/) Windows (\) AIR URL Adobe AIR 1.0 AIR File url URL URL file file:///c:/air Test/test.txt URL file URL file://<host>/<path> <host> URL file URL (///) app application.xml images app:/images app-storage AIR settings prefs.xml app-storage:/settings/prefs.xml Adobe AIR 1.0 getrelativepath() var file1 = air.file.documentsdirectory file1 = file1.resolvepath("air Test"); var file2 = air.file.documentsdirectory file2 = file2.resolvepath("air Test/bob/test.txt"); alert(file1.getrelativepath(file2)); // bob/test.txt getrelativepath() usedotdot.. var file1 = air.file.documentsdirectory; file1 = file1.resolvepath("air Test"); var file2 = air.file.documentsdirectory; file2 = file2.resolvepath("air Test/bob/test.txt"); var file3 = air.file.documentsdirectory; file3 = file3.resolvepath("air Test/susan/test.txt"); alert(file2.getrelativepath(file1, true)); //../.. alert(file3.getrelativepath(file2, true)); //../../bob/test.txt Adobe AIR 1.0 Windows Mac OS File File.documentsDirectory.resolvePath("test.txt"); File.documentsDirectory.resolvePath("TeSt.TxT");

142 ADOBE AIR HTML 135 AIR Test var file = air.file.documentsdirectory; file = file.resolvepath("air test"); trace(file.nativepath); //... AIR test file.canonicalize(); alert(file.nativepath); //... AIR Test canonicalize() nativepath Linux canonicalize() Windows canonicalize() 8.3 var path = new air.file(); path.nativepath = "C:\\AIR~1"; path.canonicalize(); alert(path.nativepath); // C:\AIR Test Adobe AIR 1.0 Mac OS Mac OS Finder Mac OS Linux Windows Vista Windows NTFS File issymboliclink true File ispackage issymboliclink File var desktopnodes = air.file.desktopdirectory.getdirectorylisting(); for (i = 0; i < desktopnodes.length; i++) if (desktopnodes[i].isdirectory &&!!desktopnodes[i].ispackage) air.trace(desktopnodes[i].name); var desktopnodes = air.file.desktopdirectory.getdirectorylisting(); for (i = 0; i < desktopnodes.length; i++) if (!desktopnodes[i].issymboliclink) air.trace(desktopnodes[i].name); canonicalize()

143 ADOBE AIR HTML 136 var desktopnodes = air.file.desktopdirectory.getdirectorylisting(); for (i = 0; i < desktopnodes.length; i++) if (desktopnodes[i].issymboliclink) var linknode = desktopnodes[i]; linknode.canonicalize(); air.trace(desktopnodes[i].name); Adobe AIR 1.0 File spaceavailable File air.trace(air.file.applicationstoragedirectory.spaceavailable); File spaceavailable File spaceavailable File spaceavailable 0 File spaceavailable 143 StorageVolumeInfo.getStorageVolumes() 142 Adobe AIR 2 AIR 2 AIR File openwithdefaultapplication() test.doc var file = air.file.deskopdirectory; file = file.resolvepath("test.doc"); file.openwithdefaultapplication(); Linux MIME mp3 mp3 var file = air.file.documentsdirectory; var mp3filter = new air.filefilter("mp3 Files", "*.mp3"); file.browseforopen("open", [mp3filter]); file.addeventlistener(event.select, fileselected); function fileselected(event) file.openwithdefaultapplication(); openwithdefaultapplication()

144 ADOBE AIR HTML 137 AIR openwithdefaultapplication() Windows AIR EXE BAT Mac OS Linux AIR Mac OS Terminal AppletLauncher Linux csh bash ruby openwithdefaultapplication() File.openWithDefaultApplication() AIR Adobe AIR 1.0 File File.lineEnding File.separator File.systemCharset Mac OS Linux Windows Mac OS Linux (/) Windows (\) Capabilities Capabilities.hasIME Capabilities.language Capabilities.os (true) (IME) (false) IME Capabilities.os var separator:string; if (Capablities.os.indexOf("Mac") > -1) separator = "/"; else separator = "\\"; Linux File.separator Adobe AIR 1.0 File 129 File

145 ADOBE AIR HTML 138 Adobe AIR 1.0 File.createDirectory() AIR Test var dir = air.file.userdirectory.resolvepath("air Test"); dir.createdirectory(); createdirectory() FileStream FileStream() filemode FileMode.APPEND FileMode.WRITE FileStream 143 Adobe AIR 1.0 File createtempdirectory() var temp = air.file.createtempdirectory(); createtempdirectory() createtempfile() Adobe AIR 1.0 File getdirectorylisting() getdirectorylistingasync() File var directory = air.file.documentsdirectory; var contents = directory.getdirectorylisting(); for (i = 0; i < contents.length; i++) alert(contents[i].name, contents[i].size); directorylisting files File var directory = air.file.documentsdirectory; directory.getdirectorylistingasync(); directory.addeventlistener(air.filelistevent.directory_listing, dirlisthandler); function dirlisthandler(event) var contents = event.files; for (i = 0; i < contents.length; i++) alert(contents[i].name, contents[i].size);

146 ADOBE AIR HTML 139 Adobe AIR 1.0 var sourcedir = air.file.documentsdirectory.resolvepath("air Test"); var resultdir = air.file.documentsdirectory.resolvepath("air Test Copy"); sourcedir.copyto(resultdir); copyto() overwrite true copyto() newlocation 140 Adobe AIR 1.0 File deletedirectory() deletedirectoryasync() 126 AIR deletedirectorycontents true false AIR Test var directory = air.file.documentsdirectory.resolvepath("air Test"); directory.deletedirectory(true); AIR Test var directory = air.file.documentsdirectory.resolvepath("air Test"); directory.addeventlistener(air.event.complete, completehandler) directory.deletedirectoryasync(true); function completehandler(event) alert("deleted.") movetotrash() movetotrashasync() 141 Adobe AIR 1.0 AIR API 60 AIR AIR 261 Adobe AIR 1.0 File File

147 ADOBE AIR HTML 140 File creationdate creator downloaded extension Macintosh Mac OS X Mac OS AIR 2 Internet Windows XP Service Pack 2 Windows Vista Mac OS 10.5 exists extension icon isdirectory modificationdate name nativepath parent size type url. extension null Icon File 128 File File File null extension Macintosh Mac OS X Mac OS URL 128 File HTML Adobe AIR API File Adobe AIR 1.0 File copyto() copytoasync() File moveto() movetoasync() copyto() moveto() copytoasync() movetoasync() 126 AIR File test.txt AIR Test copy.txt var original = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var newfile = air.file.documentsdirectory.resolvepath("air Test/copy.txt"); original.copyto(newfile, true); copyto() overwrite true overwrite true false IOErrorEvent

148 ADOBE AIR HTML 141 addeventlistener() var original = air.file.documentsdirectory; original = original.resolvepath("air Test/test.txt"); var destination = air.file.documentsdirectory; destination = destination.resolvepath("air Test 2/copy.txt"); original.addeventlistener(air.event.complete, filemovecompletehandler); original.addeventlistener(air.ioerrorevent.io_error, filemoveioerroreventhandler); original.movetoasync(destination); function filemovecompletehandler(event) alert(event.target); // [object File] function filemoveioerroreventhandler(event) alert("i/o Error."); File File.moveToTrash() File.moveToTrashAsync() Adobe AIR 1.0 File deletefile() deletefileasync() 126 AIR test.txt var file = air.file.documentsdirectory.resolvepath("test.txt"); file.deletefile(); test.txt var file = air.file.documentsdirectory.resolvepath("test.txt"); file.addeventlistener(air.event.complete, completehandler) file.deletefileasync(); function completehandler(event) alert("deleted.") movetotrash() movetotrashasync 141 Adobe AIR 1.0 File movetotrash() movetotrashasync() 126 AIR test.txt var file = air.file.documentsdirectory.resolvepath("test.txt"); file.movetotrash();

149 ADOBE AIR HTML 142 Adobe AIR 1.0 File createtempfile() var temp = air.file.createtempfile(); createtempfile() createtempdirectory() Adobe AIR 2 AIR 2 StorageVolumeInfo storagevolumeinfo StorageVolumeInfo.storageVolumeInfo storagevolumemount storagevolumeunmount StorageVolumeChangeEvent Linux StorageVolumeInfo storagevolumemount storagevolumeunmount StorageVolumeChangeEvent storagevolume StorageVolume StorageVolume drive Windows null filesystemtype FAT NTFS HFS UFS isremoveable true false iswritable (true) (false) name rootdirectory File StorageVolumeChangeEvent rootdirectory rootdirectory File StorageVolumeChangeEvent storagevolume (null) rootdirectory air.storagevolumeinfo.storagevolumeinfo.addeventlistener(air.storagevolumechangeevent.storage_volume_moun T, onvolumemount); function onvolumemount(event) air.trace(event.storagevolume.name, event.rootdirectory.nativepath); air.storagevolumeinfo.storagevolumeinfo.addeventlistener(air.storagevolumechangeevent.storage_volume_unmo UNT, onvolumeunmount); function onvolumeunmount(event) air.trace(event.rootdirectory.nativepath);

150 ADOBE AIR HTML 143 StorageVolumeInfo.storageVolumeInfo getstoragevolumes() StorageVolume var volumes = air.storagevolumeinfo.storagevolumeinfo.getstoragevolumes(); for (i = 0; i < volumes.length; i++) air.trace(volumes[i].name, volumes[i].rootdirectory.nativepath); Linux getstoragevolumes() File.getRootDirectories() 131 StorageVolume StorageVolumeInfo.getStorageVolumes() StorageVolume rootdirectory spaceavailable 136 StorageVolume StorageVolumeInfo Adobe AIR 1.0 FileStream AIR Adobe AIR 1.0 File File var file = air.file.documentsdirectory; file = file.resolvepath("air Test/testFile.txt"); File File.documentsDirectory resolvepath() File File 132 File FileStream FileStream open() openasync() File file filemode FileMode FileStream var filestream = new air.filestream(); filestream.open(file, air.filemode.write); 145 FileStream 144 FileStream

151 ADOBE AIR HTML 144 openasync() FileStream FileStream I/O 148 FileStream FileStream read write UTF readutfbytes() writeutfbytes() readbyte() readbytes() writebyte() writebytes() FileStream bytesavailable File spaceavailable 136 FileStream close() close() 145 FileStream FileStream Adobe AIR XML XML FileStream Adobe AIR 1.0 FileStream FileStream Adobe AIR 1.0 FileStream open() openasync() filemode open() openasync() filemode

152 ADOBE AIR HTML 145 FileMode.READ FileMode.WRITE FileMode.APPEND FileMode.UPDATE FileStream / FileStream Adobe AIR 1.0 FileStream File FileStream open() openasync() FileStream var myfile = air.file.documentsdirectory; myfile = myfile.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.open(myfile, air.filemode.read); filemode open() openasync() read write append update 144 FileStream openasync() var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.addeventlistener(air.event.complete, completehandler); myfilestream.addeventlistener(air.progressevent.progress, progresshandler); myfilestream.addeventlistener(air.ioerrorevent.ioerror, errorhandler); myfilestream.open(myfile, air.filemode.read); function completehandler(event) //... function progresshandler(event) //... function errorhandler(event) //... open() openasync() 126 AIR FileStream filemode FileMode.READ FileMode.UPDATE FileStream 147 FileStream bytesavailable FileStream close()

153 ADOBE AIR HTML 146 FileStream position Adobe AIR 1.0 FileStream position position 8 "hello" UTF var myfile = air.file.documentsdirectory; myfile = myfile.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.open(myfile, air.filemode.update); myfilestream.position = 8; myfilestream.writeutfbytes("hello"); FileStream position 0 position 0 position position FileStream position position var myfile = air.file.documentsdirectory; myfile = myfile.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.open(myfile, air.filemode.update); myfilestream.position = 4000; alert(myfilestream.position); // 4000 myfilestream.writebytes(mybytearray, 0, 200); alert(myfilestream.position); // 4200 append FileStream position append position var myfile = air.file.documentsdirectory; myfile = myfile.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.openasync(myfile, air.filemode.write); myfilestream.writeutfbytes("hello"); myfilestream.writeutfbytes("world"); myfilestream.addeventlistener(air.event.close, closehandler); myfilestream.close(); air.trace("started."); closehandler(event) air.trace("finished.");

154 ADOBE AIR HTML 147 started. finished. position writebytes() position position (300) var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.openasync(myfile, air.filemode.update); myfilestream.position = 4000; air.trace(myfilestream.position); // 4000 myfilestream.writebytes(mybytearray, 0, 200); myfilestream.position = 300; air.trace(myfilestream.position); // 300 FileStream bytesavailable Adobe AIR 1.0 FileStream open() openasync() filemode READ UPDATE FileStream FileStream open() openasync() open() position 100 var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.open(myfile, air.filemode.read); myfilestream.position = 10; myfilestream.readbytes(mybytearray, 0, 20); myfilestream.position = 89; myfilestream.readbytes(mybytearray, 0, 10); bytesavalable progress position bytesavailable position position bytesavailable bytesavailable position FileStream progress FileStream progress ByteArray bytes var bytes = new air.bytearray(); var myfile = new air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.addeventlistener(air.progressevent.progress, progresshandler); myfilestream.openasync(myfile, air.filemode.read); function progresshandler(event) myfilestream.readbytes(bytes, myfilestream.position, myfilestream.bytesavailable);

155 ADOBE AIR HTML 148 var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.addeventlistener(air.progressevent.progress, progresshandler); myfilestream.addeventlistener(air.event.complete, completed); myfilestream.openasync(myfile, air.filemode.read); myfilestream.position = 4000; var str = ""; function progresshandler(event) if (myfilestream.bytesavailable > 8000 ) str += myfilestream.readmultibyte(8000, "iso "); FileStream FileStream FileStream position position position FileStream Adobe AIR 1.0 openasync() ActionScript FileStream progress, var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.addeventlistener(air.progressevent.progress, progresshandler); myfilestream.openasync(myfile, air.filemode.read); var str = ""; function progresshandler(event) str += myfilestream.readmultibyte(myfilestream.bytesavailable, "iso "); complete var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.addeventlistener(air.event.complete, completed); myfilestream.openasync(myfile, air.filemode.read); var str = ""; function completehandler(event) str = myfilestream.readmultibyte(myfilestream.bytesavailable, "iso "); FileStream OutputProgressEvent OutputProgressEvent bytespending outputprogress close() FileStream close

156 ADOBE AIR HTML 149 Adobe AIR 1.0 ActionScript ByteArray bytes ByteArray var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.addeventlistener(air.event.complete, completehandler); myfilestream.openasync(myfile, air.filemode.read); var bytes = new air.bytearray(); function completehandler(event) myfilestream.readbytes(bytes, 0, myfilestream.bytesavailable); bytes ByteArray var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.open(myfile, air.filemode.write); myfilestream.writebytes(bytes, 0, bytes.length); ActionScript ByteArray String FileStream ByteArray readmultibyte() var myfile = air.file.documentsdirectory.resolvepath("air Test/test.txt"); var myfilestream = new air.filestream(); myfilestream.addeventlistener(air.event.complete, completed); myfilestream.openasync(myfile, air.filemode.read); var str = ""; function completehandler(event) str = myfilestream.readmultibyte(myfilestream.bytesavailable, "iso "); readmultibyte() ActionScript iso Adobe AIR FileStream readutfbytes() UTF-8 UTF- 8 progress readutfbytes() readmultibyte() FileStream complete writemultibyte() writeutfbytes() String readutf() writeutf() readutfbytes() writeutfbytes() UTF UTF-BOM UTF-16 UTF XML XML readobject() writeobject() ActionScript AMF (ActionScript Message Format) Adobe AIR Flash Player Flash Media Server Flex Data Services API

157 ADOBE AIR HTML 150 readdouble() writedouble() MP3 MP3 MP3 ID3 ID3 ID ActionScript load() save() Flash Player 10 Adobe AIR 1.5 Flash Player 10 FileReference load() save() AIR 1.5 File FileReference Flash Player AIR var file = air.file.applicationstoragedirectory.resolvepath("test.txt"); var str = "Hello."; file.addeventlistener(air.event.complete, filesaved); file.save(str); function filesaved(event) air.trace("done."); save() data String ByteArray String UTF-8 UTF-8 var file = air.file.applicationstoragedirectory.resolvepath("test.txt"); file.addeventlistener(air.event.complete, loaded); file.load(); var str; function loaded(event) var bytes = file.data; str = bytes.readutfbytes(bytes.length); air.trace(str); FileStream load() save() FileStream FileStream FileStream FileStream open() openasync() filemode FileStream FileStream

158 ADOBE AIR HTML 151 XML XML Adobe AIR 1.0 XML File FileStream FileStream readutfbytes() XML var file = air.file.documentsdirectory.resolvepath("air Test/preferences.xml"); var filestream = new air.filestream(); filestream.open(file, air.filemode.read); var prefsxml = filestream.readutfbytes(filestream.bytesavailable); filestream.close(); File FileStream FileStream XML var file = air.file.documentsdirectory.resolvepath("air Test/preferences.xml"); filestream = new air.filestream(); filestream.open(file, air.filemode.write); var outputstring = '<?xml version="1.0" encoding="utf-8"?>\n'; outputstring += '<prefs><autosave>true</autosave></prefs>' filestream.writeutfbytes(outputstring); filestream.close(); readutfbytes() writeutfbytes() UTF FileStream XML var file = air.file.documentsdirectory.resolvepath("air Test/preferences.xml"); var filestream= new air.filestream(); filestream.addeventlistener(air.event.complete, processxmldata); filestream.openasync(file, air.filemode.read); var prefsxml; function processxmldata(event) var xmlstring = filestream.readutfbytes(filestream.bytesavailable); prefsxml = domparser.parsefromstring(xmlstring, "text/xml"); filestream.close(); FileStream complete processxmldata() readutfbytes() XML prefsxml XML XML Adobe AIR 1.0 MP3 ID3 ID3 ID3 ID3 1.0 MP3

159 ADOBE AIR HTML 152 ID3 1 MP3 128 ID3 / FileMode.UPDATE open() openasync() filemode var file = air.file.documentsdirectory.resolvepath("my Music/Sample ID3 v1.mp3"); var filestr = new air.filestream(); filestr.open(file, air.filemode.update); position 128 filestr.position = file.size - 128; position ID3 1.0 ID "TAG" 30 MP ISO complete id3tagread() function id3tagread() if (filestr.readmultibyte(3, "iso ").match(/tag/i)) var id3title = filestr.readmultibyte(30, "iso "); var id3artist = filestr.readmultibyte(30, "iso "); var id3album = filestr.readmultibyte(30, "iso "); var id3year = filestr.readmultibyte(4, "iso "); var id3comment = filestr.readmultibyte(30, "iso "); var id3genrecode = filestr.readbyte().tostring(10); id3title String newtitle filestr.position = file.length - 125; // filestr.writemultibyte(newtitle, "iso "); ID3 1 newtitle 30 0 (String.fromCharCode(0))

160 : AIR Adobe AIR 1.0 Adobe AIR API API HTML URL HTML Adobe AIR 1.0 HTML HTMLLoader HTML HTML HTML API HTML DOM HTML HTMLLoader AIR NativeDragEvent NativeDragManager API HTML API HTML DOM NativeDragEvent NativeDragManager API HTML HTML Adobe AIR API Adobe ActionScript 3.0 Adobe Flash Platform ActionScript 3.0 Adobe AIR 1.0 HTML URL preventdefault() WebKit CSS -webkit-user-select HTML -webkit-user-select none -webkit-user-drag CSS 13 AIR CSS

161 ADOBE AIR HTML AIR 154 HTML Adobe AIR 1.0 dragstart drag dragend preventdefault() effectallowed datatransfer dragover dragenter datatransfer.dropeffect dragenter datatransfer dragover dragenter dragover dragleave drop (clientx, clienty) (screenx, screeny) datatransfer datatransfer effectallowed dropeffect dragstart 155 HTML dragover dragenter dropeffect AIR dropeffect dropeffect dragover dragenter dragend dropeffect dropeffect none getdata(mimetype) datatransfer MIME mimetype drop getdata()

162 ADOBE AIR HTML AIR 155 setdata(mimetype) mimetype datatransfer MIME setdata() datatransfer dragstart setdata() cleardata(mimetype) setdragimage(image, offsetx, offsety) mimetype dragstart HTML -webkit-user-drag CSS element setdragimage() image JavaScript Image HTML MIME Adobe AIR 1.0 HTML datatransfer MIME HTML URL MIME "text/plain" "text/html" "text/uri-list" "image/x-vnd.adobe.air.bitmap" "application/x-vnd.adobe.air.file-list" MIME datatransfer File 159 HTML HTML Adobe AIR 1.0 dragstart datatransfer.effectallowed "none" "copy" "link" "move" "copylink" "copymove" "linkmove" "all" All

163 ADOBE AIR HTML AIR 156 datatransfer.dropeffect dragover dragenter dropeffect function dodragstart(event) event.datatransfer.setdata("text/plain","text to drag"); event.datatransfer.effectallowed = "copymove"; function dodragover(event) event.datatransfer.dropeffect = "copy"; function dodragenter(event) event.datatransfer.dropeffect = "copy"; dragenter dropeffect dragover dropeffect HTML Adobe AIR 1.0 HTML CSS -webkit-user-select -webkit-user-drag dragstart datatransfer setdata() dragstart datatransfer.effectallowed "copylink" Flash Player 9 Adobe AIR 1.0 datatransfer dragstart datatransfer.setdata() MIME ID imageofgeorge dragstart George function dragstarthandler(event) event.datatransfer.effectallowed = "copy"; var dragimage = document.getelementbyid("imageofgeorge"); var dragfile = new air.file(dragimage.src); event.datatransfer.setdata("text/plain","a picture of George"); event.datatransfer.setdata("image/x-vnd.adobe.air.bitmap", dragimage); event.datatransfer.setdata("application/x-vnd.adobe.air.file-list", new Array(dragFile)); datatransfer setdata()

164 ADOBE AIR HTML AIR 157 HTML Adobe AIR 1.0 contenteditable designmode "on" dragenter dragover drop Adobe AIR 1.0 HTML dragenter dragover preventdefault() Adobe AIR 1.0 ondrop function dodrop(event) droppedtext = event.datatransfer.getdata("text/plain"); datatransfer.getdata() MIME datatransfer types types MIME dragenter dragover API HTML Adobe AIR 1.0 div dragenter dragover preventdefault() drop HTML

165 ADOBE AIR HTML AIR 158 <html> <head> <title>drag-and-drop</title> <script language="javascript" type="text/javascript" src="airaliases.js"></script> <script language="javascript"> function init() var target = document.getelementbyid('target'); target.addeventlistener("dragenter", dragenteroverhandler); target.addeventlistener("dragover", dragenteroverhandler); target.addeventlistener("drop", drophandler); var source = document.getelementbyid('source'); source.addeventlistener("dragstart", dragstarthandler); source.addeventlistener("dragend", dragendhandler); emptyrow = document.getelementbyid("emptytargetrow"); function dragstarthandler(event) event.datatransfer.effectallowed = "copy"; function dragendhandler(event) air.trace(event.type + ": " + event.datatransfer.dropeffect); function dragenteroverhandler(event) event.preventdefault(); var emptyrow; function drophandler(event) for(var prop in event) air.trace(prop + " = " + event[prop]); var row = document.createelement('tr'); row.innerhtml = "<td>" + event.datatransfer.getdata("text/plain") + "</td>" + "<td>" + event.datatransfer.getdata("text/html") + "</td>" + "<td>" + event.datatransfer.getdata("text/uri-list") + "</td>" + "<td>" + event.datatransfer.getdata("application/x-vnd.adobe.air.file-list") + "</td>"; var imagecell = document.createelement('td'); if((event.datatransfer.types.tostring()).search("image/x-vnd.adobe.air.bitmap") > -1) imagecell.appendchild(event.datatransfer.getdata("image/x-vnd.adobe.air.bitmap")); row.appendchild(imagecell); var parent = emptyrow.parentnode; parent.insertbefore(row, emptyrow); </script> </head> <body onload="init()" style="padding:5px"> <div> <h1>source</h1> <p>items to drag:</p> <ul id="source"> <li>plain text.</li> <li>html <b>formatted</b> text.</li> <li>a <a href=" <li><img src="icons/airapp_16.png" alt="an image"/></li> <li style="-webkit-user-drag:none;">

166 ADOBE AIR HTML AIR 159 Uses "-webkit-user-drag:none" style. </li> <li style="-webkit-user-select:none;"> Uses "-webkit-user-select:none" style. </li> </ul> </div> <div id="target" style="border-style:dashed;"> <h1 >Target</h1> <p>drag items from the source list (or elsewhere).</p> <table id="displaytable" border="1"> <tr><th>plain text</th><th>html text</th><th>url</th><th>file list</th><th>bitmap Data</th></tr> <tr id="emptytargetrow"><td> </td><td> </td><td> </td><td> </td><td> </td></tr> </table> </div> </div> </body> </html> HTML Adobe AIR 1.0 AIR File File HTMLLoader AIR nativedragdrop HTMLLoader AIR HTML HTML window.htmlloader HTMLLoader window.htmlloader.addeventlistener("nativedragdrop",function(event) var filelist = event.clipboard.getdata(air.clipboardformats.file_list_format); air.trace(filelist[0].url); ); NativeDragEvent HTML HTML datatransfer ActionScript clipboard Adobe ActionScript 3.0 Adobe Flash Platform ActionScript 3.0 ( HTMLLoader nativedragdrop URL

167 ADOBE AIR HTML AIR 160 <html> <head> <title>drag-and-drop in a remote sandbox</title> <script language="javascript" type="text/javascript" src="airaliases.js"></script> <script language="javascript"> window.htmlloader.addeventlistener("nativedragdrop",function(event) var filelist = event.clipboard.getdata(air.clipboardformats.file_list_format); air.trace(filelist[0].url); ); </script> </head> <body> <iframe src="child.html" sandboxroot=" documentroot="app:/" frameborder="0" width="100%" height="100%"> </iframe> </body> </html> HTML dragenter dragover Event preventdefault() <html> <head> <title>drag and drop target</title> <script language="javascript" type="text/javascript"> function preventdefault(event) event.preventdefault(); </script> </head> <body ondragenter="preventdefault(event)" ondragover="preventdefault(event)"> <div> <h1>drop Files Here</h1> </div> </body> </html> Adobe AIR 2 AIR URL AIR URLFilePromise URL aircore URLFilePromise AIR 2 SDK SDK frameworks/libs/air aircore.swc aircore.swf IFilePromise flash.desktop

168 ADOBE AIR HTML AIR 161 AIR AIR Clipboard.supportsFilePromise (Clipboard.generalClipboard) flash.desktop.ifilepromise air.desktop.urlfilepromise Adobe AIR 2 URLFilePromise URL FILE_PROMISE_LIST bar.txt <html> <head> <script src="airaliases.js"></script> <script src="aircore.swf" type="application/x-shockwave-flash"></script> <script language="javascript"> function init() var source = document.getelementbyid('source'); source.addeventlistener("dragstart", dragstarthandler); function dragstarthandler(event) event.preventdefault(); startdrag(); function startdrag() var filepromise = new air.urlfilepromise(); //defined in aircore.swf filepromise.request = new air.urlrequest(" filepromise.relativepath = "bar.txt"; var filelist = new Array( filepromise ); var clipboard = new air.clipboard(); clipboard.setdata( air.clipboardformats.file_promise_list_format, filelist ); air.nativedragmanager.dodrag( window.htmlloader, clipboard ); </script> </head> <body onload="init()"> <p id="source" style="-webkit-user-drag:element; -webkit-user-select:none;"> Drag to file system </p> </body> </html> relativepath

169 ADOBE AIR HTML AIR 162 HTML article.html images <html> <head> <script src="airaliases.js"></script> <script src="aircore.swf" type="application/x-shockwave-flash"></script> <script language="javascript"> function init() var source = document.getelementbyid('source'); source.addeventlistener("dragstart", dragstarthandler); function dragstarthandler(event) event.preventdefault(); startdrag(); function startdrag() var filepromise = new air.urlfilepromise(); filepromise.request = new air.urlrequest(" filepromise.relativepath = "article.html"; var image1promise = new air.urlfilepromise(); image1promise.request = new air.urlrequest(" image1promise.relativepath = "images/img_1.html"; var image2promise = new air.urlfilepromise(); image2promise.request = new air.urlrequest(" image2promise.relativepath = "images/img_2.jpg"; //Put the promise objects onto the clipboard inside an array var filelist = new Array( filepromise, image1promise, image2promise ); var clipboard = new air.clipboard(); clipboard.setdata( air.clipboardformats.file_promise_list_format, filelist ); air.nativedragmanager.dodrag( window.htmlloader, clipboard ); </script> </head> <body onload="init()"> <p id="source" style="-webkit-user-drag:element; -webkit-user-select:none;"> Drag to file system </p> </body> </html> IFilePromise Adobe AIR 2 URLFilePromise IFilePromise IFilePromise AIR JavaScript ActionScript ActionScript SWF <script> HTML JavaScript IFilePromise AIR AIR IDataInput IFilePromise URLFilePromise URLStream

170 ADOBE AIR HTML AIR 163 AIR IFilePromise isasync IEventDispatcher open progress complete ByteArray FileStream Socket URLStream IFilePromise open():idatainput IDataInput IEventDispatcher 164 get relativepath():string File.separator setter get isasync():boolean AIR close():void reporterror( e:errorevent ):void IFilePromise Adobe AIR 2 IFilePromise ByteArray FileStream ByteArray open() package import flash.desktop.ifilepromise; import flash.events.errorevent; import flash.utils.bytearray; import flash.utils.idatainput; public class SynchronousFilePromise implements IFilePromise private const filesize:int = 5000; //size of file data private var filepath:string = "SynchronousFile.txt"; public function get relativepath():string return filepath; public function get isasync():boolean return false; public function open():idatainput

171 ADOBE AIR HTML AIR 164 var filecontents:bytearray = new ByteArray(); //Create some arbitrary data for the file for( var i:int = 0; i < filesize; i++ ) filecontents.writeutfbytes( 'S' ); //Important: the ByteArray is read from the current position filecontents.position = 0; return filecontents; public function close():void //Nothing needs to be closed in this case. public function reporterror(e:errorevent):void trace("something went wrong: " + e.errorid + " - " + e.type + ", " + e.text ); UI Adobe AIR 2 IFilePromise isasync true open() IEventDispatcher progress FileStream URLStream socketdata Socket Event.OPEN ProgressEvent.PROGRESS ProgressEvent.SOCKET_DATA socketdata Socket progress Event.COMPLETE Event.CLOSE close complete IOErrorEvent.IOERROR IFilePromise close() SecurityErrorEvent.SECURITY_ERROR IFilePromise close() HTTPStatusEvent.HTTP_STATUS httpresponsestatus 404 HTTP HTTPStatusEvent.HTTP_RESPONSE_STATUS httpstatus HTTP

172 ADOBE AIR HTML AIR open 2 progress socketdata 3 complete close FileStream Socket URLStream ByteArray IDataInput IEventDispatcher timer progress complete package import flash.events.event; import flash.events.eventdispatcher; import flash.events.ieventdispatcher; import flash.events.progressevent; import flash.events.timerevent; import flash.utils.bytearray; import flash.utils.timer; [Event(name="open", type="flash.events.event.open")] [Event(name="complete", type="flash.events.event.complete")] [Event(name="progress", type="flash.events.progressevent")] [Event(name="ioError", type="flash.events.ioerrorevent")] [Event(name="securityError", type="flash.events.securityerrorevent")] public class AsyncDataProvider extends ByteArray implements IEventDispatcher private var dispatcher:eventdispatcher = new EventDispatcher(); public var filesize:int = 0; //The number of characters in the file private const chunksize:int = 1000; //Amount of data written per event private var dispatchdatatimer:timer = new Timer( 100 ); private var opened:boolean = false; public function AsyncDataProvider() super(); dispatchdatatimer.addeventlistener( TimerEvent.TIMER, generatedata ); public function begin():void dispatchdatatimer.start(); public function end():void dispatchdatatimer.stop(); private function generatedata( event:event ):void if(!opened ) var open:event = new Event( Event.OPEN ); dispatchevent( open ); opened = true; else if( position + chunksize < filesize ) for( var i:int = 0; i <= chunksize; i++ )

173 ADOBE AIR HTML AIR 166 writeutfbytes( 'A' ); //Set position back to the start of the new data this.position -= chunksize; var progress:progressevent = new ProgressEvent( ProgressEvent.PROGRESS, false, false, bytesavailable, bytesavailable + chunksize); dispatchevent( progress ) else var complete:event = new Event( Event.COMPLETE ); dispatchevent( complete ); //IEventDispatcher implementation public function addeventlistener(type:string, listener:function, usecapture:boolean=false, priority:int=0, useweakreference:boolean=false):void dispatcher.addeventlistener( type, listener, usecapture, priority, useweakreference ); public function removeeventlistener(type:string, listener:function, usecapture:boolean=false):void dispatcher.removeeventlistener( type, listener, usecapture ); public function dispatchevent(event:event):boolean return dispatcher.dispatchevent( event ); public function haseventlistener(type:string):boolean return dispatcher.haseventlistener( type ); public function willtrigger(type:string):boolean return dispatcher.willtrigger( type ); AsyncDataProvider ByteArray EventDispatcher IEventDispatcher EventDispatcher IEventDispatcher EventDispatcher IDataInput IFilePromise isasync true open()

174 ADOBE AIR HTML AIR 167 package import flash.desktop.ifilepromise; import flash.events.errorevent; import flash.events.eventdispatcher; import flash.utils.idatainput; public class AsynchronousFilePromise extends EventDispatcher implements IFilePromise private var filegenerator:asyncdataprovider; private const filesize:int = 5000; //size of file data private var filepath:string = "AsynchronousFile.txt"; public function get relativepath():string return filepath; public function get isasync():boolean return true; public function open():idatainput filegenerator = new AsyncDataProvider(); filegenerator.filesize = filesize; filegenerator.begin(); return filegenerator; public function close():void filegenerator.end(); public function reporterror(e:errorevent):void trace("something went wrong: " + e.errorid + " - " + e.type + ", " + e.text );

175 : Flash Player 10 Adobe AIR 1.0 API Adobe Flash Player Adobe AIR HTML RTF AIR AIR URL AIR Flash Player 10 Adobe AIR 1.0 API flash.desktop Clipboard ClipboardFormats ClipboardTransferMode Clipboard.generalClipboard Clipboard Clipboard HTMLLoader AIR TextField Clipboard Bitmap Flash Player 10 Adobe AIR 1.0 Clipboard.generalClipboard getdata()

176 ADOBE AIR HTML 169 import flash.desktop.clipboard; import flash.desktop.clipboardformats; if(clipboard.generalclipboard.hasformat(clipboardformats.text_format)) var text:string = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT); Flash Player AIR paste getdata() AIR paste getdata() Clipboard.generalClipboard import flash.desktop.clipboard; import flash.desktop.clipboardformats; var texttocopy:string = "Copy to clipboard."; Clipboard.generalClipboard.clear(); Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, texttocopy, false); Flash Player AIR copy cut setdata() AIR setdata() AIR HTML Adobe AIR 1.0 Adobe AIR HTML AIR Clipboard.generalClipboard JavaScript HTML copy cut paste clipboarddata Adobe AIR 1.0 AIR AIR preventdefault() clipboarddata Adobe AIR 1.0 clipboarddata clipboarddata setdata() MIME function customcopy(event) event.clipboarddata.setdata("text/plain", "A copied string.");

177 ADOBE AIR HTML 170 clipboarddata getdata() MIME types function custompaste(event) var pasteddata = event.clipboarddata("text/plain"); paste getdata() types HTML copy HTML cut paste HTML <html> <head> <title>copy and Paste</title> <script language="javascript" type="text/javascript"> function oncopy(event) var selection = window.getselection(); event.clipboarddata.setdata("text/html","<i>" + selection + "</i>"); event.preventdefault(); function oncut(event) var selection = window.getselection(); event.clipboarddata.setdata("text/html","<i>" + selection + "</i>"); var range = selection.getrangeat(0); range.extractcontents(); event.preventdefault(); function onpaste(event) var insertion = document.createelement("b"); insertion.innerhtml = event.clipboarddata.getdata("text/html"); var selection = window.getselection(); var range = selection.getrangeat(0); range.insertnode(insertion); event.preventdefault(); </script> </head> <body oncopy="oncopy(event)" onpaste="onpaste(event)" oncut="oncut(event)"> <p>sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p> </body> </html>

178 ADOBE AIR HTML 171 Flash Player 10 Adobe AIR 1.0 Clipboard Flash Player AIR ActionScript ActionScript Clipboard Sprite Clipboard Flash Player AIR PNG Sprite Flash Player 10 Adobe AIR 1.0 ClipboardFormats TEXT_FORMAT HTML_FORMAT RICH_TEXT_FORMAT BITMAP_FORMAT FILE_LIST_FORMAT URL_FORMAT ActionScript String HTML RTF ActionScript ByteArray RTF AIR ActionScript BitmapData AIR ActionScript File AIR URL ActionScript String HTML AIR copy cut paste MIME ClipboardFormat MIME MIME URL "text/plain" "text/uri-list" "image/x-vnd.adobe.air.bitmap" "application/x-vnd.adobe.air.file-list" HTML paste clipboarddata RTF Flash Player 10 Adobe AIR 1.0

179 ADOBE AIR HTML 172 Clipboard Clipboard.setData() true Flash Player 10 Adobe AIR 1.0 ClipboardTransferModes.ORIGINAL_ONLY ClipboardTransferModes.ORIGINAL_PREFFERE D ClipboardTransferModes.CLONE_ONLY ClipboardTransferModes.CLONE_PREFFERED null null Flash Player 10 Adobe AIR 1.0 air: flash: public function createclipboardobject(object:object):clipboard var transfer:clipboard = Clipboard.generalClipboard; transfer.setdata("object", object, true); function createclipboardobject(object) var transfer = new air.clipboard(); transfer.setdata("object", object, true); Clipboard CLONE_ONLY CLONE_PREFFERED var transfer:object = clipboard.getdata("object", ClipboardTransferMode.CLONE_ONLY); var transfer = clipboard.getdata("object", air.clipboardtransfermode.clone_only); Clipboard Clipboard ORIGINAL_ONLY ORIGINAL_PREFFERED var transferredobject:object = clipboard.getdata("object", ClipboardTransferMode.ORIGINAL_ONLY); var transferredobject = clipboard.getdata("object", air.clipboardtransfermode.original_only); Clipboard ORIGINAL_PREFFERED

180 ADOBE AIR HTML 173 Flash Player 10 Adobe AIR 1.0 setdatahandler() Clipboard setdatahandler(clipboardformat.text_format, writetext) writetext() setdata() Clipboard Mac OS X Flash Player 10 Adobe AIR 1.0 Copy setdatahandler() renderdata() renderdata() renderdata() Paste Paste Paste Flash package import flash.desktop.clipboard; import flash.desktop.clipboardformats; import flash.desktop.clipboardtransfermode; import flash.display.sprite; import flash.text.textfield; import flash.text.textformat; import flash.text.textfieldtype; import flash.events.mouseevent; import flash.events.event; public class DeferredRenderingExample extends Sprite private var sourcetextfield:textfield; private var destination:textfield; private var copytext:textfield; public function DeferredRenderingExample():void sourcetextfield = createtextfield(10, 10, 380, 90); sourcetextfield.text = "Neque porro quisquam est qui dolorem " + "ipsum quia dolor sit amet, consectetur, adipisci velit."; copytext = createtextfield(10, 110, 35, 20); copytext.htmltext = "<a href='#'>copy</a>"; copytext.addeventlistener(mouseevent.click, oncopy); destination = createtextfield(10, 145, 380, 90);

181 ADOBE AIR HTML 174 destination.addeventlistener(event.paste, onpaste); private function createtextfield(x:number, y:number, width:number, height:number):textfield var newtxt:textfield = new TextField(); newtxt.x = x; newtxt.y = y; newtxt.height = height; newtxt.width = width; newtxt.border = true; newtxt.multiline = true; newtxt.wordwrap = true; newtxt.type = TextFieldType.INPUT; addchild(newtxt); return newtxt; public function oncopy(event:mouseevent):void Clipboard.generalClipboard.clear(); Clipboard.generalClipboard.setDataHandler(ClipboardFormats.TEXT_FORMAT, renderdata); public function onpaste(event:event):void sourcetextfield.text = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT).toString; public function renderdata():string trace("rendering data"); var sourcestr:string = sourcetextfield.text; if (sourcetextfield.selectionendindex > sourcetextfield.selectionbeginindex) return sourcestr.substring(sourcetextfield.selectionbeginindex, sourcetextfield.selectionendindex); else return sourcestr;

182 ADOBE AIR HTML 175 Flex <mx:application xmlns:mx=" layout="absolute" width="326" height="330" applicationcomplete="init()"> <mx:script> <![CDATA[ import flash.desktop.clipboard; import flash.desktop.clipboardformats; public function init():void destination.addeventlistener("paste", dopaste); public function docopy():void Clipboard.generalClipboard.clear(); Clipboard.generalClipboard.setDataHandler(ClipboardFormats.TEXT_FORMAT, renderdata); public function dopaste(event:event):void destination.text = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT).toString; public function renderdata():string trace("rendering data"); return source.text; ]]> </mx:script> <mx:label x="10" y="10" text="source"/> <mx:textarea id="source" x="10" y="36" width="300" height="100"> <mx:text>neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.</mx:text> </mx:textarea> <mx:label x="10" y="181" text="destination"/> <mx:textarea id="destination" x="12" y="207" width="300" height="100"/> <mx:button click="docopy();" x="91" y="156" label="copy"/> </mx:application>

183 : AIR SQL Adobe AIR 1.0 Adobe AIR SQL SQL SQLite SQL SQL SQL Adobe AIR 1.0 SQL Adobe Developer Connection SQL SQL Adobe AIR SQL AIR AIR SQL SQL SQL Adobe AIR 1.0 AIR SQL Adobe AIR SQL AIR AIR Christophe Coenraets AIR for Android Employee Raymond Camden jquery AIR

184 ADOBE AIR HTML AIR SQL 177 AIR Adobe AIR 1.0 Adobe AIR SQL SQL AIR SQL SQL Adobe AIR 1.0 id id id id AIR SQL Adobe AIR 1.0 (SQL) SQL SQL SQL (ANSI) Adobe AIR SQL SQL-92 Adobe AIR SQL 293 SQL

185 ADOBE AIR HTML AIR SQL 178 SQL Adobe AIR 1.0 JavaScript SQL HTML AIRAliases.js air.* air.sqlconnection air.sqlstatement air.sqlresult SQL SELECT UPDATE DELETE air.sqlschemaresult air.sqltableschema air.sqlviewschema air.sqlindexschema air.sqltriggerschema SQLConnection.loadSchema() SQLConnection air.sqlmode air.sqlcolumnnamestyle air.sqltransactionlocktyp e air.sqlcollationtype SQLConnection.open() SQLConnection.openAsync() openmode SQLConnection.columnNameStyle SQLConnection.begin() option SQLColumnSchema() SQLColumnSchema.defaultCollationType defaultcollationtype air.sqlevent air.sqlerrorevent air.sqlupdateevent SQLConnection SQLStatement SQLEvent SQLConnection SQLStatement INSERT UPDATE DELETE SQL SQLConnection

186 ADOBE AIR HTML AIR SQL 179 air.sqlerror air.sqlerroroperation SQLError operation Adobe AIR 1.0 SQL Adobe AIR SQLConnection SQLConnection SQLConnection SQLConnection.open() SQLConnection.openAsync() open() openasync() SQLConnection 198 Adobe AIR 1.0 Flex AIR

187 ADOBE AIR HTML AIR SQL 180 Adobe AIR 1.0 SQLConnection open() openasync() open() openasync() File reference open() openasync() open() openasync() reference null open() openasync() 130 DBSample.db // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); conn.addeventlistener(air.sqlevent.open, openhandler); conn.addeventlistener(air.sqlerrorevent.error, errorhandler); // The database file is in the application storage directory var folder = air.file.applicationstoragedirectory; var dbfile = folder.resolvepath("dbsample.db"); conn.openasync(dbfile); function openhandler(event) air.trace("the database was created successfully"); function errorhandler(event) air.trace("error message:", event.error.message); air.trace("details:", event.error.details); File C:\Documents and Settings\joe\test.db Windows File File.applicationStorageDirectory resolvepath() 128 File SQLConnection open() SQLConnection

188 ADOBE AIR HTML AIR SQL 181 // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); // The database file is in the application storage directory var folder = air.file.applicationstoragedirectory; var dbfile = folder.resolvepath("dbsample.db"); try conn.open(dbfile); air.trace("the database was created successfully"); catch (error) air.trace("error message:", error.message); air.trace("details:", error.details); Adobe AIR 1.0 SELECT INSERT SQL SQL CREATE TABLE SQL 184 SQL employees conn SQLConnection // Include AIRAliases.js to use air.* shortcuts //... create and open the SQLConnection instance named conn... var createstmt = new air.sqlstatement(); createstmt.sqlconnection = conn; var sql = "CREATE TABLE IF NOT EXISTS employees (" + " empid INTEGER PRIMARY KEY AUTOINCREMENT, " + " firstname TEXT, " + " lastname TEXT, " + " salary NUMERIC CHECK (salary > 0)" + ")"; createstmt.text = sql; createstmt.addeventlistener(air.sqlevent.result, createresult); createstmt.addeventlistener(air.sqlerrorevent.error, createerror); createstmt.execute(); function createresult(event) air.trace("table created"); function createerror(event) air.trace("error message:", event.error.message); air.trace("details:", event.error.details);

189 ADOBE AIR HTML AIR SQL 182 employees conn SQLConnection // Include AIRAliases.js to use air.* shortcuts //... create and open the SQLConnection instance named conn... var createstmt = new air.sqlstatement(); createstmt.sqlconnection = conn; var sql = "CREATE TABLE IF NOT EXISTS employees (" + " empid INTEGER PRIMARY KEY AUTOINCREMENT, " + " firstname TEXT, " + " lastname TEXT, " + " salary NUMERIC CHECK (salary > 0)" + ")"; createstmt.text = sql; try createstmt.execute(); air.trace("table created"); catch (error) air.trace("error message:", error.message); air.trace("details:", error.details); SQL Adobe AIR 1.0 SQL Adobe AIR 1.0 SQLConnection SQLConnection open() openasync() openasync() SQLConnection open openasync() SQLConnection error

190 ADOBE AIR HTML AIR SQL 183 DBSample.db 130 // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); conn.addeventlistener(air.sqlevent.open, openhandler); conn.addeventlistener(air.sqlerrorevent.error, errorhandler); // The database file is in the application storage directory var folder = air.file.applicationstoragedirectory; var dbfile = folder.resolvepath("dbsample.db"); conn.openasync(dbfile, air.sqlmode.update); function openhandler(event) air.trace("the database opened successfully"); function errorhandler(event) air.trace("error message:", event.error.message); air.trace("details:", event.error.details); DBSample.db 130 // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); // The database file is in the application storage directory var folder = air.file.applicationstoragedirectory; var dbfile = folder.resolvepath("dbsample.db"); try conn.open(dbfile, air.sqlmode.update); air.trace("the database opened successfully"); catch (error) air.trace("error message:", error.message); air.trace("details:", error.details); openasync() open() SQLMode.UPDATE (openmode) SQLMode.UPDATE openmode SQLMode.CREATE openmode SQLMode.Update openmode SQLMode.READ

191 ADOBE AIR HTML AIR SQL 184 SQL Adobe AIR 1.0 SQL SQLStatement SQL SQLStatement SQLStatement SQL var selectdata = new air.sqlstatement(); SQLStatement sqlconnection SQLConnection // A SQLConnection named "conn" has been created previously selectdata.sqlconnection = conn; SQL SQLStatement text selectdata.text = "SELECT col1, col2 FROM my_table WHERE col1 = :param1"; addeventlistener() SQLStatement result error // using listener methods and addeventlistener() selectdata.addeventlistener(air.sqlevent.result, resulthandler); selectdata.addeventlistener(air.sqlerrorevent.error, errorhandler); function resulthandler(event) // do something after the statement execution succeeds function errorhandler(event) // do something after the statement execution fails Responder Responder // using a Responder var selectresponder = new air.responder(onresult, onerror); function onresult(result) // do something after the statement execution succeeds function onerror(error) // do something after the statement execution fails SQLStatement parameters selectdata.parameters[":param1"] = 25;

192 ADOBE AIR HTML AIR SQL 185 SQL SQLStatement execute() // using synchronous execution mode // or listener methods in asynchronous execution mode selectdata.execute(); Responder Responder execute() // using a Responder in asynchronous execution mode selectdata.execute(-1, selectresponder); Adobe AIR 1.0 SQL SQL INSERT Adobe AIR 1.0 SQL SQL INSERT SQL SQL SQL SQL SQLStatement text SQL SQLStatement parameters parameters statement.parameters[parameter_identifier] = value; parameter_identifier Adobe AIR 1.0

193 ADOBE AIR HTML AIR SQL 186 var sql = "INSERT INTO inventoryitems (name, productcode)" + "VALUES (:name, :productcode)"; var additemstmt = new air.sqlstatement(); additemstmt.sqlconnection = conn; additemstmt.text = sql; // set parameter values additemstmt.parameters[":name"] = "Item name"; additemstmt.parameters[":productcode"] = "12345"; additemstmt.execute(); Adobe AIR 1.0? SQL 0 var sql = "INSERT INTO inventoryitems (name, productcode)" + "VALUES (?,?)"; var additemstmt = new air.sqlstatement(); additemstmt.sqlconnection = conn; additemstmt.text = sql; // set parameter values additemstmt.parameters[0] = "Item name"; additemstmt.parameters[1] = "12345"; additemstmt.execute(); Adobe AIR 1.0 SQL SQL SQLStatement SQLStatement SQL SQL 310 SQL SQL SQL SQL SQL SQL SQL

194 ADOBE AIR HTML AIR SQL 187 // assume the variables "username" and "password" // contain user-entered data var sql = "SELECT userid " + "FROM users " + "WHERE username = '" + username + "' " + " AND password = '" + password + "'"; var statement = new air.sqlstatement(); statement.text = sql; SQL SQL // assume the variables "username" and "password" // contain user-entered data var sql = "SELECT userid " + "FROM users " + "WHERE username = :username " + " AND password = :password"; var statement = new air.sqlstatement(); statement.text = sql; // set parameter values statement.parameters[":username"] = username; statement.parameters[":password"] = password; Adobe AIR 1.0 SQL SELECT SELECT Adobe AIR 1.0 SQLStatement SQL SELECT text execute() SELECT 293 SQL SELECT products

195 ADOBE AIR HTML AIR SQL 188 // Include AIRAliases.js to use air.* shortcuts var selectstmt = new air.sqlstatement(); // A SQLConnection named "conn" has been created previously selectstmt.sqlconnection = conn; selectstmt.text = "SELECT itemid, itemname, price FROM products"; selectstmt.addeventlistener(air.sqlevent.result, resulthandler); selectstmt.addeventlistener(air.sqlerrorevent.error, errorhandler); selectstmt.execute(); function resulthandler(event) var result = selectstmt.getresult(); var numresults = result.data.length; for (i = 0; i < numresults; i++) var row = result.data[i]; var output = "itemid: " + row.itemid; output += "; itemname: " + row.itemname; output += "; price: " + row.price; air.trace(output); function errorhandler(event) // Information about the error is available in the // event.error property, which is an instance of // the SQLError class. SELECT

196 ADOBE AIR HTML AIR SQL 189 // Include AIRAliases.js to use air.* shortcuts var selectstmt = new air.sqlstatement(); // A SQLConnection named "conn" has been created previously selectstmt.sqlconnection = conn; selectstmt.text = "SELECT itemid, itemname, price FROM products"; try selectstmt.execute(); var result = selectstmt.getresult(); var numresults = result.data.length; for (i = 0; i < numresults; i++) var row = result.data[i]; var output = "itemid: " + row.itemid; output += "; itemname: " + row.itemname; output += "; price: " + row.price; air.trace(output); catch (error) // Information about the error is available in the // error variable, which is an instance of // the SQLError class. SQLStatement result (SQLEvent.RESULT) Responder execute() Responder execute() SELECT Adobe AIR 1.0 SELECT SQLStatement getresult() SELECT var result = selectstatement.getresult(); getresult() SQLResult SQLResult data SELECT var numresults = result.data.length; for (var i = 0; i < numresults; i++) // row is an Object representing one row of result data var row = result.data[i]; SELECT data Object SELECT itemid itemname price itemid itemname price Object

197 ADOBE AIR HTML AIR SQL 190 SELECT SQLStatement employees firstname lastname selectresult() SQLStatement.getResult() trace() conn SQLConnection employees // Include AIRAliases.js to use air.* shortcuts //... create and open the SQLConnection instance named conn... // create the SQL statement var selectstmt = new air.sqlstatement(); selectstmt.sqlconnection = conn; // define the SQL text var sql = "SELECT firstname, lastname " + "FROM employees"; selectstmt.text = sql; // register listeners for the result and error events selectstmt.addeventlistener(air.sqlevent.result, selectresult); selectstmt.addeventlistener(air.sqlerrorevent.error, selecterror); // execute the statement selectstmt.execute(); function selectresult(event) // access the result data var result = selectstmt.getresult(); var numrows = result.data.length; for (i = 0; i < numrows; i++) var output = ""; for (columnname in result.data[i]) output += columnname + ": " + result.data[i][columnname] + "; "; air.trace("row[" + i.tostring() + "]\t", output); function selecterror(event) air.trace("error message:", event.error.message); air.trace("details:", event.error.details); SELECT SQLStatement employees firstname lastname SQLStatement.getResult() trace() conn SQLConnection employees

198 ADOBE AIR HTML AIR SQL 191 // Include AIRAliases.js to use air.* shortcuts //... create and open the SQLConnection instance named conn... // create the SQL statement var selectstmt = new air.sqlstatement(); selectstmt.sqlconnection = conn; // define the SQL text var sql = "SELECT firstname, lastname " + "FROM employees"; selectstmt.text = sql; try // execute the statement selectstmt.execute(); // access the result data var result = selectstmt.getresult(); var numrows = result.data.length; for (i = 0; i < numrows; i++) var output = ""; for (columnname in result.data[i]) output += columnname + ": " + result.data[i][columnname] + "; "; air.trace("row[" + i.tostring() + "]\t", output); catch (error) air.trace("error message:", error.message); air.trace("details:", error.details); SELECT Adobe AIR 1.0 SELECT Object SQL SELECT SQLStatement itemclass itemclass SELECT SELECT itemclass itemclass SELECT SELECT itemclass SELECT Adobe AIR 1.0 SELECT

199 ADOBE AIR HTML AIR SQL 192 SELECT SQLStatement.execute() prefetch prefetch SQLStatement execute() prefetch // Include AIRAliases.js to use air.* shortcuts var stmt = new air.sqlstatement(); stmt.sqlconnection = conn; stmt.text = "SELECT..."; stmt.addeventlistener(air.sqlevent.result, selectresult); stmt.execute(20); // only the first 20 rows (or fewer) are returned result SQLResult data complete SQLStatement next() execute() next() result function selectresult(event) var result = stmt.getresult(); if (result.data!= null) //... loop through the rows or perform other processing... if (!result.complete) stmt.next(20); // retrieve the next 20 rows else stmt.removeeventlistener(air.sqlevent.result, selectresult); next() SQLStatement result next() SQLStatement.execute() prefetch SQLStatement.next() Adobe AIR 1.0 SQL INSERT INSERT Adobe AIR 1.0 SQL INSERT SQLStatement SQLStatement employees conn SQLConnection employees

200 ADOBE AIR HTML AIR SQL 193 // Include AIRAliases.js to use air.* shortcuts //... create and open the SQLConnection instance named conn... // create the SQL statement var insertstmt = new air.sqlstatement(); insertstmt.sqlconnection = conn; // define the SQL text var sql = "INSERT INTO employees (firstname, lastname, salary) " + "VALUES ('Bob', 'Smith', 8000)"; insertstmt.text = sql; // register listeners for the result and failure (status) events insertstmt.addeventlistener(air.sqlevent.result, insertresult); insertstmt.addeventlistener(air.sqlerrorevent.error, inserterror); // execute the statement insertstmt.execute(); function insertresult(event) air.trace("insert statement succeeded"); function inserterror(event) air.trace("error message:", event.error.message); air.trace("details:", event.error.details); employees conn SQLConnection employees // Include AIRAliases.js to use air.* shortcuts //... create and open the SQLConnection instance named conn... // create the SQL statement var insertstmt = new air.sqlstatement(); insertstmt.sqlconnection = conn; // define the SQL text var sql = "INSERT INTO employees (firstname, lastname, salary) " + "VALUES ('Bob', 'Smith', 8000)"; insertstmt.text = sql; try // execute the statement insertstmt.execute(); air.trace("insert statement succeeded"); catch (error) air.trace("error message:", error.message); air.trace("details:", error.details);

201 ADOBE AIR HTML AIR SQL 194 Adobe AIR 1.0 SQLResult SELECT SQL INSERT SQLResult SQLStatement getresult() SQLResult Responder execute() SQLResult SQLResult lastinsertrowid SQL INSERT insertstmt.text = "INSERT INTO..."; insertstmt.addeventlistener(air.sqlevent.result, resulthandler); insertstmt.execute(); function resulthandler(event) // get the primary key var result = insertstmt.getresult(); var primarykey = result.lastinsertrowid; // do something with the primary key insertstmt.text = "INSERT INTO..."; try insertstmt.execute(); // get the primary key var result = insertstmt.getresult(); var primarykey = result.lastinsertrowid; // do something with the primary key catch (error) // respond to the error INTEGER lastinsertrowid AUTOINCREMENT INTEGER lastinsertrowid INSERT lastinsertrowid INSERT SQLResult.lastInsertRowID INSERT INTEGER PRIMARY KEY INTEGER PRIMARY KEY ROWID _ROWID_ OID

202 ADOBE AIR HTML AIR SQL 195 SQL INTEGER PRIMARY KEY INTEGER PRIMARY KEY 293 SQL Adobe AIR 1.0 SQL SELECT INSERT 184 SQL SQLStatement text SQL UPDATE DELETE 293 SQL Adobe AIR 1.0 SQLConnection.attach() SQLConnection attach() name database-name.table-name SQL SQL SQLConnection SQLConnection SQLConnection SQL SQLConnection SQLConnection SQLConnection SQLConnection UPDATE DELETE Adobe AIR 1.0 SQL Adobe AIR 1.0

203 ADOBE AIR HTML AIR SQL 196 Adobe AIR 1.0 SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL Adobe AIR 1.0 INSERT UPDATE null NULL 0 197

204 ADOBE AIR HTML AIR SQL 197 SQL id id INSERT NULL NOT NULL NOT NULL String null NOT NULL CHECK UNIQUE SELECT INSERT UPDATE 293 SQL ON CONFLICT SQL UNIQUE Adobe AIR 1.0 SQL CREATE TABLE SQL SELECT INSERT NUMERIC INTEGER REAL NUMERIC SELECT Number String

205 ADOBE AIR HTML AIR SQL 198 SQL 310 Adobe AIR 1.0 SQLConnection SQLConnection.open() SQLConnection.openAsync() open() openasync() SQLConnection Adobe AIR 1.0 SELECT INSERT Adobe AIR 1.0

206 ADOBE AIR HTML AIR SQL 199 // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); // The database file is in the application storage directory var folder = File.applicationStorageDirectory; var dbfile = folder.resolvepath("dbsample.db"); // open the database conn.open(dbfile, air.openmode.update); // start a transaction conn.begin(); // add the customer record to the database var insertcustomer = new air.sqlstatement(); insertcustomer.sqlconnection = conn; insertcustomer.text = "INSERT INTO customers (firstname, lastname) " + "VALUES ('Bob', 'Jones')"; insertcustomer.execute(); var customerid = insertcustomer.getresult().lastinsertrowid; // add a related phone number record for the customer var insertphonenumber = new air.sqlstatement(); insertphonenumber.sqlconnection = conn; insertphonenumber.text = "INSERT INTO customerphonenumbers (customerid, number) " + "VALUES (:customerid, ' ')"; insertphonenumber.parameters[":customerid"] = customerid; insertphonenumber.execute(); // commit the transaction conn.commit(); Adobe AIR 1.0 INSERT

207 ADOBE AIR HTML AIR SQL 200 // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); // The database file is in the application storage directory var folder = File.applicationStorageDirectory; var dbfile = folder.resolvepath("dbsample.db"); // open the database conn.open(dbfile, air.openmode.update); // start a transaction conn.begin(); // add the customer record to the database var insertcustomer = new air.sqlstatement(); insertcustomer.sqlconnection = conn; insertcustomer.text = "INSERT INTO customers (firstname, lastname) " + "VALUES ('Bob', 'Jones')"; insertcustomer.execute(); var customerid = insertcustomer.getresult().lastinsertrowid; // add a related phone number record for the customer var insertphonenumber = new air.sqlstatement(); insertphonenumber.sqlconnection = conn; insertphonenumber.text = "INSERT INTO customerphonenumbers (customerid, number) " + "VALUES (:customerid, ' ')"; insertphonenumber.parameters[":customerid"] = customerid; insertphonenumber.execute(); // commit the transaction conn.commit(); Adobe AIR 1.0 try..catch..finally try catch finally try..catch..finally

208 ADOBE AIR HTML AIR SQL 201 // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); // The database file is in the application storage directory var folder = File.applicationStorageDirectory; var dbfile = folder.resolvepath("dbsample.db"); // open the database conn.open(dbfile, air.sqlmode.update); // start a transaction conn.begin(); try // add the customer record to the database var insertcustomer = new air.sqlstatement(); insertcustomer.sqlconnection = conn; insertcustomer.text = "INSERT INTO customers (firstname, lastname)" + "VALUES ('Bob', 'Jones')"; insertcustomer.execute(); var customerid = insertcustomer.getresult().lastinsertrowid; // add a related phone number record for the customer var insertphonenumber = new air.sqlstatement(); insertphonenumber.sqlconnection = conn; insertphonenumber.text = "INSERT INTO customerphonenumbers (customerid, number)" + "VALUES (:customerid, ' ')"; insertphonenumber.parameters[":customerid"] = customerid; insertphonenumber.execute(); // if we've gotten to this point without errors, commit the transaction conn.commit(); catch (error) // rollback the transaction conn.rollback(); Adobe AIR 1.0 SQLStatement SQLStatement SQLStatement text SQL SQLStatement SQLStatement SQLStatement execute() SQLConnection SQLStatement execute() SQLConnection

209 ADOBE AIR HTML AIR SQL 202 SQLStatement execute() result // Using asynchronous execution mode var stmt1 = new air.sqlstatement(); stmt1.sqlconnection = conn; //... Set statement text and parameters, and register event listeners... stmt1.execute(); // At this point stmt1's execute() operation is added to conn's execution queue. var stmt2 = new air.sqlstatement(); stmt2.sqlconnection = conn; //... Set statement text and parameters, and register event listeners... stmt2.execute(); // At this point stmt2's execute() operation is added to conn's execution queue. // When stmt1 finishes executing, stmt2 will immediately begin executing // in the background. execute() execute() text parameters SQLConnection.begin() SQLConnection begin SQLStatement execute() begin SQLStatement.execute() SQL Adobe AIR 1.5 Adobe AIR AIR Adobe AIR 1.5 AIR SQL Adobe AIR 1.5 Adobe AIR

210 ADOBE AIR HTML AIR SQL SQL 206 ByteArray AIR ByteArray 218 Adobe AIR SQLConnection SQLConnection open() openasync() encryptionkey open() openasync() encryptionkey 16 ByteArray var conn = new air.sqlconnection(); var encryptionkey = new air.bytearray(); encryptionkey.writeutfbytes("some16bytestring"); // This technique is not secure! // Create an encrypted database in asynchronous mode conn.openasync(dbfile, air.sqlmode.create, null, false, 1024, encryptionkey); // Create an encrypted database in synchronous mode conn.open(dbfile, air.sqlmode.create, false, 1024, encryptionkey); 206 Adobe AIR open() openasync() encryptionkey open() openasync()

211 ADOBE AIR HTML AIR SQL 204 open() SQLError openasync() SQLConnection SQLErrorEvent error SQLError SQLError errorid 3138 ID // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); conn.addeventlistener(air.sqlevent.open, openhandler); conn.addeventlistener(air.sqlerrorevent.error, errorhandler); var dbfile = air.file.applicationstoragedirectory.resolvepath("dbsample.db"); var encryptionkey = new air.bytearray(); encryptionkey.writeutfbytes("some16bytestring"); // This technique is not secure! conn.openasync(dbfile, air.sqlmode.update, null, false, 1024, encryptionkey); function openhandler(event) air.trace("the database opened successfully"); function errorhandler(event) if (event.error.errorid == 3138) air.trace("incorrect encryption key"); else air.trace("error message:", event.error.message); air.trace("details:", event.error.details);

212 ADOBE AIR HTML AIR SQL 205 // Include AIRAliases.js to use air.* shortcuts var conn = new air.sqlconnection(); var dbfile = air.file.applicationstoragedirectory.resolvepath("dbsample.db"); var encryptionkey = new air.bytearray(); encryptionkey.writeutfbytes("some16bytestring"); // This technique is not secure! try conn.open(dbfile, air.sqlmode.update, false, 1024, encryptionkey); air.trace("the database was created successfully"); catch (error) if (error.errorid == 3138) air.trace("incorrect encryption key"); else air.trace("error message:", error.message); air.trace("details:", error.details); 206 Adobe AIR 1.5 SQLConnection open() openasync() reencrypt() reencrypt() open() reencrypt() var newkey = new air.bytearray(); //... generate the new key and store it in newkey conn.reencrypt(newkey); openasync() reencrypt() reencrypt() SQLConnection reencrypt var newkey = new air.bytearray(); //... generate the new key and store it in newkey conn.addeventlistener(air.sqlevent.reencrypt, reencrypthandler); conn.reencrypt(newkey); function reencrypthandler(event) // save the fact that the key changed reencrypt()

213 ADOBE AIR HTML AIR SQL 206 reencrypt() reencrypt() null 16 ByteArray Adobe AIR SSL salt 206 AIR HTML SWF AIR (AES) Counter with CBC-MAC (CCM) salt 206 AIR Adobe AIR 1.5

214 ADOBE AIR HTML AIR SQL 207 ActionScript EncryptionKeyGenerator 208 EncryptionKeyGenerator Adobe AIR 1.5 EncryptionKeyGenerator 214 EncryptionKeyGenerator EncryptionKeyGenerator 1 EncryptionKeyGenerator EncryptionKeyGenerator ActionScript 3.0 (as3corelib) as3corelib SWC 2 SWC SWF SWF SWC.zip ZIP ZIP SWF HTML SWF SWF EncryptionKeyGenerator.swf 3 SWF <script> SWF 28 HTML ActionScript SWF <script type="application/x-shockwave-flash" src="encryptionkeygenerator.swf"/> window.runtime EncryptionKeyGenerator window.runtime.com.adobe.air.crypto.encryptionkeygenerator ekg.encryptionkeygenerator EncryptionKeyGenerator var ekg; if (window.runtime) if (!ekg) ekg = ; ekg.encryptionkeygenerator = window.runtime.com.adobe.air.crypto.encryptionkeygenerator; 4 EncryptionKeyGenerator() EncryptionKeyGenerator var keygenerator = new ekg.encryptionkeygenerator(); 5 var password = passwordinput.value; if (!keygenerator.validatestrongpassword(password)) // display an error message return; EncryptionKeyGenerator EncryptionKeyGenerator EncryptionKeyGenerator validatestrongpassword() 6 var encryptionkey = keygenerator.getencryptionkey(password); getencryptionkey() 16 ByteArray

215 ADOBE AIR HTML AIR SQL 208 getencryptionkey() 5 getencryptionkey() overridesaltelskey EncryptionKeyGenerator salt salt AIR (ELS) EncryptionKeyGenerator ELS ELS getencryptionkey() var customkey = "My custom ELS salt key"; var encryptionkey = keygenerator.getencryptionkey(password, customkey); 7 getencryptionkey() SQLConnection open() openasync() openasync() conn.addeventlistener(air.sqlevent.open, openhandler); conn.addeventlistener(air.sqlerrorevent.error, openerror); conn.openasync(dbfile, air.sqlmode.create, null, false, 1024, encryptionkey); openerror() if ID EncryptionKeyGenerator.ENCRYPTED_DB_PASSWORD_ERROR_ID ID if (!createnewdb && event.error.errorid == ekg.encryptionkeygenerator.encrypted_db_password_error_id) statusmsg.innerhtml = "<p class='error'>incorrect password!</p>"; else statusmsg.innerhtml = "<p class='error'>error creating or opening database.</p>"; 208 Adobe AIR 1.5 EncryptionKeyGenerator EncryptionKeyGenerator ActionScript 3.0 (as3corelib) as3corelib SWC Flex MXML

216 ADOBE AIR HTML AIR SQL 209 <?xml version="1.0" encoding="utf-8"?> <mx:windowedapplication xmlns:mx=" layout="vertical" creationcomplete="init();"> <mx:script> <![CDATA[ import com.adobe.air.crypto.encryptionkeygenerator; private const dbfilename:string = "encrypteddatabase.db"; private var dbfile:file; private var createnewdb:boolean = true; private var conn:sqlconnection; // Event handling private function init():void conn = new SQLConnection(); dbfile = File.applicationStorageDirectory.resolvePath(dbFileName); if (dbfile.exists) createnewdb = false; instructions.text = "Enter your database password to open the encrypted database."; openbutton.label = "Open Database"; private function openconnection():void var password:string = passwordinput.text; var keygenerator:encryptionkeygenerator = new EncryptionKeyGenerator(); if (password == null password.length <= 0) statusmsg.text = "Please specify a password."; return; if (!keygenerator.validatestrongpassword(password)) statusmsg.text = "The password must be 8-32 characters long. It must contain at least one lowercase letter, at least one uppercase letter, and at least one number or symbol."; return; passwordinput.text = ""; passwordinput.enabled = false; openbutton.enabled = false; var encryptionkey:bytearray = keygenerator.getencryptionkey(password); conn.addeventlistener(sqlevent.open, openhandler); conn.addeventlistener(sqlerrorevent.error, openerror); conn.openasync(dbfile, SQLMode.CREATE, null, false, 1024, encryptionkey); private function openhandler(event:sqlevent):void conn.removeeventlistener(sqlevent.open, openhandler); conn.removeeventlistener(sqlerrorevent.error, openerror);

217 ADOBE AIR HTML AIR SQL 210 statusmsg.setstyle("color", 0x009900); if (createnewdb) statusmsg.text = "The encrypted database was created successfully."; else statusmsg.text = "The encrypted database was opened successfully."; private function openerror(event:sqlerrorevent):void conn.removeeventlistener(sqlevent.open, openhandler); conn.removeeventlistener(sqlerrorevent.error, openerror); if (!createnewdb && event.error.errorid == EncryptionKeyGenerator.ENCRYPTED_DB_PASSWORD_ERROR_ID) statusmsg.text = "Incorrect password!"; else statusmsg.text = "Error creating or opening database."; ]]> </mx:script> <mx:text id="instructions" text="enter a password to create an encrypted database. The next time you open the application, you will need to re-enter the password to open the database again." width="75%" height="65"/> <mx:hbox> <mx:textinput id="passwordinput" displayaspassword="true"/> <mx:button id="openbutton" label="create Database" click="openconnection();"/> </mx:hbox> <mx:text id="statusmsg" color="#990000" width="75%"/> </mx:windowedapplication> Flash Professional FLA FLA instructions passwordinput openbutton statusmsg 1

218 ADOBE AIR HTML AIR SQL 211 import com.adobe.air.crypto.encryptionkeygenerator; const dbfilename:string = "encrypteddatabase.db"; var dbfile:file; var createnewdb:boolean = true; var conn:sqlconnection; init(); // Event handling function init():void passwordinput.displayaspassword = true; openbutton.addeventlistener(mouseevent.click, openconnection); statusmsg.setstyle("textformat", new TextFormat(null, null, 0x990000)); conn = new SQLConnection(); dbfile = File.applicationStorageDirectory.resolvePath(dbFileName); if (dbfile.exists) createnewdb = false; instructions.text = "Enter your database password to open the encrypted database."; openbutton.label = "Open Database"; else instructions.text = "Enter a password to create an encrypted database. The next time you open the application, you will need to re-enter the password to open the database again."; openbutton.label = "Create Database"; function openconnection(event:mouseevent):void var keygenerator:encryptionkeygenerator = new EncryptionKeyGenerator(); var password:string = passwordinput.text; if (password == null password.length <= 0) statusmsg.text = "Please specify a password."; return; if (!keygenerator.validatestrongpassword(password)) statusmsg.text = "The password must be 8-32 characters long. It must contain at least one lowercase letter, at least one uppercase letter, and at least one number or symbol."; return; passwordinput.text = ""; passwordinput.enabled = false; openbutton.enabled = false; var encryptionkey:bytearray = keygenerator.getencryptionkey(password); conn.addeventlistener(sqlevent.open, openhandler); conn.addeventlistener(sqlerrorevent.error, openerror);

219 ADOBE AIR HTML AIR SQL 212 conn.openasync(dbfile, SQLMode.CREATE, null, false, 1024, encryptionkey); function openhandler(event:sqlevent):void conn.removeeventlistener(sqlevent.open, openhandler); conn.removeeventlistener(sqlerrorevent.error, openerror); statusmsg.setstyle("textformat", new TextFormat(null, null, 0x009900)); if (createnewdb) statusmsg.text = "The encrypted database was created successfully."; else statusmsg.text = "The encrypted database was opened successfully."; function openerror(event:sqlerrorevent):void conn.removeeventlistener(sqlevent.open, openhandler); conn.removeeventlistener(sqlerrorevent.error, openerror); if (!createnewdb && event.error.errorid == EncryptionKeyGenerator.ENCRYPTED_DB_PASSWORD_ERROR_ID) statusmsg.text = "Incorrect password!"; else statusmsg.text = "Error creating or opening database."; HTML <html> <head> <title>encrypted Database Example (HTML)</title> <style type="text/css"> body padding-top: 25px; font-family: Verdana, Arial; font-size: 14px; div width: 85%; margin-left: auto; margin-right: auto;.error color: # success color: # </style> <script type="text/javascript" src="airaliases.js"></script> <script type="application/x-shockwave-flash" src="encryptionkeygenerator.swf"/> <script type="text/javascript"> // set up the class shortcut var ekg; if (window.runtime)

220 ADOBE AIR HTML AIR SQL 213 if (!ekg) ekg = ; ekg.encryptionkeygenerator = window.runtime.com.adobe.air.crypto.encryptionkeygenerator; // app globals var dbfilename = "encrypteddatabase.db"; var dbfile; var createnewdb = true; var conn; // UI elements var instructions; var passwordinput; var openbutton; var statusmsg; function init() // UI elements instructions = document.getelementbyid("instructions"); passwordinput = document.getelementbyid("passwordinput"); openbutton = document.getelementbyid("openbutton"); statusmsg = document.getelementbyid("statusmsg"); database.</p>"; conn = new air.sqlconnection(); dbfile = air.file.applicationstoragedirectory.resolvepath(dbfilename); if (dbfile.exists) createnewdb = false; instructions.innerhtml = "<p>enter your database password to open the encrypted openbutton.value = "Open Database"; function openconnection() var keygenerator = new ekg.encryptionkeygenerator(); var password = passwordinput.value; if (password == null password.length <= 0) statusmsg.innerhtml = "<p class='error'>please specify a password.</p>"; return; if (!keygenerator.validatestrongpassword(password)) statusmsg.innerhtml = "<p class='error'>the password must be 8-32 characters long. It must contain at least one lowercase letter, at least one uppercase letter, and at least one number or symbol.</p>"; return; passwordinput.value = ""; passwordinput.disabled = true; openbutton.disabled = true; statusmsg.innerhtml = ""; var encryptionkey = keygenerator.getencryptionkey(password);

221 ADOBE AIR HTML AIR SQL 214 conn.addeventlistener(air.sqlevent.open, openhandler); conn.addeventlistener(air.sqlerrorevent.error, openerror); conn.openasync(dbfile, air.sqlmode.create, null, false, 1024, encryptionkey); function openhandler(event) conn.removeeventlistener(air.sqlevent.open, openhandler); conn.removeeventlistener(air.sqlerrorevent.error, openerror); if (createnewdb) statusmsg.innerhtml = "<p class='success'>the encrypted database was created successfully.</p>"; else statusmsg.innerhtml = "<p class='success'>the encrypted database was opened successfully.</p>"; function openerror(event) conn.removeeventlistener(air.sqlevent.open, openhandler); conn.removeeventlistener(air.sqlerrorevent.error, openerror); if (!createnewdb && event.error.errorid == ekg.encryptionkeygenerator.encrypted_db_password_error_id) statusmsg.innerhtml = "<p class='error'>incorrect password!</p>"; else statusmsg.innerhtml = "<p class='error'>error creating or opening database.</p>"; </script> </head> <body onload="init();"> <div id="instructions"><p>enter a password to create an encrypted database. The next time you open the application, you will need to re-enter the password to open the database again.</p></div> <div><input id="passwordinput" type="password"/><input id="openbutton" type="button" value="create Database" onclick="openconnection();"/></div> <div id="statusmsg"></div> </body> </html> EncryptionKeyGenerator Adobe AIR 1.5 EncryptionKeyGenerator 207 EncryptionKeyGenerator EncryptionKeyGenerator ActionScript 3.0 (as3corelib) as3corelib

222 ADOBE AIR HTML AIR SQL 215 EncryptionKeyGenerator getencryptionkey() Adobe AIR 1.5 getencryptionkey() EncryptionKeyGenerator getencryptionkey() password var keygenerator = new ekg.encryptionkeygenerator(); var encryptionkey = keygenerator.getencryptionkey(password); getencryptionkey() EncryptionKeyGenerator EncryptionKeyGenerator 8-32 getencryptionkey() EncryptionKeyGenerator validatestrongpassword() validatestrongpassword() getencryptionkey() 256 Adobe AIR concatenatepassword() salt Adobe AIR salt salt salt salt salt getencryptionkey() 256 salt salt XOR 256 salt Adobe AIR salt XOR salt 256

223 ADOBE AIR HTML AIR SQL 216 Adobe AIR 1.5 salt SHA-256 Adobe AIR ByteArray SHA SQL Adobe AIR 1.0 SQL Adobe AIR 1.0 AIR SQL AIR AIR File.applicationDirectory AIR 130 SQL Adobe AIR 1.0 SQL

224 ADOBE AIR HTML AIR SQL 217 Adobe AIR 1.0 SQLConnection open() openasync() 182 Adobe AIR 1.0 SQLConnection 182 Adobe AIR SQL INSERT SELECT SELECT 191 SELECT SQL SQLStatement SQL 201 SQL SQLStatement text Adobe AIR 1.0 SQL SQL SQLStatement SQL SQLStatement SQL SQLStatement execute() SQL SQLStatement text Adobe AIR 1.0 SQLStatement SQL SQL 185

225 : Adobe AIR AIR (ELS) AIR AIR AIR SQL 202 SQL Web ELS DRM Windows DPAPI Mac OS ios KeyChain Linux KeyRing KWallet AIR AES-CBC 128 Android EncryptedLocalStorage Android ID Android AIR AIR stronglybound true AIR ELS ELS ID ELS stronglybound true true ID 10MB AIR ELS ELS stronglybound false ELS DRM ELS ELS stronglybound stronglybound true

226 ADOBE AIR HTML 219 AIR SQL flash.data.encryptedlocalstore EncryptedLocalStore setitem() var str = "Bob"; var bytes = new air.bytearray(); bytes.writeutfbytes(str); air.encryptedlocalstore.setitem("firstname", bytes); setitem() stronglybound true AIR var str = "Bob"; var bytes = new air.bytearray(); bytes.writeutfbytes(str); air.encryptedlocalstore.setitem("firstname", bytes, false); stronglybound true getitem() AIR AIR getitem() Error stronglybound true false stronglybound false ID ID stronglybound true ELS stronglybound true false stronglybound true Adobe AIR 1.0 EncryptedLocalStore.getItem() var storedvalue = air.encryptedlocalstore.getitem("firstname"); air.trace(storedvalue.readutfbytes(storedvalue.length)); // "foo"

227 ADOBE AIR HTML 220 Adobe AIR 1.0 EncryptedLocalStore.removeItem() air.encryptedlocalstore.removeitem("firstname"); EncryptedLocalStore.reset() air.encryptedlocalstore.reset();

228 : Flash Player 9 Adobe AIR 1.0 ByteArray 8 ByteArray writeobject() Action Message Format (AMF) ByteArray readobject() ByteArray AMF Adobe AIR.zip.zip flash.utils.bytearray flash.utils.iexternalizable Action Message Format ByteArray Flash Player 9 Adobe AIR 1.0 ByteArray flash.utils AIRAliases.js air.bytearray ByteArray ByteArray ByteArray var stream = new air.bytearray(); ByteArray Flash Player 9 Adobe AIR 1.0 ID MP3 ID3 ByteArray readbytes() writebytes() readint() writeint() readfloat() writefloat() readobject() writeobject() readutfbytes() writeutfbytes() ByteArray ByteArray writeutfbytes() writefloat()

229 ADOBE AIR HTML 222 // The following example reads a simple Array (groceries), made up of strings // and floating-point numbers, and writes it to a ByteArray. // define the grocery list Array var groceries = ["milk", 4.50, "soup", 1.79, "eggs", 3.19, "bread", 2.35] // define the ByteArray var bytes = new air.bytearray(); // for each item in the array for (i = 0; i < groceries.length; i++) bytes.writeutfbytes(groceries[i++]); //write the string and position to the next item bytes.writefloat(groceries[i]);// write the float air.trace("bytes.position is: " + bytes.position); //display the position in ByteArray air.trace("bytes length is: " + bytes.length);// display the length position Flash Player 9 Adobe AIR 1.0 position ByteArray position 0 var bytes = new air.bytearray(); air.trace("bytes.position is initially: " + bytes.position); // 0 ByteArray position ByteArray position ByteArray var bytes = new air.bytearray(); air.trace("bytes.position is initially: " + bytes.position); // 0 bytes.writeutfbytes("hello World!"); air.trace("bytes.position is now: " + bytes.position);// 12 position var bytes = new air.bytearray(); air.trace("bytes.position is initially: " + bytes.position); // 0 bytes.writeutfbytes("hello World!"); air.trace("bytes.position is now: " + bytes.position);// 12 bytes.position = 0; air.trace("the first 6 bytes are: " + (bytes.readutfbytes(6)));//hello air.trace("and the next 6 bytes are: " + (bytes.readutfbytes(6)));// World! position ByteArray bytesavailable length Flash Player 9 Adobe AIR 1.0 length bytesavailable ByteArray ByteArray ByteArray a (bytesavailable <= 0)

230 ADOBE AIR HTML 223 var bytes = new air.bytearray(); var text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus etc."; bytes.writeutfbytes(text); // write the text to the ByteArray air.trace("the length of the ByteArray is: " + bytes.length);// 70 bytes.position = 0; // reset position while (bytes.bytesavailable > 0 && (bytes.readutfbytes(1)!= 'a')) //read to letter a or end of bytes if (bytes.position < bytes.bytesavailable) air.trace("found the letter a; position is: " + bytes.position); // 23 air.trace("and the number of bytes available is: " + bytes.bytesavailable);// 47 endian Flash Player 9 Adobe AIR big endian little endian 0x big endian little endian a0 4 a3 Big Endian Big Endian Big Endian Big Endian a0 a1 a2 a Little Endian Little Endian Little Endian Little Endian a0 a1 a2 a ByteArray endian "bigendian" "littleendian" Endian BIG_ENDIAN LITTLE_ENDIAN endian compress() uncompress() Flash Player 9 Adobe AIR 1.0 compress() ByteArray uncompress() ByteArray compress() uncompress() position CompressionAlgorithm (AIR) ByteArray deflate AIR zlib deflate zlib gzip zip zlib deflate deflate bytes ByteArray bytes.compress(air.compressionalgorithm.deflate);

231 ADOBE AIR HTML 224 deflate ByteArray bytes.uncompress(compressionalgorithm.deflate); Flash Player 9 Adobe AIR 1.0 readobject() writeobject() ByteArray Action Message Format (AMF) AMF Adobe ActionScript 3.0 Netstream NetConnection NetStream LocalConnection SharedObject AMF 13 value-type = undefined-marker null-marker false-marker true-marker integer-type double-type string-type xml-doc-type date-type array-type object-type xml-type byte-array-type null true false AMF AMF0 AMF3 AMF 0 AMF 3 AMF 0 traits ActionScript 3.0 ByteArray.objectEcoding AMF flash.net.objectencoding AMF ObjectEncoding.AMF0 ObjectEncoding.AMF3 writeobject() XML ByteArray ByteArray order AIR Wrote order file to desktop! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " transitional.dtd"><html xmlns=" <head> <style type="text/css"> #tafiles border: 1px solid black; font-family: Courier, monospace; white-space: pre; width: 95%; height: 95%; overflow-y: scroll; </style> <script type="text/javascript" src="airaliases.js" ></script> <script type="text/javascript"> //define ByteArray var inbytes = new air.bytearray(); //add objectencoding value and file heading to output text var output = "Object encoding is: " + inbytes.objectencoding + "\n\n" + "order file: \n\n"; function init() readfile("order", inbytes); inbytes.position = 0;//reset position to beginning // read XML from ByteArray var orderxml = inbytes.readobject(); // convert to XML Document object var myxml = (new DOMParser()).parseFromString(orderXML, "text/xml"); document.write(myxml.getelementsbytagname("menuname")[0].childnodes[0].nodevalue + ": "); document.write(myxml.getelementsbytagname("price")[0].childnodes[0].nodevalue + "<br/>"); // burger: 3.95

232 ADOBE AIR HTML 225 document.write(myxml.getelementsbytagname("menuname")[1].childnodes[0].nodevalue + ": "); document.write(myxml.getelementsbytagname("price")[1].childnodes[0].nodevalue + "<br/>"); // fries: 1.45 // end of init() // read specified file into byte array function readfile(filename, data) var infile = air.file.desktopdirectory; // source folder is desktop infile = infile.resolvepath(filename); // name of file to read var instream = new air.filestream(); instream.open(infile, air.filemode.read); instream.readbytes(data, 0, data.length); instream.close(); </script> </head> <body onload = "init();"> <div id="tafiles"></div> </body> </html> readobject() ByteArray AMF order ByteArray (inbytes) readobject() orderxml XML myxml objectencoding order <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " transitional.dtd"> <html xmlns=" <head> <style type="text/css"> #tafiles border: 1px solid black; font-family: Courier, monospace; white-space: pre; width: 95%; height: 95%; overflow-y: scroll; </style> <script type="text/javascript" src="airaliases.js" ></script> <script type="text/javascript"> //define ByteArray var inbytes = new air.bytearray(); //add objectencoding value and file heading to output text var output = "Object encoding is: " + inbytes.objectencoding + "<br/><br/>" + "order file items:" + "<br/><br/>"; function init() readfile("order", inbytes); inbytes.position = 0;//reset position to beginning // read XML from ByteArray var orderxml = inbytes.readobject(); // convert to XML Document object var myxml = (new DOMParser()).parseFromString(orderXML, "text/xml"); document.write(output); document.write(myxml.getelementsbytagname("menuname")[0].childnodes[0].nodevalue + ": "); document.write(myxml.getelementsbytagname("price")[0].childnodes[0].nodevalue + "<br/>"); // burger: 3.95

233 ADOBE AIR HTML 226 document.write(myxml.getelementsbytagname("menuname")[1].childnodes[0].nodevalue + ": "); document.write(myxml.getelementsbytagname("price")[1].childnodes[0].nodevalue + "<br/>"); // fries: 1.45 // end of init() // read specified file into byte array function readfile(filename, data) var infile = air.file.desktopdirectory; // source folder is desktop infile = infile.resolvepath(filename); // name of file to read var instream = new air.filestream(); instream.open(infile, air.filemode.read); instream.readbytes(data, 0, data.length); instream.close(); </script> </head> <body onload = "init();"> <div id="tafiles"></div> </body> </html> ByteArray.zip Adobe AIR 1.0.zip ByteArray.zip PKWARE Inc. zip Zip64 Zip64 zip crc (8=DEFLATE; 0=UNCOMPRESSED)

234 ADOBE AIR HTML DEFLATE 8 (tafiles) zip MXML Flex <?xml version="1.0" encoding="utf-8"?> <mx:windowedapplication xmlns:mx=" layout="vertical" creationcomplete="init();"> <mx:script> <![CDATA[ // The application code goes here ]]> </mx:script> <mx:form> <mx:formitem label="output"> <mx:textarea id="tafiles" width="320" height="150"/> </mx:formitem> </mx:form> </mx:windowedapplication> (tafiles) zip HTML <html> <head> <style type="text/css"> #tafiles border: 1px solid black; font-family: Courier, monospace; white-space: pre; width: 95%; height: 95%; overflow-y: scroll; </style> <script type="text/javascript" src="airaliases.js"></script> <script type="text/javascript"> // The application code goes here </script> </head> <body onload="init();"> <div id="tafiles"></div> </body> </html> bytes ByteArray var bytes = new air.bytearray();

235 ADOBE AIR HTML 228 // variables for reading fixed portion of file header var filename = new String(); var flnamelength; var xfldlength; var offset; var compsize; var uncompsize; var compmethod; var signature; var output;.zip File (zfile) FileStream (zstream).zip HelloAIR.zip // File variables for accessing.zip file var zfile = air.file.desktopdirectory.resolvepath("helloair.zip"); var zstream = new air.filestream(); Flex init() mx:windowedapplication creationcomplete init() body onload function init() READ.zip zstream.open(zfile, air.filemode.read); bytes endian LITTLE_ENDIAN bytes.endian = air.endian.little_endian; while() while (zstream.position < zfile.size) 30 ByteArray bytes 30 // read fixed metadata portion of local file header zstream.readbytes(bytes, 0, 30); 30 (signature) ZIP 0x04034b50 zip while bytes.position = 0; signature = bytes.readint(); // if no longer reading data files, quit if (signature!= 0x04034b50) break; 8 compmethod.zip DEFLATE DEFLATE compmethod 8 compmethod 0 bytes.position = 8; compmethod = bytes.readbyte(); // store compression method (8 == Deflate) 30 offset 26 28

236 ADOBE AIR HTML 229 offset = 0;// stores length of variable portion of metadata bytes.position = 26; // offset to file name length flnamelength = bytes.readshort();// store file name offset += flnamelength; // add length of file name bytes.position = 28;// offset to extra field length xfldlength = bytes.readshort(); offset += xfldlength;// add length of extra field offset // read variable length bytes between fixed-length header and compressed file data zstream.readbytes(bytes, 30, offset); bytes.position = 30; filename = bytes.readutfbytes(flnamelength); // read file name output += filename + "<br />"; // write file name to text area bytes.position = 18; compsize = bytes.readunsignedint(); // store size of compressed portion output += "\tcompressed size is: " + compsize + '<br />'; bytes.position = 22; // offset to uncompressed size uncompsize = bytes.readunsignedint(); // store uncompressed size output += "\tuncompressed size is: " + uncompsize + '<br />'; bytes 30 // read compressed file to offset 0 of bytes; for uncompressed files // the compressed and uncompressed size is the same if (compsize == 0) continue; zstream.readbytes(bytes, 0, compsize); outfile() outfile() if (compmethod == 8) // if file is compressed, uncompress bytes.uncompress(air.compressionalgorithm.deflate); outfile(filename, bytes); // call outfile() to write out the file while init() outfile() while.zip.zip output div tafiles // end of while loop document.getelementbyid("tafiles").innerhtml = output; // end of init() method outfile() WRITE filename data (outstream)

237 ADOBE AIR HTML 230 function outfile(filename, data) var outfile = air.file.desktopdirectory; // dest folder is desktop outfile = outfile.resolvepath(filename); // name of file to write var outstream = new air.filestream(); // open output file stream in WRITE mode outstream.open(outfile, air.filemode.write); // write out the file outstream.writebytes(data, 0, data.length); // close it outstream.close();

238 : AIR PDF Adobe AIR 1.0 Adobe AIR SWF HTML PDF AIR HTMLLoader WebKit Adobe Reader PDF AIR PDF Adobe Reader AIR PDF Reader AIR PDF AIR PDF Adobe Reader Adobe Acrobat 8.1 PDF Adobe AIR 1.0 Adobe Reader Adobe Acrobat 8.1 AIR PDF PDF HTMLLoader.pdfCapability HTMLPDFCapability HTMLPDFCapability.STATUS_OK HTMLPDFCapability.ERROR_INSTALLED_READER_NOT_FO UND HTMLPDFCapability.ERROR_INSTALLED_READER_TOO_OL D HTMLPDFCapability.ERROR_PREFERRED_READER_TOO_OL D Adobe Reader 8.1 PDF HTMLLoader Adobe Reader HTMLLoader PDF Adobe Reader HTMLLoader PDF Adobe Reader 8.1 PDF Adobe Reader Reader 8.1 HTMLLoader PDF Windows Adobe Acrobat Adobe Reader 7.x PDF pdfcapability HTMLPDFCapability.STATUS_OK AIR PDF Acrobat Reader AIR Acrobat PDF Linux AIR PATH acroread /opt/adobe/reader Adobe Reader AIR PDF PDF HTMLPDFCapability

239 ADOBE AIR HTML AIR PDF 232 if(air.htmlloader.pdfcapability == air.htmlpdfcapability.status_ok) air.trace("pdf content can be displayed"); else air.trace("pdf cannot be displayed. Error code:", HTMLLoader.pdfCapability); PDF Adobe AIR 1.0 HTMLLoader PDF PDF AIR PDF AIR PDF HTML frame iframe PDF iframe src PDF <html> <body> <h1>pdf test</h1> <iframe id="pdfframe" width="100%" height="100%" src=" </body> </html> URL AIR URL app app-storage PDFs test.pdf app:/js_api_reference.pdf AIR URL 273 URI PDF Adobe AIR 1.0 JavaScript PDF Acrobat JavaScript Adobe Acrobat JavaScript Adobe Acrobat

240 ADOBE AIR HTML AIR PDF 233 HTML-PDF Adobe AIR 1.0 HTML JavaScript PDF DOM postmessage() PDF JavaScript PDF <object id="pdfobj" data="test.pdf" type="application/pdf" width="100%" height="100%"/> HTML JavaScript PDF JavaScript pdfobject = document.getelementbyid("pdfobj"); pdfobject.postmessage(["testmsg", "hello"]); PDF JavaScript PDF JavaScript PDF PDF hostcontainer messagehandler messagehandler PDF PDF HTML this.hostcontainer.messagehandler = onmessage: myonmessage; function myonmessage(amessage) if(amessage[0] == "testmsg") app.alert("test message: " + amessage[1]); else app.alert("error"); HTML JavaScript PDF postmessage() PDF JavaScript ("Hello from HTML") <html> <head> <title>pdf Test</title> <script> function init() pdfobject = document.getelementbyid("pdfobj"); try pdfobject.postmessage(["alert", "Hello from HTML"]); catch (e) alert( "Error: \n name = " + e.name + "\n message = " + e.message ); </script> </head> <body onload='init()'> <object id="pdfobj" data="test.pdf" type="application/pdf" width="100%" height="100%"/> </body> </html>

241 ADOBE AIR HTML AIR PDF 234 Acrobat 8 PDF JavaScript Adobe AIR PDF AIR PDF Adobe AIR 1.0 Adobe AIR PDF NativeWindow transparent true PDF PDF AIR HTML PDF AIR PDF HTMLLoader PDF filters alpha rotation scaling PDF HTMLLoader PDF PDF NativeWindow window.nativewindow.stage scalemode air.stagescalemode.no_scale PDF PDF PDF PDF PDF PDF HTMLLoader AIR PDF

242 : Adobe AIR HTML flash.media.sound flash.media.microphone flash.events.sampledataevent Adobe AIR AIR mp3 SWF <script src="[swffile].swf" type="application/x-shockwave-flash"/> AIR mp3 WAV AIFF AIR runtime.flash.media Sound AIR SoundChannel SoundChannel SoundChannel SoundChannel SoundMixer AIR 235 Adobe AIR HTML ( SWF Flash Media Server

243 ADOBE AIR HTML 236 sampledata Adobe AIR mp3 WAV AIFF AIR NetStream AAC AIR Sound SoundChannel SoundLoaderContext SoundMixer SoundTransform ID3Info Microphone Sound Sound SoundChannel SoundChannel SoundChannel SoundLoaderContext SoundLoaderContext Sound.load() SoundMixer SoundMixer SoundMixer SoundChannel SoundTransform SoundTransform SoundChannel SoundMixer Microphone ID3Info MP3 ID3 Microphone Microphone Sound SoundChannel SoundMixer SoundChannel Sound SoundChannel SoundMixer Flash Media Server Sound Sound Sound Sound Sound var req = new air.urlrequest("click.mp3"); var s = new air.sound(req); Sound() URLRequest URLRequest Sound

244 ADOBE AIR HTML 237 Sound Sound open (air.event.open) progress (air.progressevent.progress) id3 mp3 ID3 (air.event.id3) complete (air.event.complete) ioerror (air.ioerrorevent.io_error) var s = new air.sound(); s.addeventlistener(air.event.complete, onsoundloaded); var req = new air.urlrequest("bigsound.mp3"); s.load(req); function onsoundloaded(event) var localsound = event.target; localsound.play(); Sound URLRequest Sound complete onsoundloaded() URLRequest Sound.load() onsoundloaded() Event target Sound Sound play() Internet Sound progress complete

245 ADOBE AIR HTML 238 var s = new Sound(); s.addeventlistener(air.progressevent.progress, onloadprogress); s.addeventlistener(air.event.complete, onloadcomplete); s.addeventlistener(air.ioerrorevent.io_error, onioerror); var req = new air.urlrequest("bigsound.mp3"); s.load(req); function onloadprogress(event) var loadedpct = Math.round(100 * (event.bytesloaded / event.bytestotal)); air.trace("the sound is " + loadedpct + "% loaded."); function onloadcomplete(event) var localsound = event.target; localsound.play(); function onioerror(event) air.trace("the sound could not be loaded: " + event.text); Sound progress complete Sound.load() progress onsoundloadprogress() ProgressEvent bytesloaded bytestotal Sound bytesloaded bytestotal Sound ioerror onioerror() AIR JavaScript SWF SWF HTML <script> SWF runtime.flash.display.loader SWF SWF SWF SWF SWF ActionScript DrumSound var drum = new DrumSound(); var channel = drum.play(); DrumSound flash.media.sound Sound play()

246 ADOBE AIR HTML 239 SoundMixer.bufferTime buffertime SoundMixer.bufferTime 1000 buffertime SoundMixer.bufferTime SoundLoaderContext buffertime Sound.load() var s = new air.sound(); var url = " var req = new air.urlrequest(url); var context = new air.soundloadercontext(8000, true); s.load(req, context); s.play(); AIR AIR Sound.isBuffering Sound sampledata sampledata SampleDataEvent Sound sampledata Sound Sound Sound play() sampledata Sound mp3 SampleDataEvent data ByteArray data Sound ,100 ByteArray.writeFloat() sampledata data var mysound = new air.sound(); mysound.addeventlistener(air.sampledataevent.sample_data, sinewavegenerator); mysound.play(); function sinewavegenerator(event) for (i = 0; i < 8192; i++) var n = Math.sin((i + event.position) / Math.PI / 4); event.data.writefloat(n); event.data.writefloat(n);

247 ADOBE AIR HTML 240 Sound.play() SoundChannel.stop() AIR (SampleDataEvent.position / 44.1) - SoundChannelObject.position SampleDataEvent data sampledata SoundComplete mp3 Sound.extract() Sound Sound MP3 upoctave() var mysound = new air.sound(); var sourcesnd = new air.sound(); var urlreq = new air.urlrequest("test.mp3"); sourcesnd.load(urlreq); sourcesnd.addeventlistener(air.event.complete, loaded); function loaded(event) mysound.addeventlistener(sampledataevent.sample_data, processsound); mysound.play(); function processsound(event) var bytes = new air.bytearray(); sourcesnd.extract(bytes, 8192); event.data.writebytes(upoctave(bytes)); function upoctave(bytes) var returnbytes = new air.bytearray(); bytes.position = 0; while(bytes.bytesavailable > 0) returnbytes.writefloat(bytes.readfloat()); returnbytes.writefloat(bytes.readfloat()); if (bytes.bytesavailable > 0) bytes.position += 8; return returnbytes; sampledata Sound Sound Sound.extract() Sound.play() SoundChannel

248 ADOBE AIR HTML 241 Sound Sound.play() var req = new air.urlrequest("smallsound.mp3"); var snd = new air.sound(req); snd.play(); SoundChannel SoundMixer SoundTransform SoundChannel SoundChannel.position Sound.play() SoundChannel Sound.play() starttime Sound.play() loops starttime loops Sound.play() var req = new air.urlrequest("repeatingsound.mp3"); var snd = new air.sound(); snd.play(1000, 3); 1 var req = new air.urlrequest("bigsound.mp3"); var snd = new air.sound(req); var channel = snd.play(); channel position var pauseposition = channel.position; channel.stop(); channel = snd.play(pauseposition);

249 ADOBE AIR HTML 242 SoundChannel soundcomplete var snd = new air.sound("smallsound.mp3"); var channel = snd.play(); s.addeventlistener(air.event.sound_complete, onplaybackcomplete); public function onplaybackcomplete(event) air.trace("the sound has finished playing."); SoundChannel progress SoundChannel.position var playbackpercent = 100 * (channel.position / snd.length); Sound.length Sound bytesloaded bytestotal var estimatedlength = Math.ceil(snd.length / (snd.bytesloaded / snd.bytestotal)); var playbackpercent = 100 * (channel.position / estimatedlength); setinterval() var snd = new air.sound(); var url = " var req = new air.urlrequest(url); snd.load(req); var channel = snd.play(); var timer = setinterval(monitorprogress, 100); snd.addeventlistener(air.event.sound_complete, onplaybackcomplete); function monitorprogress(event) var estimatedlength = Math.ceil(snd.length / (snd.bytesloaded / snd.bytestotal)); var playbackpercent = Math.round(100 * (channel.position / estimatedlength)); air.trace("sound playback is " + playbackpercent + "% complete."); function onplaybackcomplete(event) air.trace("the sound has finished playing."); clearinterval(timer); snd.play() SoundChannel channel monitorprogress() setinterval() SoundChannel soundcomplete monitorprogress() onplaybackcomplete() setinterval()

250 ADOBE AIR HTML 243 SoundChannel stop() Sound.close() SoundChannel mp3 SoundChannel SoundChannel leftpeak rightpeak SoundChannel SoundMixer SoundChannel pan pan SoundTransform SoundTransform play() play() SoundTransform SoundChannel var req = new air.urlrequest("bigsound.mp3"); var snd = new air.sound(req); var trans = new air.soundtransform(0.6, -1); var channel = snd.play(0, 1, trans); SoundTransform pan volume SoundChannel soundtransform SoundMixer soundtransform SoundMixer.soundTransform = new air.soundtransform(1, -1); SoundTransform Microphone 248

251 ADOBE AIR HTML 244 var snd = new air.sound(); var req = new air.urlrequest("bigsound.mp3"); snd.load(req); var pancounter = 0; var trans = new air.soundtransform(1, 0); var channel = snd.play(0, 1, trans); channel.addeventlistener(air.event.sound_complete, onplaybackcomplete); var timer = setinterval(panner, 100); function panner() trans.pan = Math.sin(panCounter); channel.soundtransform = trans; // or SoundMixer.soundTransform = trans; pancounter += 0.05; function onplaybackcomplete(event) clearinterval(timer); 1 0 SoundTransform snd.play() SoundTransform panner() panner() Math.sin() -1 1 SoundTransform.pan SoundTransform pan soundtransform SoundTransform mp3 bigsound.mp3 SoundMixer soundtransform SoundChannel mp3 ID3 mp3 ID3 Sound mp3 ID3 Event.ID3 Event.ID3 Sound.id3 ID3

252 ADOBE AIR HTML 245 var s = new air.sound(); s.addeventlistener(air.event.id3, onid3inforeceived); var urlreq = new air.urlrequest("mysound.mp3"); s.load(urlreq); function onid3inforeceived(event) var id3 = event.target.id3; air.trace("received ID3 Info:"); for (propname in id3) air.trace(propname + " = " + id3[propname]); Sound id3 ID3 onid3inforeceived() onid3inforeceived() Event Sound Sound id3 SoundMixer.computeSpectrum() SoundChannel SoundMixer.computeSpectrum() SoundChannel ByteArray FFTMode true SoundMixer.computeSpectrum() (FFT)

253 ADOBE AIR HTML 246 FFTMode true false computespectrum() computespectrum() stretchfactor computespectrum() stretchfactor khz stretchfactor khz khz stretchfactor computespectrum() 256 SoundMixer.computeSpectrum()

chapter 2 HTML5 目錄iii HTML HTML HTML HTML HTML canvas

chapter 2 HTML5 目錄iii HTML HTML HTML HTML HTML canvas Contents 目錄 chapter 1 1-1... 1-2 1-2... 1-3 HTML5... 1-3... 1-5 1-3... 1-9 Web Storage... 1-9... 1-10 1-4 HTML5... 1-14... 1-14... 1-15 HTML5... 1-15... 1-15... 1-16 1-5... 1-18 Apps... 1-18 HTML5 Cache

More information

Adobe AIR 安全性

Adobe AIR 安全性 ADOBE AIR http://help.adobe.com/zh_cn/legalnotices/index.html iii............................................................................................ 1............................................................................................

More information

1. 2. Flex Adobe 3.

1. 2. Flex Adobe 3. 1. 2. Flex Adobe 3. Flex Adobe Flex Flex Web Flex Flex Flex Adobe Flash Player 9 /rich Internet applications/ria Flex 1. 2. 3. 4. 5. 6. SWF Flash Player Flex 1. Flex framework Adobe Flex 2 framework RIA

More information

05 01 accordion UI containers 03 Accordion accordion UI accordion 54

05 01 accordion UI containers 03 Accordion accordion UI accordion 54 jquery UI plugin Accordion 05 01 accordion UI containers 03 Accordion accordion UI accordion 54 05 jquery UI plugin 3-1

More information

Adobe® Flash® 的 Adobe® ActionScript® 3.0 程式設計

Adobe® Flash® 的 Adobe® ActionScript® 3.0 程式設計 337 18 Adobe Flash CS4 Professional MovieClip ActionScript Flash ActionScript Flash Flash Flash MovieClip MovieClip ActionScript ( ) MovieClip Flash Sprite ActionScript MovieClip ActionScript 3.0 Shape

More information

關於本書 l 3 PhoneGap Appcelerator Titanium Sencha Touch (wrapper framework) Native App PhoneGap Build Native App Hybrid App Java Objective-C Android SDK

關於本書 l 3 PhoneGap Appcelerator Titanium Sencha Touch (wrapper framework) Native App PhoneGap Build Native App Hybrid App Java Objective-C Android SDK 2 l 跨裝置網頁設計 Android ios Windows 8 BlackBerry OS Android HTML 5 HTML 5 HTML 4.01 HTML 5 CSS 3 CSS 3 CSS 2.01 CSS 3 2D/3D PC JavaScript

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

Microsoft Word - 改版式网页全文.doc

Microsoft Word - 改版式网页全文.doc 第 4 章 Dreamweaver CS3 高 级 篇 4.1 表 单 概 述 表 单 是 用 来 收 集 浏 览 者 的 用 户 名 密 码 E-mail 地 址 个 人 爱 好 和 联 系 地 址 等 用 户 信 息 的 输 入 区 域 集 合 浏 览 者 填 写 表 单 的 方 式 一 般 是 输 入 文 本 选 择 单 选 按 钮 或 复 选 框 以 及 从 下 拉 列 表 框 中 选 择

More information

p.2 1 <HTML> 2 3 <HEAD> 4 <TITLE> </TITLE> 5 </HEAD> 6 7 <BODY> 8 <H3><B> </B></H3> 9 <H4><I> </I></H4> 10 </BODY> </HTML> 1. HTML 1. 2.

p.2 1 <HTML> 2 3 <HEAD> 4 <TITLE> </TITLE> 5 </HEAD> 6 7 <BODY> 8 <H3><B> </B></H3> 9 <H4><I> </I></H4> 10 </BODY> </HTML> 1. HTML 1. 2. 2005-06 p.1 HTML HyperText Mark-up Language 1. HTML Logo, Pascal, C++, Java HTML 2. HTML (tag) 3. HTML 4. HTML 1. HTML 2. 3. FTP HTML HTML html 1. html html html cutehtmleasyhtml 2. wyswyg (What you see

More information

5-1 nav css 5-2

5-1 nav css 5-2 5 HTML CSS HTML CSS Ê Ê Ê Ê 5-1 nav css 5-2 5-1 5 5-1-1 5-01 css images 01 index.html 02 5-3 style.css css 03 CH5/5-01/images 04 images index.html style.css 05

More information

關於本書 Part 3 CSS XHTML Ajax Part 4 HTML 5 API JavaScript HTML 5 API Canvas API ( ) Video/Audio API ( ) Drag and Drop API ( ) Geolocation API ( ) Part 5

關於本書 Part 3 CSS XHTML Ajax Part 4 HTML 5 API JavaScript HTML 5 API Canvas API ( ) Video/Audio API ( ) Drag and Drop API ( ) Geolocation API ( ) Part 5 網頁程式設計 HTML JavaScript CSS HTML JavaScript CSS HTML 5 JavaScript JavaScript HTML 5 API CSS CSS Part 1 HTML HTML 5 API HTML 5 Apple QuickTime Adobe Flash RealPlayer Ajax XMLHttpRequest HTML 4.01 HTML 5

More information

untitled

untitled JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE

More information

無障礙網頁開發規範二版(草案)

無障礙網頁開發規範二版(草案) 國 家 通 訊 傳 播 委 員 會 無 障 礙 網 頁 開 發 規 範 2.0 版 ( 草 案 ) 委 辦 單 位 : 國 家 通 訊 傳 播 委 員 會 執 行 單 位 : 中 華 民 國 資 訊 軟 體 協 會 中 華 民 國 1 0 3 年 0 5 月 I II 目 錄 壹 前 言... 1 貳 適 用 範 圍... 2 參 用 語 釋 義... 3 肆 規 範 內 文... 14 一 規 範

More information

13 根 据 各 种 网 络 商 务 信 息 对 不 同 用 户 所 产 生 的 使 用 效 用, 网 络 商 务 信 息 大 致 可 分 为 四 级, 其 中 占 比 重 最 大 的 是 ( A ) A 第 一 级 免 费 信 息 B 第 二 级 低 收 费 信 息 C 第 三 级 标 准 收 费

13 根 据 各 种 网 络 商 务 信 息 对 不 同 用 户 所 产 生 的 使 用 效 用, 网 络 商 务 信 息 大 致 可 分 为 四 级, 其 中 占 比 重 最 大 的 是 ( A ) A 第 一 级 免 费 信 息 B 第 二 级 低 收 费 信 息 C 第 三 级 标 准 收 费 助 理 电 子 商 务 考 试 真 题 试 题 第 一 部 分 : 理 论 部 分 一 单 项 选 择 题 1 ( B ) 是 信 息 系 统 的 核 心 组 成 部 分 A 逻 辑 模 型 B 数 据 库 C 概 念 模 型 D 以 上 全 部 2 ping www.163.com -t 中 参 数 t 的 作 用 是 :( A ) A 进 行 连 续 测 试 B 在 新 窗 口 中 显 示 C

More information

Internet Explorer 10

Internet Explorer 10 Internet Explorer 10 Windows Internet Explorer 10 Internet Explorer 10 Internet Explorer 10 Windows Windows 8 Internet Explorer 10 Windows Internet Explorer 10 Modern Desktop Windows 8 Internet Explorer

More information

使用 Adobe® Flash® CS4 Professional 开发 Adobe® AIR™ 1.5 应用程序

使用 Adobe® Flash® CS4 Professional 开发 Adobe® AIR™ 1.5 应用程序 ADOBE FLASH CS4 PROFESSIONAL ADOBE AIR 1.5 2008 Adobe Systems Incorporated. Adobe Flash CS4 Adobe AIR 1.5 Adobe Systems Incorporated Adobe Systems Incorporated Adobe Systems Incorporated Adobe, the Adobe

More information

FileMaker 15 WebDirect 指南

FileMaker 15 WebDirect 指南 FileMaker 15 WebDirect 2013-2016 FileMaker, Inc. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker FileMaker Go FileMaker, Inc. FileMaker WebDirect FileMaker, Inc. FileMaker

More information

DATE 和 DATETIME 資 料 行 相 似 性 與 AIR 測 試 版 不 相 容...8 資 料 行 相 似 性 的 行 為 方 式 與 AIR 測 試 版 不 相 容...9 在 Mac OS 全 螢 幕 模 式 下, 重 疊 視 窗 未 能 隱 藏 停 駐 列 及 選 單 列...9

DATE 和 DATETIME 資 料 行 相 似 性 與 AIR 測 試 版 不 相 容...8 資 料 行 相 似 性 的 行 為 方 式 與 AIR 測 試 版 不 相 容...9 在 Mac OS 全 螢 幕 模 式 下, 重 疊 視 窗 未 能 隱 藏 停 駐 列 及 選 單 列...9 Adobe AIR 1.1 版 本 說 明 6/16/2008 目 錄 Adobe AIR 1.1 的 系 統 需 求... 2 AIR 1.1 特 色... 3 應 用 程 式 描 述 器 變 更...3 AIR 1.1 的 API 新 增 項 目...4 憑 證 移 轉...6 安 裝 Adobe AIR... 6 AIR 1.1 執 行 階 段 與 AIR 應 用 程 式 安 裝...6 整

More information

Microsoft Word - 最新正文.doc

Microsoft Word - 最新正文.doc 2 2 Web 2.0 Ajax StarTrackr! GPS RFID jquery JavaScript StarTrackr! JavaScript jquery 1 jquery jquery jquery JavaScript HTML jquery JavaScript jquery jquery jquery $(document).ready()! jquery jquery (document)

More information

17 Chapter Video/Audio API 17-1 <video> <audio> 17-2 <video> <audio>

17 Chapter Video/Audio API 17-1 <video> <audio> 17-2 <video> <audio> 17 Chapter 17-1 17-2 網頁程式設計 17-1 API HTMLMediaElement width heightposter ( HTML 5 http://www.w3.org/tr/html5/) error

More information

1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 ->

1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 -> 目录 1 大概思路... 1 2 创建 WebAPI... 1 3 创建 CrossMainController 并编写... 1 4 Nuget 安装 microsoft.aspnet.webapi.cors... 4 5 跨域设置路由... 4 6 编写 Jquery EasyUI 界面... 5 7 运行效果... 7 8 总结... 7 1 1 大概思路 创建 WebAPI 创建 CrossMainController

More information

(CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787

(CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787 Web (CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787 1092 1/ 16 30.75 748 2005 1 1 2005 1 1 : 1 3 100

More information

final

final 行 政 院 研 究 發 展 考 核 委 員 會 政 府 網 站 建 置 及 營 運 作 業 參 考 指 引 中 華 民 國 99 年 2 月 政 府 網 站 建 置 及 營 運 作 業 參 考 指 引 目 次 前 言 與 導 讀... 1 一. 緣 由... 1 二. 現 行 規 範 應 用 的 運 作 與 問 題... 1 三. 政 府 網 站 建 置 與 營 運 作 業 參 考 指 引 之 規

More information

互動網頁技術系列課程 HTML與CSS網站基礎設計 [12pt]

互動網頁技術系列課程 HTML與CSS網站基礎設計 [12pt] HTML CSS / 2011 HTML CSS 1/ 47 1 2 HTML 3 4 HTML 5 5 : CSS 6 CSS 7 HTML CSS 2/ 47 HTML CSS 3/ 47 ( BOM) UTF-8 Notepad++ (Winodws), Fraise/Smultron (Mac), VIM ( ) HTML CSS 4/ 47 UTF-8? UTF-8 (unicode),

More information

ebook60-13

ebook60-13 13 H T M L F l a s h J a v a < i m g > 13.1 H T M L A c t i v e X H T M L < i m g > HTML 4.0 < o b j e c t > < / o b j e c t > 13.1.1 H T M L < o b j e c t > c l a s s i d d a t a < p a r a m > 1.

More information

面向学生的帮助

面向学生的帮助 Blackboard Learn 9.1 - - 1 2012 Blackboard Inc. 6,988,138 Blackboard Learn 9.1 Service Pack 8 (SP 8) Blackboard Inc. 650 Massachusetts Avenue NW Sixth Floor Washington, DC 20001-3796 USA +1 800 424 9299

More information

A-1 HTML A-1-1 HTML 1 HTML JSP HTML HTML HTML JSP A HTML HTML HTML HTML HTML HTML HTML HTML.htm.html HTML Windows NotePad HTML IE [ / ] NotePad A-2

A-1 HTML A-1-1 HTML 1 HTML JSP HTML HTML HTML JSP A HTML HTML HTML HTML HTML HTML HTML HTML.htm.html HTML Windows NotePad HTML IE [ / ] NotePad A-2 HTML A-1 HTML A-2 A-2 HTML A-8 A-3 A-14 A-4 A-26 A-5 A-30 A-6 A-42 A-1 HTML A-1-1 HTML 1 HTML JSP HTML HTML HTML JSP A HTML HTML HTML HTML HTML HTML HTML HTML.htm.html HTML Windows NotePad HTML IE [ /

More information

本 课 程 作 为 非 计 算 机 专 业 本 科 通 识 课 程, 是 一 门 理 论 和 实 践 紧 密 结 合 的 实 用 课 程, 内 容 包 括 计 算 机 基 础 部 分 和 程 序 设 计 部 分 计 算 机 基 础 部 分 涵 盖 计 算 机 软 硬 件 组 成 数 制 表 示 操

本 课 程 作 为 非 计 算 机 专 业 本 科 通 识 课 程, 是 一 门 理 论 和 实 践 紧 密 结 合 的 实 用 课 程, 内 容 包 括 计 算 机 基 础 部 分 和 程 序 设 计 部 分 计 算 机 基 础 部 分 涵 盖 计 算 机 软 硬 件 组 成 数 制 表 示 操 计 算 机 基 础 部 程 序 设 计 类 课 程 介 绍 1. Java 语 言 程 序 设 计 Java 简 介 Java 是 一 种 开 放 的 可 以 撰 写 跨 平 台 应 用 程 序 的 面 向 对 象 的 程 序 设 计 语 言 Java 技 术 具 有 卓 越 的 通 用 性 高 效 性 平 台 移 植 性 和 安 全 性, 广 泛 应 用 于 PC 数 据 中 心 科 学 超 级

More information

Microsoft Word - ch02.doc

Microsoft Word - ch02.doc 第 2 章 认 识 Dreamweaver 8 教 学 提 示 :Dreamweaver 是 一 款 功 能 强 大 的 可 视 化 的 网 页 编 辑 与 管 理 软 件 利 用 它, 不 仅 可 以 轻 松 地 创 建 跨 平 台 和 跨 浏 览 器 的 页 面, 也 可 以 直 接 创 建 具 有 动 态 效 果 的 网 页 而 不 用 自 己 编 写 源 代 码 Dreamweaver 8

More information

HTML5

HTML5 HTML5 INTERNET3D WEBOS {serena,hsing}@nchc.org.tw HTML5 WEB 1991 HTML 1994 HTML 2 1996 CSS 1 + JavaScript 1997 HTML 4.01 1998 CSS 2 2000 XHTML 1.0 2002 + CSS 2005 AJAX (Asynchronous JavaScript And

More information

Microsoft Word - 04.doc

Microsoft Word - 04.doc 第 4 章 Dreamweaver 基 础 应 用 在 Dreamweaver 中, 创 建 网 页 非 常 简 单 用 户 只 要 熟 悉 Word 文 档 的 编 写, 就 可 以 以 所 见 即 所 得 的 方 式, 在 网 页 中 插 入 文 本 图 像 Flash 及 超 链 接 等 内 容, 从 而 制 作 出 各 式 各 样 的 网 页 本 章 将 详 细 讲 解 如 何 在 网 页

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

epub 61-2

epub 61-2 2 Web Dreamweaver UltraDev Dreamweaver 3 We b We b We Dreamweaver UltraDev We b Dreamweaver UltraDev We b We b 2.1 Web We b We b D r e a m w e a v e r J a v a S c r i p t We b We b 2.1.1 Web We b C C +

More information

59 1 CSpace 2 CSpace CSpace URL CSpace 1 CSpace URL 2 Lucene 3 ID 4 ID Web 1. 2 CSpace LireSolr 3 LireSolr 3 Web LireSolr ID

59 1 CSpace 2 CSpace CSpace URL CSpace 1 CSpace URL 2 Lucene 3 ID 4 ID Web 1. 2 CSpace LireSolr 3 LireSolr 3 Web LireSolr ID 58 2016. 14 * LireSolr LireSolr CEDD Ajax CSpace LireSolr CEDD Abstract In order to offer better image support services it is necessary to extend the image retrieval function of our institutional repository.

More information

06 01 action JavaScript action jquery jquery AJAX CSS jquery CSS jquery HTML CSS jquery.css() getter setter.css('backgroundcolor') jquery CSS b

06 01 action JavaScript action jquery jquery AJAX CSS jquery CSS jquery HTML CSS jquery.css() getter setter.css('backgroundcolor') jquery CSS b 06 01 action JavaScript action jquery jquery AJAX 04 4-1 CSS jquery CSS jquery HTML CSS jquery.css() getter setter.css('backgroundcolor') jquery CSS background-color camel-cased DOM backgroundcolor.css()

More information

RUN_PC連載_8_.doc

RUN_PC連載_8_.doc PowerBuilder 8 (8) Web DataWindow ( ) DataWindow Web DataWindow Web DataWindow Web DataWindow PowerDynamo Web DataWindow / Web DataWindow Web DataWindow Wizard Web DataWindow Web DataWindow DataWindow

More information

第 4 章 XMLHttpRequest 对象 AJAX AJAX 2 iframe AJAX iframe XMLHttpRequest JavaScript iframe AJAX XMLHttpRequest XMLHttpRequest Server Access Object Web XM

第 4 章 XMLHttpRequest 对象 AJAX AJAX 2 iframe AJAX iframe XMLHttpRequest JavaScript iframe AJAX XMLHttpRequest XMLHttpRequest Server Access Object Web XM 第 4 章 XMLHttpRequest 对象 AJAX AJAX 2 iframe AJAX iframe XMLHttpRequest JavaScript iframe AJAX XMLHttpRequest XMLHttpRequest Server Access Object Web XMLHttpRequest 64 第 Ⅱ 部分动态表示 : 用户接口与服务器之间的通信 4.1 Microsoft

More information

F477

F477 FrontPage & Flash 連 CSIE, NTU September 15, 2007 Outline September 15, 2007 Page 2 連 FrontPage September 15, 2007 Page 3 連 FTP Email FrontPage HTML tag September 15, 2007 Page 4 連 September

More information

ii Vue Bootstrap 4 ES 6 Vue Vue Bootstrap 4 ES 6 Vue 2 vue html vue html vue Vue HTML 5 CSS ES 6 HTML 5 CSS Visual Studio Code h

ii Vue Bootstrap 4 ES 6 Vue Vue Bootstrap 4 ES 6 Vue 2 vue html vue html vue Vue HTML 5 CSS ES 6 HTML 5 CSS Visual Studio Code h ii Vue Bootstrap 4 ES 6 Vue Vue Bootstrap 4 ES 6 Vue 2 vue010101.html vue010104.html vue0101 01 04 Vue HTML 5 CSS ES 6 HTML 5 CSS Visual Studio Code https://code.visualstudio.com/ Chrome XAMP Visual Studio

More information

XHTML width/height bdo a code href object charset codebase hreflang archive lang type alt dir name name xml:lang rel/rev align shape/coords hspace/vsp

XHTML width/height bdo a code href object charset codebase hreflang archive lang type alt dir name name xml:lang rel/rev align shape/coords hspace/vsp XHTML CSS CSS CSS DOCTYPE Switch XHTML width/height bdo a code href object charset codebase hreflang archive lang type alt dir name name xml:lang rel/rev align shape/coords hspace/vspace big tabindex accesskey

More information

RUN_PC連載_10_.doc

RUN_PC連載_10_.doc PowerBuilder 8 (10) Jaguar CTS ASP Jaguar CTS PowerDynamo Jaguar CTS Microsoft ASP (Active Server Pages) ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar CTS ASP Jaguar Server ASP

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション Perl CGI 1 Perl CGI 2 Perl CGI 3 Perl CGI 4 1. 2. 1. #!/usr/local/bin/perl 2. print "Content-type: text/html n n"; 3. print " n"; 4. print " n"; 3. 4.

More information

VB程序设计教程

VB程序设计教程 高 等 学 校 教 材 Visual Basic 程 序 设 计 教 程 魏 东 平 郑 立 垠 梁 玉 环 石 油 大 学 出 版 社 内 容 提 要 本 书 是 按 高 等 学 校 计 算 机 程 序 设 计 课 程 教 学 大 纲 编 写 的 大 学 教 材, 主 要 包 括 VB 基 础 知 识 常 用 程 序 结 构 和 算 法 Windows 用 户 界 面 设 计 基 础 文 件 处

More information

Microsoft Word - 28935样章.dot

Microsoft Word - 28935样章.dot 21 世 纪 高 职 高 专 规 划 教 材 系 列 何 福 贵 张 梅 编 著 机 械 工 业 出 版 社 IV 本 书 全 面 地 介 绍 了 网 页 制 作 技 术 及 其 相 关 理 论 全 书 共 分 12 章, 包 括 绪 论 网 站 的 创 建 与 管 理 网 页 基 本 元 素 实 现 网 页 页 面 布 局 实 现 表 单 的 应 用 CSS 与 模 板 使 用 Div 和 AP

More information

Microsoft Word - PHP7Ch01.docx

Microsoft Word - PHP7Ch01.docx PHP 01 1-6 PHP PHP HTML HTML PHP CSSJavaScript PHP PHP 1-6-1 PHP HTML PHP HTML 1. Notepad++ \ch01\hello.php 01: 02: 03: 04: 05: PHP 06:

More information

untitled

untitled 12-1 -2 VC# Web Blog 12-1 -1-1 12-1.1-1 C:\ ChartModuleSample_CSharp\Application\2001\ Files\ 4096 KB 120 Web.Config httpruntime maxrequestlength executiontimeout 12-2

More information

untitled

untitled PowerBuilder Tips 利 PB11 Web Service 年度 2 PB Tips PB9 EAServer 5 web service PB9 EAServer 5 了 便 web service 來說 PB9 web service 力 9 PB11 release PB11 web service 力更 令.NET web service PB NVO 論 不 PB 來說 說

More information

2010 12 7 : :4.9s :44 7, 320KB Velocity 2010 Google -- Don t Let Third Parties Slow You Down : Third-party Publisher site % Impact Digg services.newsweek.com 14 Digg realtalkny.uproxx.com 9 FriendConnect

More information

使用 Scene7 Media Portal

使用 Scene7 Media Portal ADOBE SCENE7 MEDIA PORTAL http://help.adobe.com/zh_cn/legalnotices/index.html 2012/10/26 iii 1 : Media Portal.........................................................................................................

More information

使用 Scene7 Media Portal

使用 Scene7 Media Portal ADOBE SCENE7 MEDIA PORTAL 2012/10/25 http://help.adobe.com/zh_tw/legalnotices/index.html 2012/10/25 iii 1 Media Portal.........................................................................................................

More information

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6 www.brainysoft.net 1.JasperReport ireport...4 1.1 JasperReport...4 1.2 ireport...4 2....4 2.1 JDK...4 2.1.1 JDK...4 2.1.2 JDK...5 2.1.3 JDK...5 2.2 ant...6 2.2.1 ant...6 2.2.2 ant...6 2.3 JasperReport...7

More information

Professional Ajax Ajax Adaptive Path, LLC Jesse James Garrett Ajax php Garrett WebG

Professional Ajax Ajax Adaptive Path, LLC Jesse James Garrett Ajax   php Garrett WebG 1 何謂 Ajax? 2001 2005World Wide Web Web Google Google Google Labhttp:// labs.google.com Google LabGoogle Suggest Google Maps JavaScript remotingweb Professional Ajax Ajax 2005 2Adaptive Path, LLC Jesse

More information

How to use CSS CSS3 CSS3 CSS3 P.012 -webkit- -webkit- -moz- -webkit- -webkit- -o- -ms- HTML XHTML TIPS 010

How to use CSS CSS3 CSS3 CSS3 P.012 -webkit- -webkit- -moz- -webkit- -webkit- -o- -ms- HTML XHTML TIPS 010 How to use CSS3 2011 4 CSS3 CSS3 CSS3 P.012 -webkit- -webkit- -moz- -webkit- -webkit- -o- -ms- HTML XHTML TIPS 010 W3C CSS3 TIPS CSS3 CSS2.1 CSS3 CSS current work http://www.w3.org/stle/css/current-work.en.html

More information

新・解きながら学ぶJava

新・解きながら学ぶJava 481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --

More information

2 SGML, XML Document Traditional WYSIWYG Document Content Presentation Content Presentation Structure Structure? XML/SGML 3 2 SGML SGML Standard Gener

2 SGML, XML Document Traditional WYSIWYG Document Content Presentation Content Presentation Structure Structure? XML/SGML 3 2 SGML SGML Standard Gener SGML HTML XML 1 SGML XML Extensible Markup Language XML SGML Standard Generalized Markup Language, ISO 8879, SGML HTML ( Hypertext Markup Language HTML) (Markup Language) (Tag) < > Markup (ISO) 1986 SGML

More information

09 (File Processes) (mkdir) 9-3 (createnewfile) 9-4 (write) 9-5 (read) 9-6 (deletefile) 9-7 (deletedir) (Exercises)

09 (File Processes) (mkdir) 9-3 (createnewfile) 9-4 (write) 9-5 (read) 9-6 (deletefile) 9-7 (deletedir) (Exercises) 09 (File Processes) 9-1 9-2 (mkdir) 9-3 (createnewfile) 9-4 (write) 9-5 (read) 9-6 (deletefile) 9-7 (deletedir) (Exercises) Java Servlet 9-1 Servlet (File Processes) Client Servlet Servlet Java Java (Stream)

More information

bootstrap - 2

bootstrap - 2 RITA TEACHING Bootstra p ENTER bootstrap - 2 bootstrap - 3 bootstrap 101 Template

More information

TWLOM060929

TWLOM060929 TWLOM 2006.09.29 TWLOM TWLOM 2 TWLOM TW LOM TW LOM (Taiwan Learning Object Metadata) Learning Object Metadata (IEEE 1484.12.1-2002 LOM v1.0) (learning object) LOM LOM SCORM CanCore UK LOM Core TW LOM 4

More information

基于CDIO一体化理念的课程教学大纲设计

基于CDIO一体化理念的课程教学大纲设计 Java 语 言 程 序 设 计 课 程 教 学 大 纲 Java 语 言 程 序 设 计 课 程 教 学 大 纲 一 课 程 基 本 信 息 1. 课 程 代 码 :52001CC022 2. 课 程 名 称 :Java 语 言 程 序 设 计 3. 课 程 英 文 名 称 :Java Programming 4. 课 程 类 别 : 理 论 课 ( 含 实 验 上 机 或 实 践 ) 5. 授

More information

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986

More information

Microsoft Word - connect_pro_7_release_notes_v3_handoff_to_loc.doc

Microsoft Word - connect_pro_7_release_notes_v3_handoff_to_loc.doc Adobe Acrobat Connect Pro 7 发 行 说 明 欢 迎 使 用 Adobe Acrobat Connect Pro 7 本 文 档 包 含 了 Connect Pro 文 档 中 未 涵 盖 的 最 新 发 布 的 产 品 信 息 ; 当 有 更 多 信 息 时, 可 能 会 更 新 本 文 档 目 录 关 于 Adobe Acrobat Connect Pro Adobe

More information

目 录 目 录... 2 1 平 台 概 述... 3 2 技 术 架 构... 4 3 技 术 特 点... 7 3.1 基 于 统 一 平 台 的 多 产 品 线 支 撑... 7 3.2 先 进 性... 7 3.3 安 全 性... 7 3.4 开 放 性... 8 3.5 高 性 能 和

目 录 目 录... 2 1 平 台 概 述... 3 2 技 术 架 构... 4 3 技 术 特 点... 7 3.1 基 于 统 一 平 台 的 多 产 品 线 支 撑... 7 3.2 先 进 性... 7 3.3 安 全 性... 7 3.4 开 放 性... 8 3.5 高 性 能 和 致 远 协 同 管 理 软 件 V5 平 台 白 皮 书 北 京 致 远 协 创 软 件 有 限 公 司 2014 年 6 月 1 / 20 目 录 目 录... 2 1 平 台 概 述... 3 2 技 术 架 构... 4 3 技 术 特 点... 7 3.1 基 于 统 一 平 台 的 多 产 品 线 支 撑... 7 3.2 先 进 性... 7 3.3 安 全 性... 7 3.4 开 放

More information

國家圖書館典藏電子全文

國家圖書館典藏電子全文 EAI EAI Middleware EAI 3.1 EAI EAI Client/Server Internet,www,Jav a 3.1 EAI Message Brokers -Data Transformation Business Rule XML XML 37 3.1 XML XML XML EAI XML 1. XML XML Java Script VB Script Active

More information

Inkscape教學

Inkscape教學 GNU GPL Illustrator CorelDRAW W3C SVG SVG Scalable Vector Graphics 1024 768 1024 768 Flash TrueType Flash SVG XML Inkscape SVG Windows GNU/Linux Mac OS X SVG SVG Inkscape 0.45.1 GNU General Public License

More information

XML/DTD (1) XML (Markup) SGML HTML XML XML XML 2004/7/ All Rights Reserved 2

XML/DTD (1) XML (Markup) SGML HTML XML XML XML 2004/7/ All Rights Reserved 2 XML/DTD (1) XML (Markup) SGML HTML XML XML XML 2004 All Rights Reserved 2 SGML Standard Generalized Markup Language ( ) XML Extensible Markup Language HTML HyperText Markup Language 2004 All Rights Reserved

More information

ASP 電子商務網頁設計

ASP 電子商務網頁設計 Flash Flash CSIE, NTU December 22, 2007 Outline & Flash National Taiwan University December 22, 2007 Page 2 Outline & Flash National Taiwan University December 22, 2007 Page 3 Course Introduction (1/3)

More information

基于UML建模的管理管理信息系统项目案例导航——VB篇

基于UML建模的管理管理信息系统项目案例导航——VB篇 PowerBuilder 8.0 PowerBuilder 8.0 12 PowerBuilder 8.0 PowerScript PowerBuilder CIP PowerBuilder 8.0 /. 2004 21 ISBN 7-03-014600-X.P.. -,PowerBuilder 8.0 - -.TP311.56 CIP 2004 117494 / / 16 100717 http://www.sciencep.com

More information

Blackboard Learn 9.1 - Help for Instructors

Blackboard Learn 9.1 - Help for Instructors Blackboard Learn 环 境 > 关 于 使 用 Blackboard Learn Blackboard Learn 环 境 关 于 使 用 Blackboard Learn Blackboard Learn 是 一 个 功 能 强 大 的 基 于 Web 的 学 习 应 用 程 序 其 环 境 包 括 : 显 示 有 关 当 前 屏 幕 信 息 的 页 面 标 题 允 许 快 速 访

More information

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii 前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii C# 7 More Effective C# C# C# C# C# C# Common Language Runtime CLR just-in-time

More information

Chapter V.S. PC

Chapter V.S. PC Chapter 14 14-1 V.S. PC 14-2 14-3 14-4 14-1 V.S. PC PC PC Yahoo! PC (https://tw.yahoo.com/) Yahoo! (https:// tw.mobi.yahoo.com/) Yahoo! a b a PC b PC PC Flash HTML5 CSS3 PC 14-2 14-3 PC PC Yahoo! PC https://tw.yahoo.com/

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-065Big5 Title : Sun Certified Programmer for the Java 2 Platform, SE 6.0 Version : Demo 1 / 14 1. 35. String #name = "Jane Doe"; 36. int

More information

中国软件2013校园招聘通知

中国软件2013校园招聘通知 中 国 软 件 2014 校 园 招 聘 通 知 公 司 介 绍 中 国 软 件 与 技 术 服 务 股 份 有 限 公 司 成 立 于 1980 年 ( 公 司 简 称 : 中 软 股 票 简 称 : 中 国 软 件 股 票 代 码 :600536), 是 中 央 管 理 的 国 有 重 要 骨 干 企 业 中 国 电 子 信 息 产 业 集 团 有 限 公 司 (CEC) 控 股 的 大 型 高

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

Learning Java

Learning Java Java Introduction to Java Programming (Third Edition) Prentice-Hall,Inc. Y.Daniel Liang 2001 Java 2002.2 Java2 2001.10 Java2 Philip Heller & Simon Roberts 1999.4 Java2 2001.3 Java2 21 2002.4 Java UML 2002.10

More information

epub 79-1

epub 79-1 1 XML X M L X M L X M L We b 1.1 markup language M L M L A S C I I A S C I I C 0 0 0 1 F C R - L F M S - D O S M S - Wi n d o w s U n i x L F M a c O S C R A S C I I A S C I I -. - -. C C + + { }. b e

More information

ebook111-4

ebook111-4 Flash 4 Flash 4 F l a s h 5 Flash 4 Flash Flash 4 Flash 4 Flash 4 4.1 Flash 4 Flash 4 Flash 4 Flash Flash 4 Flash 4 4.2 Flash 4 Flash 4 A Flash 4 S h i f t F i l e P r e f e r e n c e s > > Flash 4 Flash

More information

<4D6963726F736F667420576F7264202D20C9CFBAA3CAD0BCC6CBE3BBFAB5C8BCB6BFBCCAD4C8FDBCB6BFBCCAD4B4F3B8D95FBDA8D2E9B8E55F5F303632352E646F63>

<4D6963726F736F667420576F7264202D20C9CFBAA3CAD0BCC6CBE3BBFAB5C8BCB6BFBCCAD4C8FDBCB6BFBCCAD4B4F3B8D95FBDA8D2E9B8E55F5F303632352E646F63> 上 海 市 高 等 学 校 计 算 机 等 级 考 试 ( 三 级 ) 考 试 大 纲 -- 建 议 稿 -- 2007-6-25 25 目 录 上 海 市 高 等 学 校 计 算 机 等 级 考 试 三 级 总 体 说 明 -----------------1 三 级 ( 计 算 机 系 统 与 网 络 技 术 ) 考 试 大 纲 ---------------------2 三 级 ( 管 理

More information

WinMDI 28

WinMDI 28 WinMDI WinMDI 2 Region Gate Marker Quadrant Excel FACScan IBM-PC MO WinMDI WinMDI IBM-PC Dr. Joseph Trotter the Scripps Research Institute WinMDI HP PC WinMDI WinMDI PC MS WORD, PowerPoint, Excel, LOTUS

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

F477

F477 FrontPage & Flash 連 CSIE, NTU September 15, 2007 Outline September 15, 2007 Page 2 F477 September 15, 2007 Page 3 September 15, 2007 Page 4 September 15, 2007 Page 5 連 September 15, 2007 Page 6 連 September

More information

Windows XP

Windows XP Windows XP What is Windows XP Windows is an Operating System An Operating System is the program that controls the hardware of your computer, and gives you an interface that allows you and other programs

More information

影視後製全攻略 Premiere Pro After Effects Encore 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS Adobe CS5 Adobe CS4 Premiere Pro After Effect

影視後製全攻略 Premiere Pro After Effects Encore 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS Adobe CS5 Adobe CS4 Premiere Pro After Effect 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS3 2010 Adobe CS5 Adobe CS4 Premiere Pro After Effects Encore 18 ii Tony Cathy 2010/8 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 iii Premiere

More information

Enrolment

Enrolment 網 上 登 記 EN 1. 我 可 否 透 過 醫 健 通 ( 資 助 ) 系 統 參 加 醫 療 劵 計 劃 疫 苗 資 助 計 劃 及 / 或 基 層 醫 療 指 南? 你 可 透 過 醫 健 通 ( 資 助 ) 系 統 登 記 加 入 醫 療 劵 計 劃 (www.hcv.gov.hk ) 疫 苗 資 助 計 劃 (www.chp.gov.hk) 及 基 層 醫 療 指 南 (www.pcdirectory.gov.hk)

More information

Mocat

Mocat 英 特 尔 杯 Mocat 基 于 html5 的 视 频 社 交 软 件 2013/11/19 一 参 赛 作 品 构 思 的 创 意 与 价 值 (1) 背 景 : 问 题 领 域 互 联 网 的 爆 炸 式 发 展, 给 人 类 的 社 交 方 式 带 来 了 巨 大 的 冲 击, 以 facebook twitter 为 代 表 的 社 交 软 件 改 变 了 数 以 亿 计 人 的 社 交

More information

Microsoft Word - EDB Panel Paper 2016 (Chi)_finalr

Microsoft Word - EDB Panel Paper 2016 (Chi)_finalr 2016 年 1 月 15 日 會 議 討 論 文 件 立 法 會 教 育 事 務 委 員 會 2016 年 施 政 報 告 教 育 局 的 政 策 措 施 行 政 長 官 在 2016 年 1 月 13 日 發 表 其 2016 年 施 政 報 告 本 文 件 旨 在 闡 述 施 政 報 告 中 有 關 教 育 事 務 的 主 要 措 施 2. 培 育 人 才 始 於 教 育 在 教 育 政 策

More information

Contents 1. IPSIDS...1... 19 2....2 IT... 21 3....2 4....3 FAQ... 26 5. 21 CISP...3 6. IPS...3 7. 2008...4 8. 2008...4...6...7 IPS Web...9...13...14...15 TOP10...16... 28... 31... 33... 37... 40... 42...

More information

Wireless Plus.book

Wireless Plus.book Seagate Wireless Plus 用 户 指 南 型 号 1AYBA2 Seagate Wireless Plus 用 户 指 南 2013 Seagate Technology LLC. 保 留 所 有 权 利 Seagate Seagate Technology Wave 徽 标 和 Seagate Media 是 Seagate Technology LLC 或 其 某 个 子 公

More information

untitled

untitled .Net ADF ArcGIS Server ESRI ( ) .NET (ADF.NET) ADF.NET Web Controls Demo .NET (ADF.NET) ADF.NET ArcGIS Web C# and VB.NET Web Server Page Layout, Map, TOC, Overview Map ArcGIS Server.NET ? GIS web ArcGIS

More information

100 1 100 5 23 100 6 15 100 7 15 24 100 7 15 4 100 7 15 100 6 15 100 7 19 9 4 1 100 7 24 100 7 27 100 7 29 100 8 1 8 5 100 8 10

100 1 100 5 23 100 6 15 100 7 15 24 100 7 15 4 100 7 15 100 6 15 100 7 19 9 4 1 100 7 24 100 7 27 100 7 29 100 8 1 8 5 100 8 10 100 1 100 5 23 100 6 15 100 7 15 24 100 7 15 4 100 7 15 100 6 15 100 7 19 9 4 1 100 7 24 100 7 27 100 7 29 100 8 1 8 5 100 8 10 http://actweb.ukn.edu.tw/webexam/frmlogin.aspx http://www.admission.ukn.edu.tw

More information

经华名家讲堂

经华名家讲堂 5.1 5.1.1 5.1.2 5.2 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 5.3 5.3.1 5.3.2 5.3.3 / 5.3.4 / 5.3.5 / 5.4 Internet 5.4.1 Internet 5.4.2 Intranet 1. 2. 1 31 5 5.1 5.1.1 Internet 1 Host 20 60 IBM 2000 2 20 60 20 60

More information

灰狐就是协作 collaboration for everyone! 灰狐 Huihoo Huihoo 是个社区, 一个协作与分享的社区, 我们关注自由 开源软件

灰狐就是协作 collaboration for everyone! 灰狐 Huihoo Huihoo 是个社区, 一个协作与分享的社区, 我们关注自由 开源软件 Allen Long ihuihoo@gmail.com 微博 : http://weibo.com/huihoo Twitter: http://twitter.com/huihoo 2011-04 灰狐就是协作 collaboration for everyone! 灰狐 Huihoo Huihoo 是个社区, 一个协作与分享的社区, 我们关注自由 开源软件 议题 目前最热的 Web 技术 :

More information

ebook215-5

ebook215-5 5 X M L X M L Document Object Model D O M 5.1 We b We b We b W 3 C W3C DOM W3C DOM D O D O M D O M D O D O M H T M L X M L 5.1.1 XML X M L X M L 5-1 X M L 112 XML 5-2 P R O D U C T P l u t o n i u m L

More information

<4D6963726F736F667420576F7264202D203120BBA5C1AACDF8BBF9B4A1B1EAD7BC2E646F63>

<4D6963726F736F667420576F7264202D203120BBA5C1AACDF8BBF9B4A1B1EAD7BC2E646F63> 概 要 本 标 准 是 中 国 广 告 协 会 的 互 动 网 络 委 员 会 主 持, 行 业 互 联 网 企 业 广 告 公 司 广 告 主 第 三 方 数 据 机 构 共 同 参 与 研 制 完 成 本 标 准 已 经 通 过 了 小 范 围 测 试 和 专 业 论 证, 并 根 据 行 业 和 相 关 部 门 的 反 馈 意 见 进 行 了 修 改, 具 备 了 行 业 试 行 的 基 础,

More information

untitled

untitled 653 JAVA 2008 11 Institution of Software Engineer... 2... 4... 4... 5... 5... 8... 8... 8... 8... 8... 9... 9... 9... 11... 13... 13... 13... 13... 15... 15... 15... 15... 16... 16... 17... 17... 17...

More information

The Applicibility of Google Maps/Earth and Urmap API to Real Estate Database* Jin-Tsong Hwang** Abstract Whether the real estate market is prosperous

The Applicibility of Google Maps/Earth and Urmap API to Real Estate Database* Jin-Tsong Hwang** Abstract Whether the real estate market is prosperous 53 73 Journal of Taiwan Land Research Vol. 9, No.2 pp. 53~73 Google Maps/Earth Urmap API * ** 95 4 7 95 7 4 摘 要 ASP Google Maps/Earth Urmap API * ** E-mail jthwang@mail.ntpu.edu.tw 53 The Applicibility

More information

untitled

untitled 1 .NET 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Response 類 Write 料 Redirect URL Response.Write("!! ives!!"); Response.Redirect("WebForm2.aspx"); (1) (2) Web Form

More information

2782_OME_KM_Cover.qxd

2782_OME_KM_Cover.qxd 数码说明书之家 2005.09.06 www.54gg.com 2 3 4 5 6 7 9 8...14...14...17...18...19...20...20...20...21...22...23...24...24...25...26...28...28...29...29...30...32...32 EVF LCD...32...33...34...34...35...35...36...36...37...38...39...40...40...41...41...42...43...44...45...45...46...47...48...49...50...50

More information

HTML5 & CSS3 色彩 背景與漸層屬性 12-1 (color property) CSS 3 color HTML opacity HTML CSS Color Module Level 3 W3C CSS

HTML5 & CSS3 色彩 背景與漸層屬性 12-1 (color property) CSS 3 color HTML opacity HTML CSS Color Module Level 3 W3C CSS 12 Chapter 12-1 12-2 12-3 HTML5 & CSS3 色彩 背景與漸層屬性 12-1 (color property) CSS 3 color HTML opacity HTML CSS Color Module Level 3 W3C CSS 3 http://www.w3.org/tr/css3-color/ 12-1-1 color ( ) (foreground color)

More information

epub 21-22

epub 21-22 2 2 F i r e w o r k s 2 3We b 2 4We b 2 5 S h o c k w a v e F l a s h f i r e w o r k s / D r e a m w e a v e r D r e a m w e a v e r F i r e w o r k s F i r e w o r k s F i r e w o r k s F i r e w o r

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)

More information