Graphics Reference
In-Depth Information
just another thing to keep track of, and what if they change it for
some reason?
While I
m sure that there are plenty of solutions out there to
work around this case-sensitive issue, I went ahead and created
a class called ClickTagger to add to that list. You can download
ClickTagger on the Web site for this topic, and you can also find
the code and a detailed breakdown in Chapter 12. For now
though, a general description is that upon instantiation, it pulls
in all your clickTags, converts their names to lowercase lettering,
and arranges them in the correct order (clickTag1, clickTag2,
andsoon)foryouruse.Afteryou
'
ve created a new instance of
ClickTagger, you can assign a value to the targetWindow property,
so the clickTags will launch in the correct window (_blank, _top,
and so on). The targetWindow property has a default value of
'
the most commonly used target for ads. The last thing
to do with ClickTagger is to use the assignClickTag method to
assign listeners to your clickable objects. This method has three
parameters: element , failSafeUrl ,and tagNumber .While tagNumber
is optional and has a default value of 1 (used if you only have one
clickTag), element and failSafeUrl are required as the object to
apply the listener to and the URL to use in the event that the click-
Tag didn
_blank,
t load for some reason. In addition, the failSafeUrl
not only makes it possible to do local testing from the Flash IDE
where there isn
'
t any HTML or JavaScript passing your clickTags
in, but also works well as a safety net in case your clickTags
don
'
t load correctly after your banners are launched. The click
may not get tracked, but at least the user will make it to the
intended landing page, and after all, that is the purpose of the
banner. So with all that said, let
'
s assume that you have a ban-
ner that has two clickable elements called button1 and button2.
Likewise, you have 2 clickTags being passed in from the ad ser-
ver.Example3.1showsallthecodeneededinyour.flatomake
both buttons click out to their respective target URLs regardless
of the variant of clickTag that was used. You
'
ll also notice the
two fallback URLs ( fallBack1 and fallBack2) being passed in to
their respective places as well.
'
EXAMPLE 3.1
Using the ClickTagger tag to solve for clickTag case sensitivity
import com.flashadbook.utils.ClickTagger;
var fallBack1:String = http://www.flashadbook.com ;
var fallBack2:String = http://www.jasonfincanon.com ;
var clickTagger:ClickTagger = new
ClickTagger(stage.loaderInfo);
clickTagger.assignClickTag(button1,fallBack1,1);
clickTagger.assignClickTag(button2,fallBack2,2);
Search WWH ::




Custom Search