2

I have a website that has a huge background image. I need to put a flash player at the top of the website, and I just realized that each page they click on is a new page, and thus restarts the Flash player. So I would like to put that flash player in an iframe so it will continue to play throughout the user surfing.

But my issue is will the iframe cover the background image and not be underneath? Or will the background image of the page (not iframe) go nicely underneath the iframe and no one will be the wiser of my methods? Any help would be greatly appreciated.

2
  • Perhaps you should try this question at doctype (see link at the bottom of the page).
    – C. Ross
    Aug 25, 2009 at 17:55
  • In my experience, whatever you do, be sure to test it on every possible browser, because some will so one thing and others will do the exact opposite...
    – Yuval
    Aug 25, 2009 at 17:59

2 Answers 2

2

Firstly what you want to do is put your individual pages contents into an iframe (not the flash video) as this is what you want to update. You want the flash to be on the actual parent page so it always remains the same. (or put both in seperate iframes and only update the content iframe).

In regards to your question about the iframes background you can make it transparent so that the background is still visible through it.

To do this set the ALLOWTRANSPARENCY property to true on your iframe e.g.

<iframe width="100%" height="500px" name="content" src="home.html" frameborder=0 allowtransparency="true"></iframe>

And then in the pages which are going to be contained in the iframe set the body's background to be transparent:

<body style="background-color:transparent">
4
  • 1
    Right... putting the flash in an iframe (as the iframe element would exist on the page itself) would continue the problem.
    – Mark Hurd
    Aug 25, 2009 at 18:03
  • 2
    Sorry, but this is an incredibly filthy solution. This is web development thinking in 1996-style. Loads of messy code on the front end, practically impossible to maintain the layout and design (especially if its used with a CMS or blog engine), and ridiciolus restrictions on what's actually achievable of a visual design. Aug 25, 2009 at 18:05
  • rats. my idea didn't work. each time the user clicks on a new page the iframe refreshes, and as a result removes my entire iframe theory :(
    – Zach Smith
    Aug 25, 2009 at 18:36
  • I'm not arguing that it is the best solution, there are much better solutions just as you suggested below, although these have drawbacks themselves. Iframes aren't like ie6, they don't break everything, they may limit expansion etc but it depends on what is wanted from the client/user and what level of freedom is required from the website. Iframes may be old, but they can still do the job.
    – HenryRat
    Aug 25, 2009 at 18:40
-1

Iframes are bad, and take with them all the shitty stuff about frames (google "why frames are bad" if you want some reading).

What you should be looking at is some AJAX-techniques. JavaScript frameworks like Dojo and jQuery have lots of functionality you could check out. This will enable users to do things like vote, add to favourites or comment while the movie is playing - pretty much like Youtube.

It all depends a little on what you've got running underneath your HTML-pages though. Could you provide some more information about that?

1
  • I am running a Wordpress website, with a ton of tweaks. Huge rotating backgrounds, custom AJAX scroller for WP posts, and the flash player. You can view it here (www.mibsolutionsllc.com/proc_dev) if my explanation leaves you wanting more. I am seeking an alternative to the iframe now, a way where my flash will continue without restarting each page :(
    – Zach Smith
    Aug 25, 2009 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.