Click to See Complete Forum and Search --> : Displaying Movie from Drop-downs


linds415
09-24-2008, 09:32 AM
I have three drop-down boxes ... based on the selections made I need to be able to display the appropriate movie below them. I have code for both the drop-downs and movies however, I'm unsure as to how to incorporate them to get the effect I want.

Drop-downs

<form name="isc">
<table border="0" cellspacing="0" cellpadding="0" class="style9">
<tr align="center">
<td class="style8"> &nbsp;

<select name="example" size="1" onchange="redirect(this.options.selectedIndex)">
<option selected="selected">---Select Year-------------</option>
<option>2008</option>
<option>2007</option>
</select>

<select name="stage2" size="1" onchange="redirect1(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Month--------------</option>
<option value=" " selected="selected">---Select Month--------------</option>
</select>

<select name="stage3" size="1" onchange="redirect2(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Video----------------</option>
<option value=" " selected="selected">---Select Video----------------</option>
</select>

<script type="text/javascript">

var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()

group[0][0]=new Option("---Select Month---"," ");

/* 2008 Month Options */
group[1][0]=new Option("Select Month "," ");
group[1][1]=new Option("March","48");
group[1][2]=new Option("April","47");
group[1][3]=new Option("May","46");
group[1][4]=new Option("June","45");
group[1][5]=new Option("August","44");


/* 2007 Month Options */

group[2][0]=new Option("Select Month "," ");
group[2][1]=new Option("November","114");
group[2][2]=new Option("December","115");

var temp=document.isc.stage2


function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}



var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}

secondGroup[0][0][0]=new Option("---Select Video---"," ");
secondGroup[1][0][0]=new Option("---Select Video---"," ");

/* Year 1 Options */
/* March 2008 */
secondGroup[1][1][0]=new Option("Select Video "," ");
secondGroup[1][1][1]=new Option("Management","");
secondGroup[1][1][2]=new Option("Operations","");
secondGroup[1][1][3]=new Option("Marketing & Task Leads","");
secondGroup[1][1][4]=new Option("Technical","");
secondGroup[1][1][5]=new Option("Slides","");

/*April 2008*/
secondGroup[1][2][0]=new Option("Select Video "," ");
secondGroup[1][2][1]=new Option("Technical"," ");

/*May 2008*/
secondGroup[1][3][0]=new Option("Select Video "," ");
secondGroup[1][3][1]=new Option("Management"," ");
secondGroup[1][3][2]=new Option("Operations","");
secondGroup[1][3][3]=new Option("Marketing","");
secondGroup[1][3][4]=new Option("Task Leads","");
secondGroup[1][3][5]=new Option("Technical","");

/*June 2008*/
secondGroup[1][4][0]=new Option("Select Video "," ");
secondGroup[1][4][1]=new Option("Management"," ");
secondGroup[1][4][2]=new Option("Operations","");
secondGroup[1][4][3]=new Option("Marketing","");
secondGroup[1][4][4]=new Option("Task Leads","");

/*August 2008*/
secondGroup[1][5][0]=new Option("Select Video "," ");
secondGroup[1][5][1]=new Option("Management"," ");
secondGroup[1][5][2]=new Option("Operations","");
secondGroup[1][5][3]=new Option("Marketing","");
secondGroup[1][5][4]=new Option("Task Leads","");
secondGroup[1][5][5]=new Option("Technical","");


/* Year 2 Options */
/* January 2007 */
secondGroup[2][0][0]=new Option("---Select Video---"," ");
secondGroup[2][1][0]=new Option("Select Video "," ");
secondGroup[2][1][1]=new Option("Management"," ");
secondGroup[2][1][2]=new Option("Operations","");
secondGroup[2][1][3]=new Option("Marketing","");
secondGroup[2][1][4]=new Option("Task Leads","");

/* February 2007 */
secondGroup[2][2][0]=new Option("Select Video "," ");
secondGroup[2][2][1]=new Option("Management"," ");
secondGroup[2][2][2]=new Option("Technical","");



// functions

var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}

function redirect2(z){
window.location=temp1[z].value
}

//-->
</script>
</td>
</tr>
</table>
</form>


Movie Code

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="270" id="player" align="middle">
<param name="movie" value="player.swf?file=augMgtVideo.flv&size=false&aplay=false&autorew=false&title="/>
<param name="menu" value="false"/>
<param name="quality" value="high"/>
<param name="bgcolor" value="#FFFFFF"/>
<noscript><a href=http://www.dvdvideosoft.com/products/dvd/Free-DVD-Decrypter.htm>dvd decrypter</a></noscript>
<embed src="player.swf?file=augMgtVideo.flv&size=false&aplay=false&autorew=false&title=" menu="false" quality="high" bgcolor="#FFFFFF" width="320" height="270" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</object>

Any help would be greatly appreciated!! Thanks!!!

Eye for Video
09-28-2008, 11:46 PM
Owch...
way to much code for me and not enough
how to incorporate them to get the effect I want
Looks like your pretty good at getting the html or javascript or whatever the heck that is, but it's going to have to interact with the video player, which is Flash. You may need to translate the meaning of that code into ActionScript.
Tell us more of what you're looking for.
EfV

linds415
09-29-2008, 09:40 AM
Thanks for your response ....not really sure what you are looking for?? The code I have for the embedded flash video works just fine on the web page. What I'm looking to do is have the proper movie show up on the same screen through selection of drop-downs. I've actually been working on this more since I originally posted this. Here is what I have so far.

