2 Replies Latest reply on Jan 11, 2010 5:39 PM by totallyuniquescreenname

    how do I add javascript to my mxml?

    totallyuniquescreenname

      I am trying to add the following javascript to my mxml flex 3 page:

      <script type=text/javascript language=Javascript src=http://gwbanner.com/gwbanner?siteCode=1534-ADMIN></script>

       

      I have tried the following code, but the <script> tags doesn't seem to be understood (the output is actually the javascript itself as if the script tag is ignored)...

       

      <mx:Text

       

       

       

      width="100%" color="blue" fontStyle="italic" fontSize="14">

           <mx:htmlText>

           <![CDATA[

                <script type=text/javascript language=Javascript src=http://gwbanner.com/gwbanner?siteCode=1534-ADMIN></script>

           ]]>

       

           </mx:htmlText>

      </mx:Text>

       

       

      I can add the javascript directly to the html i suppose, but there should be a better way no?

       

      Thanks