I apologize ahead of time if:
1) This question amounts to 'do we have free will?' or ...
2) I insult anyone's intelligence by stating the painfully obvious.
So here goes ...
This is the standard clickTAG code that would be applied directly to a 'button.' This code is used by ad delivery software to route click-throughs to the appropriate web site.on (release) { getURL("http://"+clickTAG, "_blank"); }
This is a variant of the clickTAG code that I came across the other day. on (release) { if (clickTag.substr(0, 5) == "http:") { getURL(clickTag); } }
My questions are:
1) What situation would call for using substring method?
2) Is there any obvious benefit to this approach?
Thanks for any info you may be able to provide.
"_blank" is also no longer a reliable form of opening a new window from flash. You'll want axual JS to open a new window so that popup blocker/handlers can allow the domain to make pop-ups if the user so chooses.
I would have preferred to see the developer use (clickTag.indexOf("http:")==0) since we just want to see where the substring is, if it is there at all. We already know what the string is, why the heck would we test as a comparison with substr?
Plus I like to use ==0 everywhere I can in client code.
o.0
Note: The ActionScript in this Flash advertisement is verifying that the clickTAG URL begins with "http:". This is an important security measure. If you do not take this precaution, a malicious HTML page could source your SWF and pass a clickTAG URL that begins with "javascript:" or another scripting pseudo-protocol. If your ActionScript code were to call getURL with a maliciously crafted JavaScript URL, it would be possible for the site serving the malicious HTML page to obtain the contents of your HTTP cookies or perform other actions on your site's behalf.
From:http://www.adobe.com/resources/richmedia/tracking/designers_guide/
Though the examples use AS that was deprecated in Flash 6 and as I know nothing about clickTAG I can say that this information is still relevant or the best approach.
or that.
:|
:thumbsup:
excellent - thank you all. 
and special thanks for the link, Arsis. :nunchuck: