1 Reply Latest reply on Mar 2, 2016 12:03 PM by rezun8

    action script coding issue - how to fix ClickTAG error?

    rdale1961 Level 1

      I'm using action script 2 to make banners with a ClickTAG, and generally no problem with different codes provided by publications. I have received code today that just creates an error message and is unfamiliar. Is this action script 3 code, and if so how do I modify my banner to use the code in AS3? Flash calls out the (<) as the issue.

       

      New problem code:  <param name=”flashvars” value=”clickTAG=” .urlencode($outUrl). “>

       

      Our default ClickTAG code works well:

       

      on (release) {

      if (clickTAG.substr(0,5) == "http:") {

      getURL(clickTAG, "_blank");

      }

      }

        • 1. Re: action script coding issue - how to fix ClickTAG error?
          rezun8 Level 4

          make a MC call it "_clickTag"

          place invisible button inside this MC

          make new layer and add the following

           

          //######################################################################################## ############//

          //CLICK TAG

          //######################################################################################## ############//

          function handleClick(mouseEvent:MouseEvent):void {

              var interactiveObject:InteractiveObject = mouseEvent.target as InteractiveObject;

              var li:LoaderInfo = LoaderInfo(interactiveObject.root.loaderInfo);

              var url:String = li.parameters.clickTag;

              if (url) {

                  if (ExternalInterface.available) {

                      var userAgent:String = ExternalInterface.call('function(){ return navigator.userAgent; }');

           

           

                      if (userAgent.indexOf("MSIE") >= 0) {

                          ExternalInterface.call('window.open', url, '_blank');

                      } else {

                          navigateToURL(new URLRequest(url), '_blank');

                      }

                  } else {

                      navigateToURL(new URLRequest(url), '_blank');

                  }

              }

          }

          clickTag_btn.addEventListener(MouseEvent.MOUSE_UP,handleClick);

          //######################################################################################## ############//

           

          hope it helps you out.