A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: codebase question

  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    16

    codebase question

    I'm having a little problem with the 'codebase' attribute in the html when I insert a flash movie. Well actually the problem is actually the lack of the 'codebase' attribute...here is my code:

    <object type="application/x-shockwave-flash" data="movie.swf" width="283" height="60">
    <param name="movie" value="/img/flash/movie.swf" />
    <img src="replacement.gif" width="283" height="60" alt="" />
    </object>

    This is a pared down version of the code that Flash generates for you, and it is working fine...EXCEPT when the user does not have a flash plugin, it seems like the browser is trying to load something before it loads the replacement image.

    I'm thinking that since I took out the codebase attribute, I have forced the browser to 'search' for it on it's own, and when it really can't find it then it would load the picture.

    What I'm trying to do is load the flash movie if the user has a suitable flash plugin, and if not, don't prompt them to download it, but load a picture in the movie's place.

    It's really complicated because I want to avoid any extra scripting at all costs. (ie. JavaScript) Can this be saved? Thanks!

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hmmm, interesting, maybe the browser is looking through its helper applications (or whatever) to try to find something that can display a file with the application/x-shockwave-flash content type?

    I'd be careful about using that style mark up though. There seem to be a few browser/OS combinations (including the probably still very common internet explorer 5.5/windows 98) where that code will fail to display the movie, in IE5.5/win98 it displays a textarea that can't be clicked in instead (weird).

    also, incase you haven't already read it check the alistapart article on a possible solution to the problem of movies not streaming when using IE on windows. http://www.alistapart.com/stories/flashsatay/

  3. #3
    Junior Member
    Join Date
    Apr 2003
    Posts
    16
    Actually, the way I am doing this code is based on that exact site. However my movie is really really small, so I don't think streaming would be a problem, my concern is more of the 2 second delay...although it may not sound like much, it looks really unprofessional on my company's site...

    Is there maybe a way I could do this another way? I'm tried the little movie redirection way, but that still prompts the user, and when I take out the codebase thing, it just comes back to the same problem.

    If not, I think I might have to settle for Javascript, or maybe JSP...

    Thanks!

  4. #4
    Junior Member
    Join Date
    Apr 2003
    Posts
    16
    oh, by the way, I'm not exactly looking for a method that complies to xhtml, if that makes it easier to correct my problem. I just figured that having the object tag AND the embed tag complicates my code a lot more.

    Again, I'm trying to avoid scripting at all costs, however, maybe I could check for the flash plugin with javascript, and if they do not even allow scripting I could redirect them to the non-flash page regardless, that would be my other choice. I haven't found a way to do that though, I'm not even sure if I could redirect without javascript. Anyway, this is not the Javascript forum, so hopefully I can fix this code to work with Win98/IE 5.5 or at least have it load a bit faster without that codebase attribute....

    *sigh*

  5. #5
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    if XHTML isn't an issue, then maybe ditch the object tag entirely and just go with the standard embed tag. all browsers should be able to view that.

    unfortunatly this won't allow an image to be displayed for users with no flash player. I think when a browser finds embeded content which it doesn't have a plugin for it will display a link to a page (specified in the pluginspage attribute) to attempt to get the required plugin.

  6. #6
    Junior Member
    Join Date
    Apr 2003
    Posts
    16
    oh really? hmmm, I read somewhere that you can include 'alternate html' between the opening and closing embed tags. I was just wondering if I happened to do it the MM way and have the Object and embed together how would I handle the image?

    <object>
    <embed>
    <img>
    </embed>
    </object>

    <object>
    <embed>
    </embed>
    <img>
    </object>

    or even

    <object>
    <embed>
    <img>
    </embed>
    <img>
    </object>

    or maybe I'm going about this the wrong way completely...

  7. #7
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    I think if you nest an image inside the opening and closing embed tag the browser will attempt to display the image.

    You can display alternate tags inside the object tag, because of the way the object tag works. if the browser doesn't understand what the object tag is doing it will proceed to any child elements of the object tag if however it can do what the object tag is asking it skips any children of the object. this is why when you nest the embed tag inside the object tag you don't see 2 movies, browsers that understand the object tag will ignore the tags (embed) nested inside.

  8. #8
    Junior Member
    Join Date
    Apr 2003
    Posts
    16
    yeah, actually I knew that, and for some reason I thought it would be the same for <embed>...anyways, I found the <embed> equivalent...and that's <noembed>

    not sure if that would help me though...there are just so many combinations of OSs and browsers that I would need to check...

  9. #9
    Junior Member
    Join Date
    Apr 2003
    Posts
    16
    sooo yeah...ummm, I didn't want to start a new thread, so I'll just continue the one I have here....

    anyone have any ideas how I can display an alternate image...I don't even care to check anymore, either it shows the movie, or it doesn't...but should I do a...

    <object>
    <embed>
    </embed>
    <noembed>
    <img>
    </noembed>
    </object>

    ....would that work in MOST browsers?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center