Javascript and flash problem - please help!

J

johnsonholding

Here is the script I have in my page :

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=194,height=146,left
= 440,top = 288');");
}

// End -->
</script>

It opens a new window when the user clicks on a certain link.

Well, somewhere else in the page, I embeded a flash media object and
found out now that everytime the page opens, the pop up window opens
too which is NOT what I want. I want the Popup window to only open
when the user clicks on a text link (which it did work perfectly until
I put in the flash object).

So why is the flash object calling the popup window instead of just
playing like it is supposed to?
 
L

Lee

(e-mail address removed) said:
Here is the script I have in my page :

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=194,height=146,left
= 440,top = 288');");
}

// End -->
</script>


Replace that nonsense with:

function popUp(URL) {
window.open(URL,
"w"+(new Date()).getTime(),
"width=194,height=146,top=440,top=288");
}
It opens a new window when the user clicks on a certain link.

Well, somewhere else in the page, I embeded a flash media object and
found out now that everytime the page opens, the pop up window opens
too which is NOT what I want.

My guess is that you did something wrong when you embedded the object,
but you haven't shown us that code, so it's just a guess.


--
 
R

Randy Webb

(e-mail address removed) said the following on 3/26/2006 9:38 PM:
Here is the script I have in my page :

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',

'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=194,height=146,left
= 440,top = 288');");
}

// End -->
</script>

<script type="text/javascript">
function myPopupFunction(URL){
day = new Date();
id = day.getTime();
windowRef = "page" + id;
windowRef=window.open(URL,id,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=194,height=146,left=440,top=288);
}
It opens a new window when the user clicks on a certain link.

It had some problems with it though. The eval was not needed and the
feature list can not have spaces in it. It is a comma delimited list.
Well, somewhere else in the page, I embeded a flash media object and
found out now that everytime the page opens, the pop up window opens
too which is NOT what I want. I want the Popup window to only open
when the user clicks on a text link (which it did work perfectly until
I put in the flash object).
So why is the flash object calling the popup window instead of just
playing like it is supposed to?

Sounds like your flash object may have a call in it somewhere that calls
a popUp function. Try changing the name of your function and see what
happens.
 
J

johnsonholding

Ok, I replace that old code with the new code and it still gives me the
problem of popping up because of the flash link. Sorry, here is the
code.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="246" height="172">
<param name=movie
value="flash/knucklehead.swf">
<param name=quality value=high>
<embed src="flash/knucklehead.swf"
quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="246" height="172">
</embed>
</object>
 
J

johnsonholding

Ok, here is my newest version of the script :

function jumpUp(URL) {
window.open(URL,
"w"+(new Date()).getTime(),
"width=194,height=146,top=440,top=288");
}

</script>

And here is the Call to for the Popup window :

<a href="javascript: jumpUp('webmovies/reverse_flash.swf')">preview</a>


Works in Firefox, but I get an error in IE 6.0


Here is the Flash :
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="246" height="172">
<param name="movie"
value="flash/knucklehead.swf">
<param name="quality"
value="high"><param name="LOOP" value="false">
<embed src="flash/knucklehead.swf"
width="246" height="172" loop="false" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash"></embed></object>

Any help is appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top