SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    click count on flash banners

    hi guys,
    i'm building a banner ad system and everything works fine for .gif/.jpeg/.png files but i'm having problems with .swf files.
    i've tried the following so far:

    - layer on top of the flash file
    - transparent .gif on top
    - iframe

    cant figure out a way to make a crossbrowser solution to be able to track the clicks on flash files.

    Any suggestions?

    P.S.
    I'm not interested in downloading a freeware/shareware system developed by someone else...
    just a few pointers/ideas...

  2. #2
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any ideas/suggestions????

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Are you sure you wish to use PHP for this?

  4. #4
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well PHP is used for tracking the clicks... by using an intermidiate page (E.g. jumplink.php?id=xx)
    The thing i'm having problems with is the fact that if there's already a link embedded in the swf file it will follow it disregarding the jumplink... feature i implemented... because the flash movie has the highest lvl priority in browser...
    Everything works fine for gif/jpeg files but swf's dont

  5. #5
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    * highest layer priority that is...

  6. #6
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a thought:
    I guess if you click on the flash then the browser will be redirected to some link/url whether the link url is set while building the banner itself or with HTML anchor tag. If yes, then redirect the browser to your own script file first where you can count/update database table then redirect to the specified link/url from there.

    I am not sure how you have linked the flash banner to redirect to go somewhere.

    Edit:
    Ahh.. If the flash banner is not controllable from your side, then it is difficult to track such clicks if the flash banner has the already the link.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  7. #7
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep that is the problem... because some advertisers do not supply the fla file to be able to edit the code
    thats why i need to figure out a way to handle this for every situation...

    I may be on to something tho:
    I also tried using a swf file of my own and embed in it all the content from the advertisers... meaning that even the gif/jpeg files would be displayed as flash... which would not be a problem... but again the swf files get messed up because of the possibility of having diferent frame rates in the swf files...

    Solution: ... i'll confirm it in a bit...
    iframe with a transparent swf file on top of the displayed media...
    my own swf file reads the destination link from php and being on top of the gif/jpeg/swf should have the highest layer priority... thus redirecting the clicks correctly

    theory is good, now lets try it

  8. #8
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,514
    Mentioned
    37 Post(s)
    Tagged
    1 Thread(s)
    Or you could have your own swf that loads the ad swf into an internal empty movieclip. Your swf would take parameters for the tracking url from flashvars in the embedding html, and use them on an invisible button layer at the top level within the swf.

    If you pass via flashvars the variable my_url and my_swf:

    Code:
    //incoming variables via flash vars: my_swf, my_url
    //create an empty movieclip and load external swf
    
    this.createEmptyMovieClip("loader_mc",1000);
    loader_mc._lockroot = true;
    loader_mc.loadMovie(my_swf);
    
    //overlay a button
    
    this.createEmptyMovieClip("click_mc",2000);
    click_mc._alpha=0;
    click_mc.beginFill(0xFF0000);
    click_mc.moveTo(0, 0);
    click_mc.lineTo(Stage.width, 0);
    click_mc.lineTo(Stage.width, Stage.height);
    click_mc.lineTo(0, Stage.height);
    click_mc.lineTo(0, 0);
    click_mc.endFill();
    
    //add a click handler for the button
    
    click_mc.onRelease=function(){
    	getURL(my_url,"_self");
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •