swfobject and z-index

112 views
Skip to first unread message

maiku.emon

unread,
Dec 11, 2007, 12:20:50 PM12/11/07
to SWFObject
Hi all. I have been using swfobject for a while, but recently came
across a big problem that noone in our group can seem to figure out. I
was wondering if anyone knows a fix and/or if this can be accomplished
using 2.0 (we have yet to switch).

We have two swfs embeded using swfobject on the same page. We are
trying to get these to swap z-indexs but cant get it to go. I have
tried changing the zindex on the containing div and using the id in
the swfobject to no avail. anyone run into this? it seems that we can
not manipulate zindex at all on these, by default swfobject randomly
picks one to put on top and it stays there, with no control of who is
on top on load or anytime thereafter...


-mike

Jeff Coughlin

unread,
Dec 11, 2007, 1:36:50 PM12/11/07
to swfo...@googlegroups.com
Mike,

I could be totally wrong here, but this sounds similar to the styling
issue I was having where styling the element for which you have placed
your swfobject is not working.

Take a look at this topic for more details and a workaround http://groups.google.com/group/swfobject/browse_thread/thread/6aa4458a4028506

Regards,

---
Jeff Coughlin

Philip Hutchison

unread,
Dec 11, 2007, 1:40:02 PM12/11/07
to swfo...@googlegroups.com
swapping depths is easy using z-index, but i believe the elements need to be positioned absolutely.

here's an example using SWFObject 1.5.1:
http://pipwerks.com/lab/swfobject/z-index/two-swfs.html

- philip

maiku.emon

unread,
Dec 15, 2007, 9:28:53 AM12/15/07
to SWFObject
philip is correct, this problem was simply missing the neccessary
positioning css. He helped me on the other board (thanks phillip!).

however, i am interested to see how much control we have over v2, it
was difficult for us to try and run jquery/dhtml on an swfobject as
opposed to a regular div. I mean like craziness, nothing that would
begin to make sense.

there are huge board posts regarding using dhtml to manipulate a div
containing an swfobject. from what i gathered the object itself must
be targeted, and dynamic styles on the parent div are ignored. in most
casethe styles that were getting applied would do stange things. i was
beginning to wonder if there were issues with jquery/scriptaculous and
swfobject?


I am wondering if v2 has fixed this, or at the very least I think this
should be explicitly clarified in the documentation as these types of
techniques are becoming quite common.

btw - i did read on Jeff Coughlin's post Bobby stating:
SWFObject 2.0 replaces your div element with an object element, so
any
styles attached to that div will be replaced too.
This was a design decision, and it departs from the replace methods
from both SWFObject 1.5 and UFO, which only replace the content
inside
the id-ed HTML element.


mike dixon
Reply all
Reply to author
Forward
0 new messages