/    Sign up×
Community /Pin to ProfileBookmark

Flash embed problem in Firefox

I’m developing a Flash pop-up tool (a user info tool for a training website – not for advertising). I’ve created the swf as a windowless, transparent file. I then embedded it within dual div tags. The first div has a relative position, the second has an absolute position.

I do this so I can change the position of the flash file, so that when the user clicks on the button, the rest of the movie plays out on top (becaue I changed the z-index to 1) of the content above it – giving it a sort of “pop-up” feature.

Here’s the code:

[code=html]<div id= “Layer1″ style=”position:relative; left:0px; top:-355px; width:475px; height:35px; z-index:1″ > <div style=”position:absolute; left:0px; top:0px; width:475px; height:35px”> <object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″ codebase=”http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0″ width=”475″ height=”400″ id=”TrainersTidbit” align=”middle”> <param name=”allowScriptAccess” value=”sameDomain” /> <param name=”movie” value=”TrainersTidbit.swf” /> <param name=”quality” value=”best” /> <param name=”wmode” value=”transparent” /> <param name=”bgcolor” value=”#000000″ /> <embed src=”TrainersTidbit.swf” quality=”best” wmode=”transparent” bgcolor=”#000000″ width=”475″ height=”400″ name=”TrainersTidbit” align=”middle” allowScriptAccess=”sameDomain” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” /> </object> </div> </div>[/code]

The prototype worked seamlessly in IE and Firefox. But for some reason, my final doesn’t work in Firefox unless I add a blank div (also with a z-index of 1) as a workaround (it was a complete accident that I even tried this). Once I insert that blank div, everything works fine.

Still, I’m posting this for posterity. I want to know if there’s a more correcter ? way to make it work?

I’ve attached the .swf and two .html files so you can see them. The file titled “TrainersTidbit-example.html” doesn’t employ the extra div, and doesn’t work in Fifefox (unless you resize the browser window … weird). However, the file “TrainersTidbit-example-workaround.html” does employ the extra div (see code below), and works.

[code=html]<div id=”Layer1″ style=”position:relative; left:0px; top:0px; width:0px; height:0px; z-index:1″></div>[/code]

I’ve also attached the .fla file (MX) in case anyone has any recommendations there as well. I’m still new at Flash, and I’m sure I have a lot to learn.

Any advice would be greatly appreciated. Thanks!

Mason

[upl-file uuid=7defe2c4-78e3-41d7-a99a-6bf796c93ec3 size=98kB]Flash pop-up.zip[/upl-file]

to post a comment
Full-stack Developer

4 Comments(s)

Copy linkTweet thisAlerts:
@ccoppenbargerDec 23.2005 — I'm still not sure what you're trying to do, but I'll look at what you've got and try to figure it out. I just wrote a short tutorial today on how to make a cross-browser embedding of Flash in a web page. You can view it at my [URL=http://cjcomm.blogspot.com]Blog Here[/URL]. That might help.
Copy linkTweet thisAlerts:
@MasonShewauthorDec 23.2005 — I guess I should have been more clear. I know how to embed - but I was having a problem getting my swf to engage in firefox when embedded inside dual div tags. As mentioned above, I figured out a workaround - but it was quite by accident that it worked and doesn't seem to follow any kind of logic.

So basically, I'm looking for a better solution than the one I blindly bumped into.

It may just be a firefox thing - as so many things are.
Copy linkTweet thisAlerts:
@ccoppenbargerDec 23.2005 — Ok try this one. When I removed your table, I was able to work with the file a little bit better. There's still some glitches. I don't have too much more time to work with it today, but maybe you can go from here with this. This one also validates as valid xhtml.

[upl-file uuid=b641d087-c087-486b-a4cb-1a43726f7e7d size=2kB]TrainersTidbit-example.zip[/upl-file]
Copy linkTweet thisAlerts:
@MasonShewauthorDec 23.2005 — Unfortunately, getting rid of the table isn't an option for me. The company I'm building this for is pretty much locked into their table-based format - at least for the time being.

Thanks for your time though - it was a great idea! Any others?
×

Success!

Help @MasonShew spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...