1 Reply Latest reply on Jan 24, 2011 8:48 AM by jjn_2011

    getting flashvar,embed a flash application

    jjn_2011

      Hello,

       

      I am new to flex. I have a flex application, it works fine from flash builder but when I embed this into a html page (a blog), it is not passing the flash var in the embedded code into the flash application. I browsed the archives but did not find a similar problem. Can somebody help me?

      Here is my embed code:

      <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='getUrlParam.mxml.swf?myName=Tim'>
              <embed src='getUrlParam.mxml.swf?myName=Tim' />
          </object>

       

      Here is my flex code:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx"
                     minWidth="955" minHeight="600"
                     creationComplete="initApp();">
          <fx:Declarations>

       

          </fx:Declarations>
          <fx:Script>
              <![CDATA[
                  import mx.controls.Alert;
                  import mx.core.FlexGlobals;
                 
                  [Bindable]
                  public var myFullName:String;
                  public function initApp():void
                  {
                      //Alert.show("Hello");   
                      myFullName = FlexGlobals.topLevelApplication.parameters.myName;
                      Alert("Name="+myFullName);
                  }
                 
              ]]>
          </fx:Script>
      </s:Application>

       

       

      thanks in advance