468,457 Members | 1,819 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,457 developers. It's quick & easy.

Javascript and flash problem - please help!

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,men ubar=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?

Mar 27 '06 #1
3 1499
jo************@yahoo.com 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 + "',
<URL: http://jibbering.com/faq/#FAQ4_40 >
'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=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,wid th=194,height=146,left=440,top=288);
}
</script>
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 27 '06 #2
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>
Lee wrote:
jo************@yahoo.com 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,me nubar=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");
}
</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.


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.
--


Mar 27 '06 #3
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.

Mar 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by kidalex | last post: by
2 posts views Thread by Anees | last post: by
1 post views Thread by critchey1 | last post: by
1 post views Thread by subhajit12345 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.