How to make a flash banner clickable

Index:
(1) What is a Flash banner?
(2) How do I make my Flash banner into a button?
(2.1) How-To Clickable with ActionScript3.0
(3) How do I tell if my banner is clickable?
(4) Flash Banners in Ad Butler
(5) Additional Reading


NOTE: All example file paths and URLs are for demonstration purposes and I don't recommend you stick them into address bars expecting something to happen. smile.gif


(1) What is a Flash banner?

Flash banners are different than ordinary .gif, .jpeg, or .png banners. Flash is a programming language, and every flash banner is a small application that is run by a flash-plugin installed in your browser. Typically a Flash banner is an entirely "clickable" area, that when clicked on will redirect the user viewing the banner to the advertisers desired destination.


(2) How do I make my Flash banner into a button?

One way of doing this is to create an invisible button over top of your entire Flash animation.

I will start this example from scratch.
(example done using Adobe Flash CS3 Pro, using Actionscript 1.0/2.0)

a) open up your flash file
b) add a new layer to the file, "on top" of the other layer(s)
c) select the Rectangle Tool from the vertical toolbar on the left side of your window
d) in the properties of the tool, change the stroke and fill alpha to 0%
e) draw the invisible rectangle over your entire scene
f) right click inside the rectangle and select the option "Convert to Symbol..."
g) select the "Button" option and name the button "clickTAG"
h) right click inside the rectangle (now a button), select "Actions"
i) make sure that your current selection is the button clickTAG, then copy-paste the following script:

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



j) close the action box, and export the animation as a movie by going... File > Export > Export Movie...

So you want to find out if what you just did worked? See the section (3) below.

(2.1) How-To Clickable with ActionScript3.0

The steps for creating the banner itself are fairly similar to section (2).

Once you have created a button, add the following script to the actions for that button:

import flash.net.navigateToURL;
import flash.net.URLRequest;

// adding a mouse click event listener to "yourButton"
// which calls the function "handleMouseClick" when triggered
yourButton.addEventListener(MouseEvent.CLICK, handleMouseClick);

// the function which redirects you to a new page
function handleMouseClick(event:MouseEvent):void
{
var url:String = '';
for (var paramName in root.loaderInfo.parameters)
{
// detect any "clickTAG" case just in case something nonstandard is used
// ex. clickTag, clicktag, ClickTag, etc
if (paramName.toLowerCase() == "clicktag")
{
url = root.loaderInfo.parameters[paramName];
break;
}
}
// ensure that it's actually a URL we're navigating to
if (url.substr(0,4)=="http")
{
navigateToURL(new URLRequest(url), "_blank");
}
}



To test this, see section (3) below.


(3) How do I tell if my banner is clickable?

The easiest and most effective way of testing your Flash banner in a stand-alone fashion is to manually pass it a URL and see if it redirects correctly when clicked upon.

There are two ways of doing this. You can either access the banner directly from your computer using a local directory path, or put the banner on a website.

A local path test might look like:
C:\testdirectory\test.swf?clickTAG=http://www.google.com

A website url would look like this:
http://www.mydomain.com/banner/test.swf?clickTAG=http://www.google.com

For the rest of this example I will use the test website.


To test this, stick the following URL into your browser address bar and hit enter:

http://www.mydomain.com/banner/test.swf?clickTAG=http://www.google.com

Now, if you click on the resulting Flash animation which is displayed in your browser, you will be redirected to Google. If you are NOT redirected, something is wrong with your banner button or your clickTAG script. Take careful note of the result of clicking on your banner.

-No redirect at all usually means the button has no clickTAG script at all.
-Different website than http://www.google.com usually means the banner is redirecting statically and NOT using the clickTAG parameter.
-A HTTP error, usually 404, usually means that the clickTAG script is incorrect and it is probably trying to redirect to a relative link.
For example, a relative link error in this case might look like: http://www.mydomain.com/banner/http://www.google.com -- which is clearly an invalid URL.


(4) Flash Banners in Ad Butler

The following are the general steps to adding a flash banner to a set or campaign in Ad Butler. I will use the example location from above.

Begin by navigating to the set or campaign you want to add a flash banner to.

1) click on "Add New..."
2) specify a name for the banner, "my flash banner test"
3) select "Flash (.swf)" from the Banner Type list
4) specify a destination (Destination URL): http://www.google.com
5) specify the flash location (Flash URL): http://www.mydomain.com/banner/test.swf (or if you are using the Media Library, choose from there)
6) click on Generate Script

This will create the flash object code necessary to create your flash banner on a website with the correct dimensions and clickTAG.

<object width="728" height="90" id="movie">
<param name="movie" value="http://www.mydomain.com/banner/test.swf?clickTAG=<*tracking_link*>">
<embed src="http://www.mydomain.com/banner/test.swf?clickTAG=<*tracking_link*>" quality="high" width="728" height="90" type="application/x-shockwave-flash">
</object>

You may note the "<*tracking_link*>" that shows up twice in the generated Raw HTML/Script box. This is used by Ad Butler when serving your ads, and is replaced by the specified destination URL.
If you want clicks to be tracked, it is important that you do not change the Raw HTML/Script unless you know what you are doing.

7) save the banner

Note: If your banner passed the tests in section (3), you should be done and the banner ready to rotate and track clicks.


(5) Additional Reading

Adobe's Official Resource for flash ads:
http://www.adobe.com/resources/richmedia/tracking/designers_guide/

Best practices for flash advertising:
1) http://www.adobe.com/devnet/flash/articles/flash8_bestpractices_10.html
2) http://livedocs.adobe.com/flash/9.0/UsingFlash/WSd60f23110762d6b883b18f10cb1fe1af6-7b25.html





 

Jeff AdButler No Tags

How to specify two (or more) click locations on an AdButler Ad

Tracking URL Outline

The following is a brief description of what tracking URLs are and how they work:

Every banner has it's own unique tracking URL, roughly as follows:
http://servedbyadbutler.com/redirect.spark?banID=XXXXX;CID=YYYYY;setID=ZZZZZ
To track clicks on banners, you'll need to enter the banner ID (banID), the campaign ID (CID), and the set ID (setID).

Each Flash and Raw HTML/Script banner has a bit of text and a link [click here] beneath the content of the ad that looks like the following:
"NOTE: For information and help tracking click-thrus, click here."

Clicking on that link will take you to a guide, pre-loaded with the appropriate tracking URL.
ex. Going to a banner in a campaign gives the following:
http://servedbyadbutler.com/redirect.spark?banID=519143350;CID=49714;setID=ZZZZZ

Note: At this time, a setID is required to properly track the clicks and where they came from. 

Banner Setup

  1. Navigate to the advertiser whose banner you will be creating.

    Note: If no such advertiser exists, create them with -- remember that the email and password don't need to be exact, and can be changed later.
  2. Create a campaign for the multi-clickable banner and the dummy banners, then navigate into the campaign.
  3. Create the actual banner you intend to serve normally.
  4. Create as many additional dummy banners as you require (for each link in addition to the main tracking link).
  5. Navigate to each dummy banner you have created, copy the banner # of each one, and keep track of them. (make sure to mark which is which)

    While doing so, copy the campaign # from one of them, and also keep track of it.
  6. Now navigate back to the actual banner to serve again, and modify it as follows:
    • For each tracking link needed, put <*tracking_link*>;banID=AAA;CID=BBB in, where AAA is the appropriate banner # from the previous step, and BBB is the campaign #.
  7. Now you can assign the banner to as many sets as required.

Live Example

I like using colors in examples, as they're easy to distinguish so I'll do so here as well.

In this example, I have created 3 dummy banners and the actual banner I want to serve in a campaign. I then assigned them to two separate sets.

Below is the test HTML I used. Note the banID and CID fields of each tracking link correspond to the appropriate dummy banner.

<a href="<*tracking_link*>"> main </a>
<hr>
<a href="<*tracking_link*>;banID=519157250;CID=53123"> blue </a>
<hr>
<a href="<*tracking_link*>;banID=519157249;CID=53123"> red </a>
<hr>
<a href="<*tracking_link*>;banID=519157248;CID=53123"> green </a>
<hr>

To test them out, I clicked on a bunch of the links in each set from a test website which served only those two ads. As expected, all of the clicks and views were tracked properly for the campaign!

Additionally the statistics for the test sets I created were also recorded properly.


The advertiser's campaign statistics




The set specific statistics


Themes, Templates & More

The much anticipated forum theme & template system for ActiveBoard has arrived!

On March 8th, we will be migrating all ActiveBoards to use the theme system. This will not affect your general forum usage, and may be enabled at any time at your own discretion prior to the migration.

themesystem01.png

themesystem02.png

The theme system will provide you with an improvements to the way you change the style on your forum through an on-the-fly visual style editor, individual page template editing, and theme management for keep old styles, for example, a seasonal Christmas style.