<form name="isc">
<table border="0" cellspacing="0" cellpadding="0" class="style9">
<tr align="center">
<td class="style8"> &nbsp;

<select name="example" size="1" onchange="redirect(this.options.selectedIndex)">
<option selected="selected">---Select Year-------------</option>
<option>2008</option>
<option>2007</option>
</select>

<select name="stage2" size="1" onchange="redirect1(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Month--------------</option>
<option value=" " selected="selected">---Select Month--------------</option>
</select>

<select name="stage3" size="1" onchange="redirect2(this.options.selectedIndex)">
<option value=" " selected="selected"> </option>
<option value=" " selected="selected">---Select Video----------------</option>
<option value=" " selected="selected">---Select Video----------------</option>
</select>

<script type="text/javascript">

var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()

group[0][0]=new Option("---Select Month---"," ");

/* 2008 Month Options */
group[1][0]=new Option("Select Month "," ");
group[1][1]=new Option("March","48");
group[1][2]=new Option("April","47");
group[1][3]=new Option("May","46");
group[1][4]=new Option("June","45");
group[1][5]=new Option("August","44");


/* 2007 Month Options */

group[2][0]=new Option("Select Month "," ");
group[2][1]=new Option("October","114");
group[2][2]=new Option("November","115");

var temp=document.isc.stage2


function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}



var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}

secondGroup[0][0][0]=new Option("---Select Video---"," ");
secondGroup[1][0][0]=new Option("---Select Video---"," ");

/* Year 1 Options */
/* March 2008 */
secondGroup[1][1][0]=new Option("Select Video "," ");
secondGroup[1][1][1]=new Option("Management", "");
secondGroup[1][1][2]=new Option("Operations","");
secondGroup[1][1][3]=new Option("Marketing & Task Leads","");
secondGroup[1][1][4]=new Option("JBoss World Conf","");
secondGroup[1][1][5]=new Option("Slides","");

/*April 2008*/
secondGroup[1][2][0]=new Option("Select Video "," ");
secondGroup[1][2][1]=new Option("IEEE 802"," ");
secondGroup[1][2][2]=new Option("Slides","");

/*May 2008*/
secondGroup[1][3][0]=new Option("Select Video "," ");
secondGroup[1][3][1]=new Option("Management"," ");
secondGroup[1][3][2]=new Option("Operations","");
secondGroup[1][3][3]=new Option("Marketing","");
secondGroup[1][3][4]=new Option("Task Leads","");
secondGroup[1][3][5]=new Option("Certificate Authority","");
secondGroup[1][3][6]=new Option("Slides","");

/*June 2008*/
secondGroup[1][4][0]=new Option("Select Video "," ");
secondGroup[1][4][1]=new Option("Management"," ");
secondGroup[1][4][2]=new Option("Operations","");
secondGroup[1][4][3]=new Option("Marketing","");
secondGroup[1][4][4]=new Option("Task Leads","");

/*August 2008*/
secondGroup[1][5][0]=new Option("Select Video "," ");
secondGroup[1][5][1]=new Option("Management", 'playVideo("selectDemo1","videoPlayback")');
secondGroup[1][5][2]=new Option("Operations","");
secondGroup[1][5][3]=new Option("Marketing","");
secondGroup[1][5][4]=new Option("Task Leads","");
secondGroup[1][5][5]=new Option("CoolTools","");
secondGroup[1][5][6]=new Option("Slides","");

/* Year 2 Options */
/* October 2007 */
secondGroup[2][0][0]=new Option("---Select Video---"," ");
secondGroup[2][1][0]=new Option("Select Video "," ");
secondGroup[2][1][1]=new Option("Management"," ");
secondGroup[2][1][2]=new Option("Technical","");

/* November 2007 */
secondGroup[2][2][0]=new Option("Select Video "," ");
secondGroup[2][2][1]=new Option("Management"," ");
secondGroup[2][2][2]=new Option("Technical","");



// functions

var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}

function redirect2(z){
window.location=temp1[z].value
}

function playVideo(sourceId, targetId) {
if (typeof(sourceId)=='string') {sourceId=document.getElementById(sourceId);}
if (typeof(targetId)=='string') {targetId=document.getElementById(targetId);}
targetId.innerHTML=sourceId.innerHTML;
return false;
}

//-->
</script>
</td>
</tr>
</table>
</form>


<div id='videoPlayback' style='width: 435px; height:350px; background-color: #000000;' class="style10" ></div>

<div id='selectDemo1' style='display: none'>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="270" id="player" align="middle">
<param name="wmode" value="transparent"></param>
<param name="movie" value="player.swf?file=augMgtVideo.flv&size=false&aplay=false&autorew=false&title="/>
<param name="menu" value="false"/>
<param name="quality" value="high"/>
<param name="bgcolor" value="#FFFFFF"/>
<noscript><a href=http://www.dvdvideosoft.com/products/dvd/Free-DVD-Decrypter.htm>dvd decrypter</a></noscript>
<embed src="player.swf?file=augMgtVideo.flv&size=false&aplay=false&autorew=false&title=" menu="false" quality="high" bgcolor="#FFFFFF" width="320" height="270" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode=”transparent”/>
</object>
</div>



Where I need help is the call to the function (see bold text in code).