Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-03-2004, 08:00 AM   #1
darkstyle
Senior Member
 
Join Date: Jun 2004
Posts: 133
Send a message via MSN to darkstyle Send a message via Yahoo to darkstyle
Default randome page change on refresh..

hi there, i having some banners on my website , each time i visit the site, the banner changes randomly, i am using this script

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


var imagenumber ;
var 
randomnumber Math.random() ;
var 
rand1 Math.round( (imagenumber-1) * randomnumber) + ;
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.?
darkstyle is offline   Reply With Quote
Old 08-04-2004, 08:00 PM   #2
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,510
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

original piece:
Code:
<!-- 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:
Code:
<!-- 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
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."

Last edited by Ruben; 08-04-2004 at 08:02 PM..
Ruben is offline   Reply With Quote
Old 08-04-2004, 08:18 PM   #3
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

<param > tag is use for the <object> tag.
<object> tag is read by ie... i don't believe ie reads the <embed> tag.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-04-2004, 08:22 PM   #4
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

Quote:
Originally Posted by macromedia website
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/fl...ts/tn4150.html

to do what you want look at the examples on this page:
http://www.macromedia.com/support/fl...ents/wmode.htm
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-04-2004, 08:24 PM   #5
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

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.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-05-2004, 09:27 AM   #6
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,510
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

Quote:
Originally Posted by tg
<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...

- Ruben
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."
Ruben is offline   Reply With Quote
Old 08-05-2004, 02:55 PM   #7
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

Quote:
Originally Posted by Ruben
Anyways, the idea stays the same...
yep.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-05-2004, 09:40 PM   #8
darkstyle
Senior Member
 
Join Date: Jun 2004
Posts: 133
Send a message via MSN to darkstyle Send a message via Yahoo to darkstyle
Default

hay wait a min....
this code doesnt work then how i make it work????
please help.

code after editing... which doesnt work.
Code:
<!-- 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 -->
__________________
Regards
Interactive Designer.

Last edited by darkstyle; 08-07-2004 at 10:25 AM..
darkstyle is offline   Reply With Quote
Old 08-07-2004, 10:32 AM   #9
darkstyle
Senior Member
 
Join Date: Jun 2004
Posts: 133
Send a message via MSN to darkstyle Send a message via Yahoo to darkstyle
Default

when i put object tag it doesnt work...
__________________
Regards
Interactive Designer.
darkstyle is offline   Reply With Quote
Old 08-07-2004, 11:01 AM   #10
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,510
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

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
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."
Ruben is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:17 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.