Forum Moderators: not2easy

Message Too Old, No Replies

Can this work in css?

         

swdweb

2:48 pm on May 18, 2009 (gmt 0)

10+ Year Member



I have a flash menu that I'm trying to use throughout my site, but the problem I'm experiencing is that none of the buttons are staying depressed (when I upload it...when I preview, it's fine). I'm thinking this is because I have the object on every page that I need the menu on.

Is there a way to put the flash menu in a css and just reference that css where the menu should be on each page? This way, it's only ONE menu throughout the site?

Help!

Thanks

swa66

7:50 pm on May 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do not know enough flash to answer that side of the story.

But CSS has no way to magically include a flash object.
(all you have are background images).

Still given a bit of html (e.g. a nested list of links), that could be included on many a page using SSI, CSS can style it into a nice looking menu even having dropdown or fly-out submenus. Just don't expect any real animation.

dreamcatcher

5:36 am on May 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Because your flash needs to remain static, I think the only way to accomplish what you want is to use a frame.

dc

swdweb

11:17 am on May 20, 2009 (gmt 0)

10+ Year Member



This is what I figured. I've tried everything else and it's not really possible. I will see about the frames. Thank you for the input.

rocknbil

2:46 pm on May 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please don't use frames for this. :-) Although it can't be done with CSS, there are many other ways to use an included object across the board:

- Look at SWF Object, which solves (at least) four problems - the IE "gray line" around Flash objects, invalid <embed> element nested inside <object>, bloated and buggy stock Javascript to publish the Flash, and graceful degradation by placing the alternate content in the page first. This, however, does not directly solve your problem; but you should use it in combination with one of the following - or just use it by itself. Your code would look like this:

<div id="my_flash_object"><img src="flash_alt_content.jpg"></div>

And SWF object writes to the div "my_flash_object" on load. Very clean and simple.

- You can use the <object> element and write to it with Javascript. Less used and makes it Javascript dependent (which is fine, really, and what SWF object does anyway.)

- You can use SSI (server side includes) and parse your html pages as .shtml. Simple:

<!-- #include virtual="/path/to/page/containing/Flash/nav.txt" -->

- You can do the same thing with PHP, change your server config to parse html pages as PHP so you don't have to rename things:

<?php
include_once('/path/to/page/containing/Flash/nav.txt');
?>

- You can do the same with perl or ASP

Any of these ideas are 10x better than frames or iFrames because when indexed, those framed pages are out of context and generally never lead back to your site (this is but one reason.)

[edited by: rocknbil at 2:54 pm (utc) on May 20, 2009]

swdweb

2:53 pm on May 20, 2009 (gmt 0)

10+ Year Member



Thank you for the input, I think the one suggestion you made that I might be able to do is the Javascript suggestion - the rest ... I have no idea how to do any of that.

Where would I go to find instruction on how to incorporate the flash into the javascript? The suggestion is great but doesn't help me if I can't learn how to do it.

Any help you can give is appreciated. Thanks!

rocknbil

2:56 pm on May 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SWFObject [blog.deconcept.com]
Google's SWFObject Wiki [code.google.com]

Start there; download, play with the tut's, it's very easy.