Web Analytics Made Easy -
StatCounter Auto detect flash or shockwave and more - CodingForum

Announcement

Collapse
No announcement yet.

Auto detect flash or shockwave and more

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Auto detect flash or shockwave and more

    Hi,

    I was wondering if there was a way to detect them automatically if you call a row from mysql holding the path to the files via javascript. I would be src the js inside a php file.

    If I was to select the my.swf(row) then it would load, the same for dcr files which would be accessed under the same row.

    I have looked around but not found anything to give me pointers on how to do this with if/else, and document.write

    I'm not sure if this would be better suited in the php section.

    ps. I know how to embed them seperately

    Any idea's?
    Last edited by Karate Kitty; Apr 3, 2009, 10:07 PM. Reason: Extra info

  • #2
    You can detect a browser's capability to handle Flash with JavaScript, but not via PHP as far as I am aware. Not sure what you're getting at loading JS files via MySQL, though.

    1) HTML markup (possibly derived from PHP) references the JS script.
    2) All markup and script elements are returned to the user.
    3) The JS script is called using either an event (window.onload for example), or by placing the JS function calls down at the bottom of the document body (recommended).
    4) JS detects whether or not Flash is present, the version of the player, etc.
    5) Depending on the outcome, you can use a DOM method to create an element on-the-fly to display the flash, possibly based on a URL stored in a JS variable (again, derived from PHP via MySQL or whereever) or you might alert the user that they need to install the Flash player, or a specific version, display static content, etc.

    Make sense?


    JavaScript Flash detection library

    Comment


    • #3
      Originally posted by bdl View Post
      You can detect a browser's capability to handle Flash with JavaScript, but not via PHP as far as I am aware. Not sure what you're getting at loading JS files via MySQL, though.

      1) HTML markup (possibly derived from PHP) references the JS script.
      2) All markup and script elements are returned to the user.
      3) The JS script is called using either an event (window.onload for example), or by placing the JS function calls down at the bottom of the document body (recommended).
      4) JS detects whether or not Flash is present, the version of the player, etc.
      5) Depending on the outcome, you can use a DOM method to create an element on-the-fly to display the flash, possibly based on a URL stored in a JS variable (again, derived from PHP via MySQL or whereever) or you might alert the user that they need to install the Flash player, or a specific version, display static content, etc.

      Make sense?


      JavaScript Flash detection library
      Yes, It makes sense.

      Ok, I have may confused the issue with saying about mysql/php. Yes, I know about the flash detection, Its all over google but I need to try to get both working.

      Right, Let me try again

      I have a div with the id called media

      Now what I want to do is:

      if

      this is a flash game please load my flash object

      else

      load shockwave game or any other type of media object

      Essentially, I'm trying to load them on the fly into the same div by populating the div via selcting the mysql db and using a js variable that reflects the sql row.

      I sometimes have problems explaining correctly so please bear with me.

      Comment

      Working...
      X