AIR:やっぱりalphaでしょ。

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

面白くなってきた。

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

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

main.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" borderStyle="outset" alpha="0.4" creationComplete="initApp();">
    <mx:Script>
        <![CDATA[
            import flash.html.JavaScriptObject;
            function changeFontFamily():void
            {
                var doc:JavaScriptObject = html.javaScriptDocument.styleSheets;
                for (var i:int = 0; i <doc.length; i++) {
                    for( var j:int = 0; j <doc[i].cssRules.length; j++) {
                        doc[i].cssRules[j].style.fontFamily = "MS UI Gothic";
                    }
                }
            }
            function initApp():void
            {
                this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
            }
            function onMouseDown(evt:Event):void
            {
                stage.window.startMove();
            }
        ]]>

    </mx:Script>
    <mx:HBox>
        <mx:TextInput id="textBox" width="225" text="http://" change="html.location = textBox.text"/>
        <mx:Button label="移動" click="html.location = textBox.text;"/>
    </mx:HBox>
    <mx:HTML id="html" width="100%" height="100%" y="30" complete="changeFontFamily();" backgroundAlpha="0.4"/>
</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>