====>  html에서 flashVars를 설정한다음 flex에서 parameters 를 통해 로딩하면 됩니다.

원본 글 : http://livedocs.adobe.com/flex/3/html/help.html?content=passingarguments_3.html

IN JSP
<html>
<head>
<title>/flex2/code/wrapper/DynamicFlashVarTestWrapper.jsp</title>
<style>
body { margin: 0px;
 overflow:hidden }
</style>
</head>

<%
    String fName = (String) request.getParameter("firstname");
    String mName = (String) request.getParameter("middlename");
    String lName = (String) request.getParameter("lastname");
%>

<body scroll='no'>
<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr><td valign='top'>

<script>
<h1>Dynamic FlashVarTest Wrapper</h1>
</script>


    <object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' height='100%' width='100%'>
        <param name='src' value='../assets/FlashVarTest.swf'/>
        <param name='flashVars' value='firstname=<%= fName %>&lastname=<%= lName %>'/>
        <embed name='mySwf' src='../assets/FlashVarTest.swf' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' height='100%' width='100%' flashVars='firstname=<%= fName %>&lastname=<%= lName %>'/>
    </object>

</td></tr></table>
</body>
</html>
or 
 
http://localhost:8100/flex/myApp.swf?myName=Nick&myHometown=San%20Francisco
IN FLEX
<?xml version="1.0"?>
<!-- wrapper/IterateOverApplicationParameters.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
  <mx:Script><![CDATA[
     private function init():void {
        for (var i:String in Application.application.parameters) {
           ta1.text += i + ":" + Application.application.parameters[i] + "\n";
        }
     }
  ]]></mx:Script>
  
  <mx:TextArea id="ta1" width="300" height="200"/>

</mx:Application>

+ Recent posts