Edinburgh Web Development

Flash pop-ups and z-index

by Iain Wilson

23 June 2008

Flash pop-ups have recently become popular with a few of our customers. They have a few benefits to traditional html pop-ups in that they are not perceived by the browsers as pop-ups at all and therefore don't get blocked. As far as the browser is concerned it is just another Flash movie, which of course it is - it just takes up most of the screen.

Taking up most of the screen however can present a problem because the movie will cover the page that it is 'popped up' from, and to make sure it is in front of all that content, you will have to use z-index to bring it forward. A problem arises on some browsers (notably Firefox) when the movie finishes. As far as the browser is concerned, the Flash movie is still in front of the content (even if you shrink the movie). Because the movie is in front of the page, all the hyperlinks on the page won't work - all you're doing is click on the movie.

The way to get around this is pretty simple with some Javascript/Flash integration. When the movie finishes, get Flash to call a Javascript function to change the display property of the div containing the movie to display:none. Once done, the movie disappears and all links are again clickable.

Liked this article? Please share it with your friends and colleagues.


comments powered by Disqus
 
Blot Design,
10 Colinton Road, Edinburgh, EH10 5DT,
0131 208 1792
Terms, Cookies & Privacy