Skip navigation
MD64123
Currently Being Moderated

Having trouble creating clickable banner ad/header

Aug 16, 2013 2:30 PM

I have gone the route already of creating an invisible button for my header. All I would like to do is be able to click it and it will return the user back to the main index file without opening a new window. When I click on the swf file there is a pointer but nothing happens. Clicking does not oppen a window, or redirect anywhere. I have the following in my actions file in the layer I created.

 

clickTAG.onRelease = function(){

getURL(" http://www.domain.com", "_self");

};

 


I have also tried the following as well:

on(release) {

if (clickTAG.substr(0,4) == 'http') {

getURL(clickTAG, "http://www.domain.com", "_self");

}

}

 

I have researched and tried changing to several others but have not had any success. I am sure I am missing something simple here but can not figure it out.

 
Replies
  • Currently Being Moderated
    Aug 16, 2013 2:48 PM   in reply to MD64123

    Have you tested on a server using a browser?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 16, 2013 4:42 PM   in reply to MD64123

    The first piece of code you showed does belong on the timeline and requires that you have a button with the instance name clickTAG.

     

    The second bit of code you showed belongs attached to a button, not in the timeline.

     

    The way you use "clickTAG" in those two pieces of code is different enough to wonder how you have it implemented... is it a button or is it a piece of data that you read in from the web [age's html?  That latter is the more noral implementation, where the clkickTag value is defined in the embedding code and the Flash file extracts it and uses it in place of what you show as "http://www.domain.com"

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2013 5:20 AM   in reply to MD64123

    I can imagine they were not used together, but I cannot imagine beyond what I already explained in my last response the differences in what you did... in the first code you use it as if it is a button's instance name.  In the second you use it as if it is a string... two entirely different animals.

     

    Normally a "clickTAG" represents data that is read in from a parameter in the html embedding code.  Your actionscript extracts that string of data and processes it.  So your second approach appears to be closer to what you need, though it should be directing the getURL to use the clickTag value as the url, not some fixed url string.

     

    Your best bet to get something working is to find a clickTAG tutorial and follow it thru.  Your best bet for finding one is to use Google and search terms like "AS2 clickTAG tutorial"

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 19, 2013 4:43 PM   in reply to MD64123

    Select the invisible button on the stage and assign it an instance name in the Properties panel where it says <Instance Name>.  Let's say you assign it a name of "btn".

     

    Now create a new layer in the timeline and it that layer add the following code by selecting a frame and typing/pasting it into the Actions panel.  If you do this correctly a lowercase "a" will appear in that frame in the timeline.

     

     

    btn.onRelease = function(){

          getURL(" http://www.domain.com", "_self");

    }

     

     

    That should be all you need to do.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2013 7:24 PM   in reply to MD64123

    You're welcome

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points