Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ClickTag

Explorer ,
Jan 08, 2008 Jan 08, 2008
It work for some old banners, but not with AS.
Am I missing something?

on (release) {
if (clickTAG.substr(0,4) == "http") {
getURL(clickTAG, "_blank");
}
}

Thanks Brian
TOPICS
ActionScript
713
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 08, 2008 Jan 08, 2008
You can't attach a piece of code directly to a button in AS3. You have to add a listener to the button and run the code from that.

- B
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 09, 2008 Jan 09, 2008
Give your button an instance name. In this example, I have named my button "tagButton".

Then add this code to the timeline:
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2008 Jan 25, 2008
I used the code suggested, and yet this isn't working. I have a button called tagButton, and I put the code into the top level timeline, and I get four compilation errors:

Access of undefined property clickTAG
call to possibly undefined method getURL
Access of undefined property clickTag
Access of undefined property tagButton

Any suggestions? This seems to be so easy; I don't know why I can't get it to work.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 25, 2008 Jan 25, 2008
Oops!...Sorry about that...I was so focused on showing you what a listener does that I didn't even consider the rest of your code. You have to declare your variables in AS3. It is very strict. Also, getURL no longer exists. Try this:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2008 Jan 29, 2008
My design specs tell me that the URL must not be in my banner design. Will the ClickTag variable that you created work with the click tracking software the same way as in AS2
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jan 29, 2008 Jan 29, 2008
LATEST
var clickTAG:String = loaderInfo.parameters.clickTAG;

tagButton.addEventListener(MouseEvent.CLICK, fireTag);
function fireTag(e:MouseEvent):void {
var request:URLRequest = new URLRequest(clickTAG);
navigateToURL(request, "_blank");
}



The actual value of 'clickTAG' will be passed in through FlashVars

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines