Open X Ad Server
One of the problems I was facing with Open X as an ad server was to be able to load a flash file inside a flash file...
Ok that sounded a bit confusing, I´ll clarify.
Let´s assume you have a flash site. You create two areas for publicity. All works great, until one day, you need to use an open ad server for doing that. Today, one of the best (I know of) is Open X.
Open X has one serious limitation (unless you get creative). It does not allow for data to be called from within a flash app.
Let´s go over the basic way of creating an ad space, then let´s try and find a solution for the problem.
Create a ZONE - a zone is nothing but an area of your page that will hold some kind of publicity. So let´s create a space of 150x150 on the top right of our page. Give that Zone a name such as 150x150_home_topRight. You can go more creative and call it "blueberries are better than bird poo", but I rekon the something closer to the first option will make more sense down the road.
Basically, in an HTML site, you´d add either a PHP script or a Javascript "script" that would identify this particular area as a Zone. The ad server does the rest. It will look for banners registered for that specific area, with filters and what not, then display those when you page is loaded.
The problem is there... you cannot add PHP or Javascript to your flash... so what do you do?
A simple work around I implemented was to cheat.
Create an area, and name it accordingly. Set it as a Text Ad.
Create a text banner for testing purposes... where the description is the name and full path of the SWF file you wish to load.
In general, open X has two methods of placing zones:
1) remote/javascript - used to place ads in external sites mainly
2) Local mode - using PHP to place the add on the page at render time.
For this application, use local mod - and get the invocation code which should be a PHP script
OK, so you have you PHP code.. but your site is in flash... what next? What´s so innovative?
Here comes the trick.
Create a new page on your site and call it zone1, or 150_150_home_tr or whatever makes sense to you...
Place the invocation code there.... test it. You should get a linked "name_of_swf_file_you_put_as_a_descripti on" on the screen and that´s all.
So far so good... here comes the cheat.
I´ll post code for it tomorrow...
The content of the file is actually as follows:
Link - with click tag url
Text
HiddenDiv with invisible image
Use PHP ereg functions to extract the link and the text... add them as flash variables or a XML file, so that when you render your page you get either:
Flash Variables:
&CLKTAG=http://bla.bla.bla&swfFile=/swf/banner1.swf&image&imageURL=long_url
XML
http://bla.bla.bla
/swf/banner1.swf
long_url
Now you can use this to import the SWF file into you flash. Load the image into a hidden control (this will register views). Use the clickTag link in your loaded movie to register clicks.
There you go.. it´s not clean, far from being perfect... but it works.
Ok that sounded a bit confusing, I´ll clarify.
Let´s assume you have a flash site. You create two areas for publicity. All works great, until one day, you need to use an open ad server for doing that. Today, one of the best (I know of) is Open X.
Open X has one serious limitation (unless you get creative). It does not allow for data to be called from within a flash app.
Let´s go over the basic way of creating an ad space, then let´s try and find a solution for the problem.
Create a ZONE - a zone is nothing but an area of your page that will hold some kind of publicity. So let´s create a space of 150x150 on the top right of our page. Give that Zone a name such as 150x150_home_topRight. You can go more creative and call it "blueberries are better than bird poo", but I rekon the something closer to the first option will make more sense down the road.
Basically, in an HTML site, you´d add either a PHP script or a Javascript "script" that would identify this particular area as a Zone. The ad server does the rest. It will look for banners registered for that specific area, with filters and what not, then display those when you page is loaded.
The problem is there... you cannot add PHP or Javascript to your flash... so what do you do?
A simple work around I implemented was to cheat.
Create an area, and name it accordingly. Set it as a Text Ad.
Create a text banner for testing purposes... where the description is the name and full path of the SWF file you wish to load.
In general, open X has two methods of placing zones:
1) remote/javascript - used to place ads in external sites mainly
2) Local mode - using PHP to place the add on the page at render time.
For this application, use local mod - and get the invocation code which should be a PHP script
OK, so you have you PHP code.. but your site is in flash... what next? What´s so innovative?
Here comes the trick.
Create a new page on your site and call it zone1, or 150_150_home_tr or whatever makes sense to you...
Place the invocation code there.... test it. You should get a linked "name_of_swf_file_you_put_as_a_descripti
So far so good... here comes the cheat.
I´ll post code for it tomorrow...
The content of the file is actually as follows:
Link - with click tag url
Text
HiddenDiv with invisible image
Use PHP ereg functions to extract the link and the text... add them as flash variables or a XML file, so that when you render your page you get either:
Flash Variables:
&CLKTAG=http://bla.bla.bla&swfFile=/swf/banner1.swf&image&imageURL=long_url
XML
Now you can use this to import the SWF file into you flash. Load the image into a hidden control (this will register views). Use the clickTag link in your loaded movie to register clicks.
There you go.. it´s not clean, far from being perfect... but it works.

Comments