3 Replies Latest reply on Dec 14, 2010 11:23 AM by Flex harUI

    BrowserManager not working when embeded into a Html page

    anandkumar959
      Hi, 
      I executed the below code,it opens a browser n shows the values that i pass in URL.
      When i tried to embed the final swf into my own html page its not working.I tried in both IE and Firefox it shows nothing and
      some times its shows security sandbox error.
      Can some body help me how to get out of this issue.

       
      ex:http://localhost:80/deeplinking.html#firstName=XXXX&lastName=ZZZZ


      OutPut:

      FirstName:XXXX
      LsatName:ZZZZ



      My Html Code:

      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

                        id="CLVR" width="878" height="543"

                        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">

                        <param name="movie" value="deeplinking.swf" />

                        <param name="quality" value="high" />

                        <param name="bgcolor" value="#869ca7" />

                        <param name="allowScriptAccess" value="always" />

                              <param name="allowFullScreen" value="true" />
                              
                           <param name="wmode" value="transparent">

                        <embed src="deeplinking.swf" quality="high" bgcolor="#869ca7"

                              width="878" height="534" name="deeplinking" align="left"

                              play="true"

                              loop="false"

                              quality="high"

                              allowScriptAccess="always"
                             
                              wmode="transparent"
                                    
                                    allowFullScreen="true"

                              type="application/x-shockwave-flash"

                              pluginspage="http://www.adobe.com/go/getflashplayer">

                        </embed>

            </object>


      My Flex Code:
      <?xml version="1.0" encoding="utf-8"?>
      <!-- deeplinking/URLChangeLogger.mxml -->
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
          layout="vertical"
          historyManagementEnabled="false"
          creationComplete="init();"
      >  
          <mx:Script>
          <![CDATA[
              import mx.managers.BrowserManager;
              import mx.managers.IBrowserManager;
              import mx.events.BrowserChangeEvent;

              private var bm:IBrowserManager;

              private function init():void {
                  bm = BrowserManager.getInstance();

                  bm.addEventListener(BrowserChangeEvent.APPLICATION_URL_CHANGE, doEvent);
                  bm.addEventListener(BrowserChangeEvent.BROWSER_URL_CHANGE, doEvent);
                  bm.addEventListener(BrowserChangeEvent.URL_CHANGE, doEvent);

                  bm.init("", "Base title");
              }

              public function doEvent(evt:BrowserChangeEvent):void {
                  eventDG.dataProvider.addItem(evt);
              }
          ]]>
          </mx:Script>
         
          <mx:Array id="dp">
              <mx:Object label="one"/>
              <mx:Object label="two"/>
              <mx:Object label="three"/>
          </mx:Array>
          <mx:ComboBox id="cb"
              dataProvider="{dp}"
              change="bm.setFragment('selectedItem=' + cb.selectedItem.label);"
          />
          <mx:DataGrid id="eventDG"
              dataProvider="[]"
              width="100%"
              variableRowHeight="true"
              wordWrap="true"
              height="500"
          />
      </mx:Application>




      Thanks,
      anandkumar