PDA

View Full Version : What is wrong with this javascript?


LiVe'O'cLoThInG
12-12-2005, 09:48 PM
I have several popups on my flash site, on these popups I want buttons which return you to the main movie at a certain frame. The buttons on the popups are also in flash movies. So far I have this actionscript on my button...

on(release){
getURL("javascript: window.opener.dosomething()")
}

and this code in the HTML of my main site...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script language="JavaScript">
function dosomething() {
if(window.document['liveoclothing']){
window.document['liveoclothing'].GotoFrame(658);
}
else if(navigator.appName.indexOf("Microsoft Internet")==-1){
if (document.embeds && document.embeds['liveoclothing']){
document.embeds['liveoclothing'].GotoFrame(658);
}
}
else if(navigator.appName.indexOf("Microsoft Internet")!=-1){
document.getElementById('liveoclothing').GotoFrame (658);
}
}
</script>
<link rel="shortcut icon" href="favicon.ico" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>LiVe 'O' cLoThInG.cOm</title>
<style type="text/css">
<!--
body {
background-image: url();
background-color: #000000;
}
-->
</style></head>
<body>
<!--url's used in the movie-->
<!--text used in the movie-->




<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="700" height="550" id="liveoclothing">
<param name="movie" value="liveoclothing.swf" />
<param name="quality" value="high" />
<embed src="liveoclothing.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="liveoclothing" swLiveConnect="true" width="700" height="550"></embed>
</object>

</body>
</html>

so far, nothing happens when the button is pressed.

Can anyone help?

davidj
12-13-2005, 09:34 AM
in your function try changing ...

window.document['liveoclothing'])
to
document.liveoclothing or document.getElementById('liveoclothing')

ramandeep
12-15-2005, 09:12 AM
Its going to work !As DJ knows Javascript inside out! ;)