If you have any questions, or run into any problems along the way, please submit a support request or email our general[at]sparklit.com inbox and let us know! We'll have it fixed as quickly as possible.

ActiveBoard Themes & Templates

Up and coming in the wide world of ActiveBoard are some significant changes to the way that themes work, and the addition of both an on-the-fly style editing system, and a template editing back-end for the power user. Clients will be able to completely customize the way their forum looks and feels.

An overview of the new features includes:

  • Updated Administration Panel Sections
  • New Themes & Theme Selection
  • Easier-to-use Style Editor & Preview System
  • Theme Template Editor
  • Theme Backup and Storage Manager

Administration Panel

We took a good look at the options available in the Administration Panel with regard to the style of your ActiveBoard, and the options which govern how much of what displays, and the custom HTML options. The end result was a split from "Style & Appearance" into two new sections, "Theme & Style", and "Display".

The Theme & Style section encompases the browsing and selection of themes, style editing and previewing, header text and logo, forum icons, template editing and lastly theme management.

The Display section consists of the options which handle how many topics and comments per page show up, their default order, the SEO and meta configuration, and both your inline and custom HTML fields.

forum-theme-template-01.png

Themes & Selection

We've been aware that our theme selection has been a little dated for some time now, and wanted to do something about it. My colleague Willem was set to the task of devising a quick and snazzy way of selecting themes for your ActiveBoard, and he's come up with a slick system to accomplish the task.

forum-theme-template-02.png

Style Editing

Modifying the style of your forum has been a thorn in everyone's sides for a long time -- how to accomplish this in an usable way which is completely dynamic. A problem? I think not!

The new ActiveBoard style editor allows you to change the look and feel of your board on the fly, without leaving the page. You can view the forum, and navigate around with your changes visible even before you actually apply them to make sure they're just the way you want them.

forum-theme-template-03.png

Template Editor

For a long time, we've wanted to offer additional customizations to ActiveBoard on a per-client basis, but technically speaking this is difficult when you're using an internal framework and only the content is dynamically created by the clients and the members of their boards.

As a result, we've come up with a template parsing system which will allow you to modify the layout and display of the majority of your ActiveBoard.

This is actually related to my post from a little while ago, Templates & Layout Customization, which outlined template parsing in BlogBaker. The template parser in ActiveBoard has been expanded, so technically speaking it is more powerful than the options available in BlogBaker. We'll be bringing BlogBaker up to speed in this regard soon!

forum-theme-template-04.png

Theme Manager

If you can create, modify, and save themes... you had best be able to manage them too! We're not letting anyone down in this regard, and will be providing a theme management system to keep track of your saved themes. You will be able to activate any theme from the manager, edit them, delete, and also preview the theme on your forum as if you had activated it. In other words, your users will never be impacted while you test!

forum-theme-template-05.png

Magic & Beyond

Well, unfortunately it isn't magic! Sparklit is keen to provide all of our clients with high quality, ingeniously designed software which both the geeky power user, and the happy-go-lucky casual user can use easily and painlessly!

I'll also include a little hint of two things to come:

Search Upgrades

We'll be adding an upgraded search system which will support some fancy additional options: such as + to indicate the word must exist, - to indicate the word must not exist, and " to indicate a string of text which must exist in a search. This new search application will be based off of an implementation of Sphinx Search.

Permalinks

For the SEO-interested folks out there, and anyone who would like to see some pretty URLs... they're on the way! Imagine your forums having their own pretty names... an example from our example ActiveBoard might look like: http://example.activeboard.com/forum/suggestions-and-feedback

Keep your eyes out for these upgrades and more! Also, we're always open to feature suggestions and are also often able to do custom programming jobs for our clients as per their needs. SO! Don't hesitate to submit a feature request via email (general@sparklit.com), support request, or through the "Make a Suggestion" link in the tabs at the top on your Administration Panel.

(o``)--o

Forum Language Translations

While ActiveBoard's default text is in English, it also offers a multitude of translated versions of the language which our clients may use, and even contribute to. In addition to English, the languages supported include: Spanish, Portuguese, Dutch, French, German, Italian, Norwegian, Finnish, Danish, Swedish, Hungarian, Polish, Turkish, Russian, Japanese, Chinese, Croatian and Greek.

For each supported language, we keep track of a version of the text in that language. Users are encouraged to submit their own translations to individual pieces of the language, or vote existing translations up or down according to their accuracy.

Over time, the translations become more and more complete, and require less attention.

To enable a language on your ActiveBoard, navigate to your Administration Panel and scroll to the bottom. There you will find an option called "Language Set" and a drop-down box consisting of all supported languages.

