0 Replies Latest reply on Feb 22, 2010 11:15 AM by laxmidi

    Gulp, Parse error at '->\",\"//'  How do I Fix this?

    laxmidi Level 1



      I'm trying to get Flex and OpenX to work together. Unfortunately, I get an XML parser error when viewing the site.


      So, in order to recreate the problem on my local machine, I changed my function and hard-coded the ad as adReturn. I get parse error at '->\",\"//' on the line:

                adReturn = adReturn.replace("//]]>->","//]]>->\n");


      Any ideas as to what the problem is?


      Please see the function below:


           public function adTest():Ad {

      var xmlReturn:XML;



      var adReturn:String = "var OX_28140bee = '';

      OX_28140bee += "<"+"a href=\'http://www.joeblow.com/openx/www/delivery/ck.php?oaparams=2__bannerid=1__zoneid=4__cb=4249 2045be__oadest=http%3A%2F%2Fwww.joeblow.com\' target=\'_blank\'><"+"img src=\'http://www.joeblow.com/openx/www/delivery/ai.php?filename=mybanner.png&contenttype=png\' width=\'468\' height=\'60\' alt=\'\' title=\'\' border=\'0\' /><"+"/a><"+"div id=\'beacon_42492045be\' style=\'position: absolute; left: 0px; top: 0px; visibility: hidden;\'><"+"img src=\'http://www.joeblow.com/openx/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=4&loc=http %3A%2F%2Fwww.joeblow.com%2F&cb=42492045be\' width=\'0\' height=\'0\' alt=\'\' style=\'width: 0px; height: 0px;\' /><"+"/div>\n";







      adReturn = adReturn.replace("//]]>->","//]]>->\n");

      var infoTagsIndex:int = adReturn.indexOf('<script type="text/javascript" src=""', 0);

      adReturn = adReturn.substring(infoTagsIndex, adReturn.length);

      var wasFlash:Boolean = false;

      if(adReturn.search("<embed") == -1) {

      adReturn = adReturn.replace('></a>', '></img></a>');

      adReturn = adReturn.replace('></div>', '></img></div>');


      else {

      adReturn = adReturn.replace('></div>\n<script','></embed></div>\n<script');

      adReturn = adReturn.replace('></div>\n<noscript','></img></div>\n<noscript');

      wasFlash = true;



      adReturn = '<adXMLReturn>' + adReturn + '</adXMLReturn>';

      xmlReturn = new XML(adReturn);


      var ad:Ad;



      ad = new Ad(xmlReturn, true);


      else {

      ad = new Ad(xmlReturn);




      Alert.show(error.message + 'stacktrace: ' + error.getStackTrace(), "Error");



      else {

      Alert.show("Javascript must be enabled to view this page properly.", "Javascript Not Detected");

      xmlReturn = new XML('<root>xml</root>');



      return ad;




      Any help would be really appreciated. I'm stumped.