참조

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001003.html
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001004.html

HTML 소스

<object
    classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
    codebase='http://download.macromedia.com/pub/shockwave/cabs/flash
        /swflash.cab#version=9,0,0,0'
    width='100%'
    height='100%'
    id='myMovie'>
    <param name='flashvars' value='fname=Nick&lname=Danger'>
    <param name='src' value='myApp.swf?myName=Nick&myHometown=San%20Francisco'>
    <embed pluginspage='http://www.macromedia.com/go/getflashplayer'
        width='300'
        height='100'
        flashvars='fname=Nick&lname=Danger'
        src='TitleTest.mxml.swf'
        name='myMovie'
        SWLIVECONNECT='true'
    />
</object>

mxml 소스
파라미터 이름으로 값 추출

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initVars()">
    <mx:Script><![CDATA[
        // Declare bindable properties in Application scope.
        [Bindable]
        public var myName:String;
        [Bindable]
        public var myHometown:String;
       
        // Assign values to new properties.
        private function initVars():void {
            myName = Application.application.parameters.myName;
            myHometown = Application.application.parameters.myHometown;
        }
    ]]></mx:Script>
   
    <mx:VBox>
    <mx:HBox>
        <mx:Label text="Name: "/>
        <mx:Label text="{myName}" fontWeight="bold"/>
    </mx:HBox>
    <mx:HBox>
        <mx:Label text="Hometown: "/>
        <mx:Label text="{myHometown}" fontWeight="bold"/>
    </mx:HBox>
    </mx:VBox>
</mx:Application>

파라미터 순서로 값 추출

for (var i:String in Application.application.parameters) {
    ta1.text += i + ":" + Application.application.parameters[i] + "\n";
}

신고


 

티스토리 툴바