PDA

View Full Version : randome page change on refresh..


darkstyle
08-03-2004, 08:00 AM
hi there, i having some banners on my website , each time i visit the site, the banner changes randomly, i am using this script

<script language="JavaScript">
<!-- Hide from old browsers


var imagenumber = 3 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "1.swf"
images[2] = "2.swf"
images[3] = "3.swf"
var image = images[rand1]
// -- End Hiding Here -->
</script> <script language="JavaScript">
<!-- Hide this script from old browsers --
//document.write('<embed SRC="images/' + image + '" width="753" height="410">')
document.write('<center>');
document.write('<embed src="' + image + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="753" height="410"></embed>')
document.write('</center>');
// -- End Hiding Here -->

And it is working properly.
But the problem i am facing is i want to add a prameter with value...
for eg. <param=movie value=wsmode>

please help me... how can i add a flash param. in this javascript. and where to put the param.?

Ruben
08-04-2004, 08:00 PM
original piece:
<!-- Hide this script from old browsers --
//document.write('<embed SRC="images/' + image + '" width="753" height="410">')
document.write('<center>');
document.write('<embed src="' + image + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="753" height="410"></embed>');
document.write('</center>');
// -- End Hiding Here -->


adjusted piece:
<!-- Hide this script from old browsers --
//document.write('<embed SRC="images/' + image + '" width="753" height="410">')
document.write('<center>');
document.write('<embed src="' + image + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="753" height="410"></embed>');
document.write('<param=movie value=wsmode>');
document.write('</center>');
// -- End Hiding Here -->

there you go

:) - Ruben

tg
08-04-2004, 08:18 PM
<param > tag is use for the <object> tag.
<object> tag is read by ie... i don't believe ie reads the <embed> tag.

tg
08-04-2004, 08:22 PM
Why use these all these HTML tags? What do they do?
The OBJECT tag is for Internet Explorer 3.0 or later on Windows 9x/2000/NT/ME/XP platforms or any browser that supports the use of the Flash ActiveX control. The "classid" must appear exactly as it does in this example. The "codebase" attribute must also appear exactly as it does in this example; it tells the browser where to find Flash Player for automatic download. Internet Explorer 3.0 or later on Windows 9x/2000/NT/ME/XP will prompt the user with a dialog asking if they would like to auto-install the Flash Player if it's not already installed. This process can occur without the user having to restart the browser.

The EMBED tag is for Netscape Navigator 2.0 or later, or browsers that support the use of the Netscape-compatible plugin version of Flash Player. The "pluginspage" attribute tells the browser where to direct the user to find Flash Player for download if the Player is not already installed. The user would then need to download and run the installer and restart their browser.
http://www.macromedia.com/support/flash/ts/documents/tn4150.html

to do what you want look at the examples on this page:
http://www.macromedia.com/support/flash/ts/documents/wmode.htm

tg
08-04-2004, 08:24 PM
actually after looking at your code, my second link may be wrong... maybe thats not what your trying to do... but the idea is still the same... if your passing a variable/value pair, then you can use 'flashVars' the same way.

Ruben
08-05-2004, 09:27 AM
<param > tag is use for the <object> tag.
<object> tag is read by ie... i don't believe ie reads the <embed> tag.

****, you're right, sorry...

Anyways, the idea stays the same...

:rolleyes: - Ruben

tg
08-05-2004, 02:55 PM
Anyways, the idea stays the same...


yep.

darkstyle
08-05-2004, 09:40 PM
hay wait a min.... :)
this code doesnt work then how i make it work????
please help.

code after editing... which doesnt work.

<!-- Hide this script from old browsers --
//document.write('<embed SRC="images/' + image + '" width="753" height="410">')
document.write('<center>');
document.write('<embed src="' + image + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="753" height="410"></embed>');
document.write('<PARAM NAME=menu VALUE=false>');
document.write('</center>');
// -- End Hiding Here -->

darkstyle
08-07-2004, 10:32 AM
when i put object tag it doesnt work...

Ruben
08-07-2004, 11:01 AM
Well, basically I've just told you how to insert other lines to the code you're using, you can figure out the structure yourself by looking at the source of an html-file in which a swf has been embedded

:) - Ruben

tg
08-08-2004, 06:42 AM
read thru the whole thread.... we gave you all you need. you just need to output the correct structure.

darkstyle
08-09-2004, 09:38 PM
yes as u guys said i did it....

<!-- Hide this script from old browsers --
//document.write('<embed SRC="images/' + image + '" width="753" height="410">')
document.write('<center>');
document.write('<embed src="' + image + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="753" height="410"></embed>');
document.write('<PARAM NAME=menu VALUE=false>');
document.write('</center>');
// -- End Hiding Here -->

but its seems not working,,,, in this java scripts

tg
08-09-2004, 10:22 PM
read post number 3 in this tread.


then click & read the first link in post number 4.

Du'Fromage
10-27-2004, 11:05 AM
<!-- Hide this script from old browsers --
//document.write('<iframe src="images/' + image + '" width="753" height="410"></iframe>')
document.write('<center>');
document.write('<iframe src="' + image + '" width="753" height="410"></iframe>');
document.write('</center>');
// -- End Hiding Here -->

You will find this will get past the problem of ie not reading embed tags. plus is less key strokes :p

this is also w3.org approved