Instead of that, you can make things much easier on yourself by
creating z-index classes..

.zindex9 {z-index: 900}
.zindex8 {z-index: 800}

and then apply that to the div holding the SWFobject video by doing
document.getElementById('videoholder').className='zindex9';   From
there you can easily expand to automatically increase or decrease the
z-index based on the classname alone.

A great example of this can be found at  myinmed.org/products/business/
health-savings-account/


On Sep 28, 11:58 am, webguy <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I've been searching and searching for the exact code that will
> accomplish this. I have found and utilized code that I have found at
> actionscript.org that was a close as I could find and I am still
> missing something to make this fully work.
>
> Here's the objective:
> with the combination of a javascript function, CSS absolute and z-
> index styles . I want to show and hide a swf video. On the click of a
> graphic button. The swf (with video) appears above the html page using
> disply: block, and z-index = 2. The swf video plays, and has a close
> button. When the user closes the button. The swf disappears using
> disply: none, and  z-index = -1.
>
> Here's the issue:
> The code I have implemented seems to be so close. It works perfectly
> in Firefox 2 and 3 (both mac and PC) and Safari. But in IE6 and IE7
> the first time the user clicks the button for all videos it works, but
> when you close the swf, and try to click on it again, the swf is still
> there, it is not going away, so you can't click on the button again
> until you refresh the page. And then in AOL 9.0 (PC) the swf doesn't
> work at all. And of course since this site is Commerce, it needs to
> work there too.
>
> What I need it to do:
> I need this to work in AOL and I need the swf to be reset when it's
> closed, so that it is under the html (z-index = -1). In short, I need
> it to work how it does in Firefox for all the browsers. I also need to
> utilize a passed variable (this script is currently using sovars from
> swfObject 1.5) so that I can reset the flash file once it's been
> clicked, because I know that using the display: block, method, in IE6
> and IE7, doesn't reset the Flash file, but in Firefox and Safari, it
> works how I want. When the button is clicked, and the swf is shown, it
> starts from the beginning. But first I need to make sure that the z-
> index is being reset, so the button can be clicked on again rather
> than blocking the view of the buttons (IE6 and 7). (though you can't
> see the transparent file).
>
> I suspect that there is a little bit of code that would make this all
> work. Any help is truly appreciated. This site is meant to go live on
> Tuesday.
>
> Here's the working 
> example:http://dev.darcydesign.com/flash/video-zindex/store1-templates/index-...
>
> <!-- here's the script I'm using -->
>
> the button to show the video is:
> <a href="javascript:showVid('vid1')">   // where vid1 is defined in the
> javascript
>
> the button in the swf to close the video is:
> getURL("javascript:closeVid('vid1')");
>
> <!--The javascript code I am using is:-->
>
> <script language="javascript" type="text/javascript">
> //The Function for the Videos
>
> var objPage = null;
> function showVid(vidName) {
> if (objPage) objPage.style.display = 'none';
> objPage=document.getElementById(vidName);
> objPage.style.display = 'block'
>
> if (objPage) document.style.zindex = '-1';
> objPage=document.getElementById(vidName).style.zindex = '2'
>
> }
>
> function closeVid(vidName) {
> if (objPage) objPage.style.display = 'block';
> objPage=document.getElementById(vidName);
> objPage.style.display = 'none'
>
> if (objPage) document.style.zindex = '2';
> objPage=document.getElementById(vidName).style.zindex = '-1'}
>
> </script>
>
> <!-- the CSS is -->
>
> <style type="text/css">
>
> /* this is for the video widows */
>
> .vidShow1 {
>         display:none;
>         position: absolute;
>         top: 45%;
>         left: 10px;
>
> }
>
> .vidShow2 {
>         display:none;
>         position: absolute;
>         top: 175%;
>         left: 10px;
>
> }
>
> .vidShow3 {
>         display:none;
>         position: absolute;
>         top: 265%;
>         left: 0px;
>
> }
>
> #flashVideo1 {
>         width: 400px;
>         font-size: 14px;
>
> }
>
> #flashVideo2 {
>         width: 400px;
>         font-size: 14px;
>
> }
>
> #flashVideo3 {
>         width: 400px;
>         font-size: 14px;
>
> }
>
> </style>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to