AIR:やっぱりalphaでしょ。

2007年6月15日 (金曜日) - 14:55:58 by webmaster

面白くなってきた。

次にやることといったら、alphaでしょ。半透明でしょ。(笑)
main-app.xml

XML:
  1. <rootContent systemChrome="none" transparent="true" visible="true">[SWF reference is generated]</rootContent>

main.mxml

XML:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" borderStyle="outset" alpha="0.4" creationComplete="initApp();">
  3.     <mx:Script>
  4.         <![CDATA[
  5.             import flash.html.JavaScriptObject;
  6.             function changeFontFamily():void
  7.             {
  8.                 var doc:JavaScriptObject = html.javaScriptDocument.styleSheets;
  9.                 for (var i:int = 0; i <doc.length; i++) {
  10.                     for( var j:int = 0; j <doc[i].cssRules.length; j++) {
  11.                         doc[i].cssRules[j].style.fontFamily = "MS UI Gothic";
  12.                     }
  13.                 }
  14.             }
  15.             function initApp():void
  16.             {
  17.                 this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
  18.             }
  19.             function onMouseDown(evt:Event):void
  20.             {
  21.                 stage.window.startMove();
  22.             }
  23.         ]]>
  24.     </mx:Script>
  25.     <mx:HBox>
  26.         <mx:TextInput id="textBox" width="225" text="http://" change="html.location = textBox.text"/>
  27.         <mx:Button label="移動" click="html.location = textBox.text;"/>
  28.     </mx:HBox>
  29.     <mx:HTML id="html" width="100%" height="100%" y="30" complete="changeFontFamily();" backgroundAlpha="0.4"/>
  30. </mx:Application>

んで、こうなる。
test3.gif

楽しいね。

Leave a Reply

XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>