Jump to content

Dependant Dropdown List outputing XML


Graxeon

Recommended Posts

I'm using the JW FLV Player for this.

 

Alright so...

 

I found this: http://www.bitrepository.com/web-programming/javascript/dynamic-dependent-dropdown-list-us-states-counties.html

 

And I wanted to make these types of changes to it: http://facs.110mb.com/example.html

 

And what ever XML file that is chosen from the second or third dropdown list would then be implemented into this code such as are the XML files that are already in here:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

  <head>

    <title>Multiple Locations per Track - JWMP v4.2.90 - swfobject v2.1</title>

    <style type="text/css">
      body
      {
        width:                             100%;
        height:                            100%;
        padding:                              0;
        margin:                               0;
        color:                          #000000;
        font-size:                         16px;
        font-family:    Verdana,Helvetica,Arial;
        background-color:               #000000;
      }

      a:link
      {
        color:                          #0000FF;
        font-weight:                     normal;
        text-decoration:              underline;
      }

      a:visited
      {
        color:                          #009999;
        font-weight:                     normal;
        text-decoration:              underline;
      }

      a:hover
      {
        color:                          #00AA00;
        text-decoration:                   none;
      }

      #back
      {
        position: absolute;
        top:                                  0;
        left:                                 0;
        width:                             100%;
        height:                            100%;
        z-index:                              0;
      }

      #txt
      {
        position:                      absolute;
        top:                               32px;
        left:                              32px;
        z-index:                              1;
      }

      form.theForm
      {
        position:                      absolute;
        top:                               -1px;
        left:                              -1px;
        z-index:                              1;
      }

      div.playercontainer
      {
        position:                      absolute;
        top:                               22px;
        left:                              -1px;
        z-index:                              1;
      }

      html, body
      {
        overflow:                        hidden;
      }
    </style>

    <script type="text/javascript" src="swfobject2.js"></script>

    <script language="JavaScript" type="text/javascript">
      var player              =  null;
      var playlist            =  null;
      var original_playlist   =  null;
      var newPlaylist         =  true;
      var multiple            = false;
      var multipleLocations   =    [];
      var currentML           =    -1;
      var currentItem         =    -1;


      function playerReady(obj)
      {
        player = gid(obj.id);
        player.addModelListener('STATE',         'stateMonitor');
        player.addViewListener('ITEM',           'itemMonitor');
        player.addControllerListener('PLAYLIST', 'playlistMonitor');
      };


      function stateMonitor(obj)
      {
        if(obj.newstate == 'COMPLETED')
        {
          if(multiple == true)
          {
            currentML++;

            if(currentML > multipleLocations.length)
            {
              // reset multiple flag
              multiple = false;
            }
            else
            {
              // load the playlist with location + currentML as the location
              playlist[currentItem]['file']        = multipleLocations['location' + currentML];
              playlist[currentItem]['description'] = multipleLocations['subtitle' + currentML];
              player.sendEvent('LOAD', playlist);
              player.sendEvent('PLAY', 'true');
            }
          }

          if((multiple == false) && (currentItem + 1 < playlist.length))
          {
            // advance to the next track
            setTimeout("player.sendEvent('ITEM', currentItem + 1)", 100);
          }
        }
      };


      function itemMonitor(obj)
      {
        if(currentItem != obj.index)
        {
          // reset multiple locations counter
          currentML = 0;
          count = 0;

          //...reload the original playlist here so a selection of another track will play the original location
          newPlaylist = false;
          player.sendEvent('LOAD', original_playlist);

          // check track for multiple locations
          for(j in playlist[obj.index])
          {
            if(j.match('location') == 'location')
            {
              // store in multipleLocations object
              multipleLocations[j] = playlist[obj.index][j];
              // reset multiple locations flag
              multiple = true;
              count++;
            }
            else if(j.match('subtitle') == 'subtitle')
            {
              // store in multipleLocations object
              multipleLocations[j] = playlist[obj.index][j];
            }
          }
          multipleLocations['length'] = count;
        }
        currentItem = obj.index;
      };


      function playlistMonitor(obj)
      {
        // load the playlist once
        if(newPlaylist)
        {
          playlist            = player.getPlaylist();
          original_playlist   = player.getPlaylist();
          newPlaylist         = false;
          multiple            = false;
          multipleLocations   =    [];
          currentML           =    -1;
          currentItem         =    -1;

          if(flashvars.autostart == 'true')
          {
            player.sendEvent('ITEM', 0);
            player.sendEvent('PLAY', 'true');
          }
          else
          {
            player.sendEvent('ITEM', 0);
            player.sendEvent('PLAY', 'false');
            // change the next line to 'true' to enable autostart on new playlist load
            flashvars.autostart = 'false';
          }
        }
      };


      function gid(name)
      {
        return document.getElementById(name);
      };
    </script>

    <script language="JavaScript" type="text/javascript">
      var flashvars =
      {
        //file:               'ac_flv_website.xml',
        file:                 'flv_website.xml',
        playlist:             'bottom',
        playlistsize:         '160',
        shuffle:              'false',
        repeat:               'false',
        stretching:           'exactfit',
        backcolor:            'FFFFFF',
        frontcolor:           '000000',
        lightcolor:           '000000',
        volume:               '100',
        autostart:            'false'
      };

      var params =
      {
        allowfullscreen:      'true',
        allowscriptaccess:    'always',
        wmode:                'opaque',
        bgcolor:              '#FFFFFF'
      };

      var attributes =
      {
        id:                   'playerId',
        name:                 'playerId'
      };

      swfobject.embedSWF('player2.swf', 'player', '480', '462', '9.0.124', false, flashvars, params, attributes);
    </script>

    <script type="text/javascript">
      var message = "Function Disabled!";

      function clickIE()
      {
        if (document.all)
        {
          alert(message);
          return false;
        }
      };

      function clickNS(e)
      {
        if(document.layers || (document.getElementById && !document.all))
        {
          if(e.which == 2 || e.which == 3)
          {
            alert(message);
            return false;
          }
        }
      };

      if(document.layers)
      {
        document.captureEvents(Event.MOUSEDOWN);
        document.onmousedown = clickNS;
      }
      else
      {
        document.onmouseup = clickNS;
        document.oncontextmenu = clickIE;
      }
      document.oncontextmenu = new Function("return false");
    </script>

  </head>

  <body>

    <form id="theForm" class="theform" name="theForm">
      <select name="sel1"Welcome onchange="newPlaylist = true;player.sendEvent('LOAD', document.theForm.sel1.value)" style="width:480px">
  	     <option value="flv_website.xml">Welcome</option>
	 <option value="mp3_music1.xml">Music</option>
	 <option value="flv_test.xml">Testing Area</option>
      </select>
    </form>
    <div id="playercontainer" class="playercontainer">
      <a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this video.</a>
    </div>

  </body>

</html>

 

 

Help please? Been trying for a while now but with no luck :(.

 

 

If you have questions in regard to my question, don't hesitate to ask :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.