13 Replies Latest reply: Jul 2, 2009 10:00 PM by griffinsdesigns.com RSS

    embedding link in banner ad

    DebK404 Community Member
      I'm new to Flash and I can't believe that I can't find this issue anywhere. I have a banner ad and I'd like to make the whole ad link to a URL. How do I do this? Thanks for your help!
        • 1. Re: embedding link in banner ad
          aniebel Community Member
          You'll need to make an invisible button and set it to go to your URL. To do this, create a new button and in the HIT frame place a keyframe and put a rectangle in it that is the same size as your banner. Leave the other states of the button blank. Then place it on the stage over your entire banner. It will look like a translucent teal rectangle. That will not show up when your banner is published. It's there as a guide.

          Give your button an instance name. For the purpose of demonstration, let's say you name it "inv_btn".

          Then create a layer called actions or as or actionscript... whatever makes sense to you.. and lock it. This is where your actionscript will go and locking it will prevent you from inadvertantly placing anything on it. Select that layer and open your actions panel. If you are using actionscript 2.0, type:

          inv_btn.onRelease = function(){
          getURL(" http://www.yourdomain.com", "_blank");

          If you are using AS 3.0, let me know.
          • 2. Re: embedding link in banner ad
            DebK404 Community Member
            Hi there - Yes, I'm using Flash CS3 so I guess that I have ActionScript 3. When I did what you explained though, I dropped the ActionScript down to the 2.0.

            I was able to get the button in there. I put it on a separate layer. When you click the banner though nothing happens. I've got two different Flash CS3 tutorial books and neither one covers this. I would have thought that this would be quite common.

            Thanks again for your help, Deb
            • 3. Re: embedding link in banner ad
              DebK404 Community Member
              Ok - here's what I did now - using ActionScript 3

              named my invisible button instance "fusion_btn"
              Made a top layer called "action"
              In the first keyframe, I put:

              var fusion_url:URLRequest = new URLRequest(" http://www.fusion2008.com");

              function fusion(event:MouseEvent):void
              navigateToURL(fusion_url, "_blank");

              fusion_btn.addEventListener(MouseEvent.CLICK, fusion);

              ***This still does not get the banner to click to fusion2008.com though.

              What am I doing wrong?
              • 4. Re: embedding link in banner ad
                aniebel Community Member
                Hi there. I just copied and pasted your code and it worked for me. Is your hand cursor showing up when you mouse-over the banner? If not, make sure your button does, in fact, have an instance name.

                BTW, using CS3 does not necessarily mean that you have to use AS3. In fact, most host sites will not allow banners that have been published for anything higher than Flash Player 7... which means no AS3. If you are in control of the site that is hosting the banner, you should have nothing to worry about, however.
                • 5. Re: embedding link in banner ad
                  DebK404 Community Member
                  Hi Amy,
                  I dropped it back to AS2 and used your original code:

                  fusion_btn.onRelease = function(){
                  getURL(" http://www.fusion2008.com", "_blank");

                  And.... it works!

                  thank you for your patience.

                  • 6. Re: embedding link in banner ad
                    aniebel Community Member
                    You're welcome! Glad it worked out. :)
                    • 7. Re: embedding link in banner ad

                      If I have an ad served by advertisers from CJ.com, would I use this same process for adding the html/javascript that is assigned to the ad I want to display on my stage area?

                      • 8. Re: embedding link in banner ad
                        aniebel Community Member
                        icarecommunity, yes, you would assuming their site is set up that way. You'll need to ask them what their specs are and if they prefer you to hard-code the landing URL into the button event-handler or do they want you to use a click tag. They may ask you to use a click tag if they are returning statistics to you or your client on click-throughs.
                        • 9. Re: embedding link in banner ad
                          icarecommunity Community Member

                          Thank you for replying back. We recently purchased the entire CS3 suite. The learning curve is going to take awhile but that's the fun part:)

                          They are sending stats back to us so we have merged this in the ActionScript 3.0 example but we are getting errors wanting the ) and the semi-colon:

                          fusion_url:URLRequest = new URLRequest(""<a href=" http://www.addomain.com/jl65ar-dfdfjdlskfjsdlfjdfovdf" target="_blank" onmouseover="window.status=' http://www.addomain.com';return true;" onmouseout="window.status=' ';return true;">
                          <img src=" http://www.addomain.com/jdfoasidfjksdnerjn;fkjs" alt="addomain.com border="0"/></a>"");

                          function fusion(event:MouseEvent):void
                          navigateToURL(fusion_url, "_blank");

                          btn1.addEventListener(MouseEvent.CLICK, fusion);
                          • 10. Re: embedding link in banner ad
                            aniebel Community Member
                            Are you sure the site will accept Flash Player version 9 SWFs? Most will not accept anything higher than version 7 which means you will have to use Actionscript 2.0, not 3.0.
                            • 11. Re: embedding link in banner ad
                              icarecommunity Community Member
                              Thank you for that information. I will try to merge the ActionScript 2.0 with the code I have from the advertiser.

                              • 12. Re: embedding link in banner ad
                                wefollow Community Member

                                May i ask you a question regard " embedding link in banner ad" or do I have to open new discussion????

                                thank you for helping other .

                                • 13. Re: embedding link in banner ad

                                  For Actionscript 3, use NavigateToURL. If you look it up in the Flash help, you will find a example to follow.