====> 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>
orhttp://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>
'etc > old' 카테고리의 다른 글
아이폰, 국내 출시 어렵다 (0) | 2009.06.10 |
---|---|
애플 신형 스마트폰 '아이폰3GS' 공개됐다 (0) | 2009.06.09 |
美 천재소년 "게임은 시간낭비" (0) | 2009.06.08 |
애플 개발자 행사 8일 개막, 관전포인트는? (0) | 2009.06.08 |
안드로이드 설치부터 HelloWorld까지 (0) | 2009.06.08 |