4 Replies Latest reply: Aug 10, 2010 12:15 PM by Andrei1 RSS

    clickTAG: More difficult than I'm making it?

    MattOverwine Community Member

      Hello awesome forum folks.

       

      I've created plenty of banner ads in my time but am having trouble with my first AS3 clickTAG code.

       

       

      import flash.events.MouseEvent;

      clicks.addEventListener(MouseEvent.CLICK, boomShaka);

       

      function boomShaka(event:MouseEvent) {

       

      var request:URLRequest = new URLRequest(clickTAG);

      navigateToURL(request, "_blank");

      }

       

       

       

      This is the code directly from the creative requirements of the website I'm making the banners for. It errors out with:

       

      1120: Access of undefined property clickTAG.

       

      If I comment out 'clickTAG' the rest of my actionscript functions correctly. I've been stumped and checking around for two hours now. Any help would be appreciated.

       

      Message was edited by: MattOverwine

        • 1. Re: clickTAG: More difficult than I'm making it?
          PJSB_DK Community Member

          Hi

           

           

          1120: Access of undefined property clickTAG.

           

          Look at your error message again. clickTAG is undefined...Flash does not know how to cope

          with the word "clickTAG"..

          You must define it and assign a value before using it.

           

          example:

          var clickTAG:String = "TheWebPage.html";

          var request:URLRequest = new URLRequest(clickTAG);

          navigateToURL(request, "_blank");

           

          Best regards

          Peter

          • 2. Re: clickTAG: More difficult than I'm making it?
            Andrei1 Community Member

            In addition to what Peter said, clickTag is just a convention. Often it comes from FlashVars. If this is true in your case - you need to read FlashVars.

             

            By the way, it will not work in a standalone player - only in a swf embedded in HTML.

            • 3. Re: clickTAG: More difficult than I'm making it?
              MattOverwine Community Member

              Yes, I'm almost positive it's using FlashVars I'll go read up on that. As with most banners I just hand them off in swf form to the vendor/website. I've never had to worry about the actual html coding end. I'll have a look at that as well.

               

              Thanks for the help peoples.

              • 4. Re: clickTAG: More difficult than I'm making it?
                Andrei1 Community Member

                You still don't have to worry about html side - it is web developer's responsibility. I just suggest you account for the cases when clickTag is not available so that Flash doesn't throw errors. For instance:

                 

                var clickTAG:String = this.loaderInfo.parameters.clickTAG;
                // later
                function boomShaka(event:MouseEvent) {
                     // check if the variable has value
                     if (clickTAG) {
                          var request:URLRequest = new URLRequest(clickTAG);
                          navigateToURL(request, "_blank");
                     }
                }