forum-language-01.png

Select your desired language to view the specific translation details of that language, and then change the "Use Translation" drop-down box to "Yes". Presto, your forum will now be displayed with the selected language. Easy as pie!

forum-language-02.png

Additionally, we give you a little visual cue for what's left to be translated for clarity!~

In this example, 27 pieces of text from the Russian translation still need translating! This is likely due to the addition of new phrases or words to the overall list of translations.

To help contribute to the translations of your language, click on the link below the translation information: "Quickly help everyone by improving the Russian translation." This will take you a page which gives you a random selection of 10 untranslated pieces of text, with the option of translating additional pieces as desired!

forum-language-04.png

Simply click on the Translate button (in Russian, "переведите"), and enter your translation into the text field that appears. Submit your translation (or translations, if you added several), and by the next day they will be active and show up on your forum!

Templates & Layout Customization

With the addition of BlogBaker to the collection of amazing Sparklit products, came a few neat changes to how content is displayed.

Traditionally, a website URL contains a number of parameters, which are evaluated by the webserver for interpretation. The inputs are sent to a black-box (from a user perspective) and out comes a dynamically generated website.

BlogBaker is the first of our products to take the black-box portion of this process, and open it up to give the users significantly more fine tune control over how their pages are displayed. Some of the other hosted blogging software on the market also allowed you to do this, but not nearly as well as we do.

Templates in BlogBaker

We created a pseudo-HTML template parsing back end, which accepts HTML templates that contain non-standard HTML formatted tags and turn them into the pages of your blog.

There are a number of custom tags, including the following:

  • bif, belseif, belse -- conditional logic
  • battr -- accessing information from objects
  • bdata -- accessing stored data from the application
  • bcontainer, bsection -- container elements for rendering
    • bcontainers require that all the tags inside of them are either bsections or bwidgets
    • bsections allow any custom tags, or HTML to be added
  • bwidget -- configuration for a widget

At the moment, we're in the process of writing documentation to support the templating system, so that users can easily look up what these tags do, and read up on some practical examples. Here's an example of a tag in use:

<bwidget id="category0" type="category" title="Categories" sorting="alphabetical" flat="false" layout="dropdown" counts="true"></bwidget>

The category widget has several attributes which you can use to configure how it is displayed. Note that the "type" and "id" attributes are required, and that the "id" attribute must be unique, and the "type" attribute must be one of the allowed widget types.

  • title -- the title you would like displayed (optional)
  • sorting -- the order you would like have your categories displayed in, possible options are:
    • alphabetical, reversealpha (reverse alphabetical), frequency (display based on popular usage)
  • layout -- the type of category list you want to show, possible options are:
    • dropdown (a dropdown select box), hierarchy (shows up in tree format)
  • flat -- set this to "true" if you want to flatten the displayed list of categories
  • counts -- set this to true if you would like to see the number of times each category has been assigned

Note that the "type" and "id" attributes are required, and that the "id" attribute must be unique, and the "type" attribute must be one of the allowed widget types. (I won't list all the possibilities here though.)

Templates in ActiveBoard

A project that I have been working on for the last week or two is to implement the templating system I created for BlogBaker in ActiveBoard. A forum is actually quite similar to a blog in the general scheme of things, and both products benefit greatly from the additional customization that templating provides. It also means that when a client comes to me saying "Can I make my ActiveBoard do this?" I will be able to reply jovially "SIR, YES SIR!" ...or something like that anyway.

In the coming weeks I am looking to launch this for practical testing and usage online. Several of our more prominent boards, such as MediaZoneJA, are looking forward to this, and have kindly offered to help test it out.

Here's a quick example of a template in ActiveBoard:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<ul>
<loop var="categories" item="category" index="i">
    <li>
        <div><attr name="title" item="category"></attr></div>
        <if var="nsubforums" compare="greater" value="0">
            <ul>
            <loop var="subforums" item="subforum" index="j">
                <li>
                    <attr name="title" item="subforum"></attr>
                </li>
            </loop>
            </ul>
        </if>
        <else>
            <li>
                No forums have been created in this category yet.
            </li>
        </else>
        </ul>
    </li>
</loop>
</ul>

A "nice" implementation...

I also wanted to briefly discuss a bit of technical fun I've had during the creation of the template parser, and subsequent updates and improvements. PERFORMANCE! It's important, very important. So much so, that I've already gone through 5 iterations of the template parser.

The first method I came up with, was integration with phpQuery, a popular, jQuery modeled DOM traversal and manipulation project. phpQuery is easy to use, relatively bug free (though I found a couple during my time working with it), and uses PHP's built in DOM functionality.

phpQuery comes with a price though, in that it has a very high usage overhead. Importing DOM text strings has a hefty overhead (partially PHP DOM's fault), which means that if you have to create multiple documents your minimum execution time is going to be pretty high. Here's an example of what I mean.

Imagine you have a some simple template HTML like this...

<loop var="numbers" item="number" index="i">
<div>at index <attr name="i"></attr></div>
<loop>

...and there are "numbers" is a list of 10 numbers, from 0 to 9 inclusive. To evalulate this in phpQuery, once the <loop> is detected, you have to repeat the evaluation of the contents of the loop 10 times. Unfortunately, to do this, you cannot simply replace the <attr> tag 10 times, because after the first replacement you have actually removed it from the template.

Ultimately there are a number of possibilities, but I'll outline only two: 1) duplicating the contents of the <loop> 9 more times, and 2) copy the contents of the loop, save it and evaluate it separately 10 times.

1) This requires DOM manipulation (Ugh DOM manipulations.) 9 times, and then an additional 10 replacements as you traverse and update the newly created nodes.

2) This requires fewer DOM manipulations, but requires you to create 10 additional DOM documents (Ugh, overhead!), one for each iteration of the loop.

