views:

25

answers:

1

Here is my problem. My customers can give advertisement on my webpage. Earlier it was just image, a redirecting url, a title. On clicking on the advertisement, I counted the number of clicks and redirected to the given url. Now I want that they can upload images and swf files as advertisement. What I didnt know that you cant catch click event on swf as u can on image. Ideally I wud like a solution that would work seamlessly for both image and swf files and I dont know anything about flash.

So the question is?

Can there be a advertisement container swf which can load image and other swf files and takes in a parameter which takes a url and onclick redirects to it?

Any suggestions to this problem is welcome.

A: 

if you're using jQuery you can add a generic class to all adverts (.advert) and use the live event to bind the click event to that class.

This method will still bind the event to an <object> element with a class of .advert even if you lazy load it using something like swfloader

michael