小小菜鸟的web菜园子

web开发学习。好记性不如烂笔头。每天进步一点点!

导航

如何获得FLEX程序的大小.

 loaderInfo.bytesTotal属性

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/10/29/determining-the-size-of-your-flex-application/ -->
<mx:Application name="loaderInfo_bytesTotal_test"
        xmlns:mx
="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white"
        applicationComplete
="init();">

    
<mx:Script>
        
<![CDATA[
            private function init():void {
                var bTotal:uint = loaderInfo.bytesTotal;
                lbl.text = "bytesTotal: " + numberFormatter.format(bTotal);
            }
        
]]>
    
</mx:Script>

    
<mx:NumberFormatter id="numberFormatter" />

    
<mx:Label id="lbl" />

</mx:Application>

posted on 2008-10-30 15:14  『小小菜鸟』  阅读(437)  评论(0编辑  收藏  举报