I'd also like to point out, that when I think of something as a "long time", I mean that it's taking several hundred milliseconds. So compared to a lot of things... it's fast but... on a massive scale, it's not fast enough.

Last but not least, a better implementation

It turns out that you can accomplish the same things that phpQuery can do with its object oriented DOM document approach, by doing a little string manipulation and a state-based system.

A very simple regular expression can split up an entire template on the opening and closing tags of special elements, and give you a flat array of all the important parts of a template broken into three categories: opening tag, closing tag, raw HTML.

After that you can traverse the array asking yourself simple questions: am I in a condition? am I in a loop? am I raw HTML?

At present, the template parser algorithm is roughly 18% slower than dynamically rendering a page with logic PHP, and by the end of next week I hope to have better than 5% slower parsing.

GeSHi and line height fun

Being a developer, one of the major features I (and my colleagues) wanted to see in BlogBaker was syntax highlighting for code blocks. In the future, many posts will include snippets of code used to help describe problems that we are working on and how we are working to accomplish them. Additionally, many of us will be creating personal blogs outside of work, and will want to be able to insert code snippets.

It's fairly straight forward to turn some code into a snippet, and is entirely based on custom <pre> tags.

For example, if I wanted to paste the contents of a simple Hello World PHP script, I would edit the HTML view of my post, and enter <pre lang="php">, paste my PHP script, and close </pre>. See below example:

1
2
3
4
5
6
7
8
9
10
class foobar
{
    public function greetings()
    {
        echo "Hello World!";
    }
}
 
$foo = new foober;
$foo->greetings(); // prints "Hello World!"

Tada!

During the addition of this feature, however, I ran into an unexpected hiccup regarding line heights. I had seen GeSHi used before on a friends blog, and noticed that the height of the line numbers did not match up with the height of the code. See below screenshot:

Line Height Example 1

Very odd... and to top it off, I noticed the same issue on my development blog and during testing. At first, I thought that I had conflicting CSS changing the line-heights, height of the parent element, or something of that nature. Other alternatively possibilities included that the error might be a browser rendering bug.

A breakthrough came when I had one of my coworkers (Brendan) test out what I was working on in his browsers. Brendan noted that it was correct in one of his browsers, but out of alignment in another browser. Further investigation revealed that no explicit monospace font family style was being applied to the

<pre&gtl tags surrounding the code, and as a result the browser used whatever default had been selected. In most browsers this appears to be Courier New, which appears render differently in different situations.

Before concluding anything about Courier New itself, I checked and doublechecked that there were no styles affecting elements inside the columns which might change their height (ie. 1px padding or margin on elements), but I was unable to find anything. To matters more interesting, the columns were not even out of alignment by a uniform amount. For example, 150 lines of code were maybe 19 px off by the end -- VERY odd, and suggests that there are likely not any errant styles.

After that, I tried changing the font family of the monospace tags, forcing it to Consolas and Courier in CSS. After that, all my tests started showing up in perfect alignment across all browsers.

Line Height Example 2

So, a word to those using GeSHi: if you run into line-height issues, check what font family is being used to render the preformatted tags!

Theme: Fresh Print by BlogBaker. Powered by BlogBaker.