473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

need help with onClick to function.

Hello all, I am new here and am new the world of javascripting. I am
having a heck of a time trying to accomplish something that i
conceptually know what i want to do but can not seem to get it into
code correctly.

What I am looking to do is this.

I have a web page that uses 3 different formats of video. Right now to
load each format I have 3 separate pages. Each format is loaded onto
the page with an embed function.

This is an example of the FLV loading function:

function LoadThisSWF(FLV){
var strString = "<object
classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=";
strString +=
"\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"
width=\"342\" height=\"291\" title=\"Quickstream.tv\">";
strString += "<param name=\"movie\"
value=\"FLVPlayer_Progressive.swf\">";
strString += "<param name=\"quality\" value=\"high\">";
strString += "<param name=\"FlashVars\"
value=\"&MM_ComponentVersion=1&skinName=Halo_Skin_ 3&streamName="+FLV+"&autoPlay=true&autoRewind=fals e\">";
strString += "<embed src=\"FLVPlayer_Progressive.swf\"
flashvars=\"&MM_ComponentVersion=1&skinName=Halo_S kin_3&streamName="+FLV+"&autoPlay=true&autoRewind= false\"
quality=\"high\"
pluginspage=\"http://www.macromedia.com/go/getflashplayer\"
type=\"application/x-shockwave-flash\" width=\"342\"
height=\"291\"></embed>";
strString += "</object>";

document.getElementById('isFlash').innerHTML = strString;
}

I have additional ones that I have customized for quicktime and windows
media.

All of the players load into a <div id=isFlashon the page.

what I would like to do is be able to, if possible, create a global
variable called loadThisFormat and have that equal the result of a
function that is set when a person clicks on a different format at the
bottom of the page.

so in pseudo code:

var loadThisFormat = result of chooseFormat

function chooseFormat
if onclick = flash then load LoadThisSWF
if onclick = quicktime then load LoadThisMOV
if onclick = windows media then load LoadThisWMV

this way when a person selects a format of video, when they click on
the other videos on the page they will play in their selected format

If anyone can help me i will be forever grateful!!!

Thank you in advance!

Donald

Nov 15 '06 #1
1 2685

donradii wrote:
Hello all, I am new here and am new the world of javascripting. I am
having a heck of a time trying to accomplish something that i
conceptually know what i want to do but can not seem to get it into
code correctly.

What I am looking to do is this.

I have a web page that uses 3 different formats of video. Right now to
load each format I have 3 separate pages. Each format is loaded onto
the page with an embed function.

This is an example of the FLV loading function:

function LoadThisSWF(FLV){
var strString = "<object
classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=";
strString +=
"\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"
width=\"342\" height=\"291\" title=\"Quickstream.tv\">";
strString += "<param name=\"movie\"
value=\"FLVPlayer_Progressive.swf\">";
strString += "<param name=\"quality\" value=\"high\">";
strString += "<param name=\"FlashVars\"
value=\"&MM_ComponentVersion=1&skinName=Halo_Skin_ 3&streamName="+FLV+"&autoPlay=true&autoRewind=fals e\">";
strString += "<embed src=\"FLVPlayer_Progressive.swf\"
flashvars=\"&MM_ComponentVersion=1&skinName=Halo_S kin_3&streamName="+FLV+"&autoPlay=true&autoRewind= false\"
quality=\"high\"
pluginspage=\"http://www.macromedia.com/go/getflashplayer\"
type=\"application/x-shockwave-flash\" width=\"342\"
height=\"291\"></embed>";
strString += "</object>";

document.getElementById('isFlash').innerHTML = strString;
}

I have additional ones that I have customized for quicktime and windows
media.

All of the players load into a <div id=isFlashon the page.

what I would like to do is be able to, if possible, create a global
variable called loadThisFormat and have that equal the result of a
function that is set when a person clicks on a different format at the
bottom of the page.
AFAIK there are no global variables that existing across page loads.
There are global variables that exist through an entire single page
load, though.

If you need to keep variables from page to page to page the options I
know of are to set a cookie, OR to use an invisible IFrame and
store/read that value from there.

HTH.
so in pseudo code:

var loadThisFormat = result of chooseFormat

function chooseFormat
if onclick = flash then load LoadThisSWF
if onclick = quicktime then load LoadThisMOV
if onclick = windows media then load LoadThisWMV

this way when a person selects a format of video, when they click on
the other videos on the page they will play in their selected format

If anyone can help me i will be forever grateful!!!

Thank you in advance!

Donald
Nov 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pavel Vetesnik | last post by:
Hello, my question is probably quite stupid, but I really don't know how to solve it. I have code like this: =============================================== <button title="Osobní nastavení...
5
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
1
by: David. E. Goble | last post by:
Hi all; I have the following files; index.html, sigsheader.js, sigsboby.js, smilesbody.js and smiles.js. The sourse is below. The page displays two manual slide shows... Each slideshow has a set...
7
by: David. E. Goble | last post by:
Hi all; I have the following files; index.html, sigsheader.js, sigsboby.js, smilesbody.js and smiles.js. The sourse is below. The page displays two manual slide shows... Each slideshow has a set...
3
by: Sean McCourt | last post by:
Hi I am doing a JavaScript course and learning from the recommed book (JavaScript 3rd Edition by Don Gosslin) Below is one of the exercises from the book. I get this error message when I try to...
0
by: Michael L | last post by:
Hi Guys(I apologize for the lengty post - Im trying to explain it as best i can) I've been cracking my head on this one for the past 24+ hours and i have tried creating the function in ten...
8
by: | last post by:
The problem lies here eval("document.TeeForm.amt.value(S+M)"); S and M suppose to add up and the total suppose to appear on the AMT field but it didn't. Any help? ...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
1
by: bhosalevivek | last post by:
I did this code from Dynamic Drive DHTML. it's working properly, but now I need submenu for "Submenu 1.2", means when I take mouse on "Submenu 1.2" I need to display "Submenu 1.2.1". I try to do...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.