phpAdsNew   Home  

 

 

 

  5.2 Using Flash banners  

 

phpAdsNew has transparent support for Flash banners. You can add Flash banners in the same way as regular banners. However there can be some problems when you want to log clicks.

 
   
  5.2.1 Adding a Flash banner  

 


phpAdsNew can handle Flash banners just like normal banners. For example; you can simply click on 'Add new banner' in the admin interface and select the type of banner you want to add. If you choose 'Banner stored on the webserver' or 'Banner stored in MySQL' you can select the .swf file and upload it like you would do with a regular banner. It is also possible to link to an external Flash banner (Banner referred to through URL) and specify the full URL to the .swf file.

phpAdsNew will automatically detect the type of the file and generate the HTML code needed to display the banner during invocation. Please note: Flash banners will not be displayed if you are using normal remote invocation. Only remote invocation with JavaScript, iframes or local mode can display Flash banners.

 

 
   
  5.2.2 Logging AdClicks  

 


After adding a Flash banner, you will probably notice phpAdsNew won't log AdClicks for that banner. This is normal behavoir. Usually the target URLs are hardcoded in the Flash banner and if the user clicks on the banner it the Flash player will tell the browser to visit the hardcoded URL directly.

An example of an hardcoded URL in Flash 5:

 


ActionScript variables

To solve this problem we need to tell the Flash player to use the adclick.php file instead of the hardcoded URL. One way to achieve this effect is to replace the hardcoded URL with a specific ActionScript variable, but this is only possible if you have access to the original Flash movie source.

In the example below the hardcoded URL is replaced with an ActionScript variable called 'targeturl'.
phpAdsNew will give the Flash player the correct value for the 'targeturl' ActionScript variable during invocation. The 'targeturl' ActionScript variable will contain the URL which is needed for logging clicks and will redirect to the url specified in the 'Linked to URL' field in the Admin Interface.