swoop80
06-25-2007, 12:34 AM
Well... i've blown an entire day searching for solutions on this... that's not exactly surprising... i'm a rookie at javascript and all things webbish... haha
I've learned how to use basic 'flash' now... and i've incorporated it into a website I'm playing with... but I then decided I wanted the flash movie (swf) to also act as a 'link' to another page on the site....
Well... the DIV in question (where I'm placing my swf - which is in an IFRAME) is first defined as a regular old DIV... with a static image (a picture of a camera) and an "onclick" event ... to go to the same "photos" page that I want my nifty flash movie to link to... if I can get it working...
I added some detection logic that checks to see if flash is installed on the client computer. The idea is to replace the contents of the DIV (which starts out as the static picture of a camera... with link to a "photo" page on the site) with the nifty flash 'rotating camera' movie... But I really wanted the nifty flash object to also link to that same 'photo page'.
Now, I've been told that there is a way within flash to have the movie do it's own "onclick" event... but I'm trying to learn how to do it in javascript or HTML and not rely on flash for that...
Here is the 'body' of my document...
the swfobject thing is the gizmo that tells me if the client has flash on their computer...
hope you folks can straighten me out
oh.. I actually have tried lots of things in place of the line that is underlined below... (a few of them just made the newly supplied onclick go ahead and fire - without even being clicked on... but I cant even recall what those formats were that made it do that... it was much earlier in the day... haha).
one more quick thing... i was actually thinking that if the DOM record of the onclick simply could be retained (not clobbered) when I copy my flash goodies in via the 'write' statement near the end... then I wouldn't even need to reestablish an onclick... (but then, I probably wouldn't learn everything I'd like to learn here, either...)
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#999999" alink="#33FFFF">
<script type="text/javascript" src="swfobject.js"> </script>
<div id="flashcamera" onclick="doPhotos()" style="position:absolute; width:200px; height:150px; z-index:1; left:35px; top:380px;">
<img src="/images/webd_graphics/camera_static.gif" align="absbottom">
</div>
<script type="text/javascript">
var so = new SWFObject("camera3Dg.swf", "mymovie", "140", "110", "3", "#000000");
so.write("flashcamera");
document.getElementById('flashcamera').onclick="doPhotos()";
</script>
</body>
I've learned how to use basic 'flash' now... and i've incorporated it into a website I'm playing with... but I then decided I wanted the flash movie (swf) to also act as a 'link' to another page on the site....
Well... the DIV in question (where I'm placing my swf - which is in an IFRAME) is first defined as a regular old DIV... with a static image (a picture of a camera) and an "onclick" event ... to go to the same "photos" page that I want my nifty flash movie to link to... if I can get it working...
I added some detection logic that checks to see if flash is installed on the client computer. The idea is to replace the contents of the DIV (which starts out as the static picture of a camera... with link to a "photo" page on the site) with the nifty flash 'rotating camera' movie... But I really wanted the nifty flash object to also link to that same 'photo page'.
Now, I've been told that there is a way within flash to have the movie do it's own "onclick" event... but I'm trying to learn how to do it in javascript or HTML and not rely on flash for that...
Here is the 'body' of my document...
the swfobject thing is the gizmo that tells me if the client has flash on their computer...
hope you folks can straighten me out
oh.. I actually have tried lots of things in place of the line that is underlined below... (a few of them just made the newly supplied onclick go ahead and fire - without even being clicked on... but I cant even recall what those formats were that made it do that... it was much earlier in the day... haha).
one more quick thing... i was actually thinking that if the DOM record of the onclick simply could be retained (not clobbered) when I copy my flash goodies in via the 'write' statement near the end... then I wouldn't even need to reestablish an onclick... (but then, I probably wouldn't learn everything I'd like to learn here, either...)
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#999999" alink="#33FFFF">
<script type="text/javascript" src="swfobject.js"> </script>
<div id="flashcamera" onclick="doPhotos()" style="position:absolute; width:200px; height:150px; z-index:1; left:35px; top:380px;">
<img src="/images/webd_graphics/camera_static.gif" align="absbottom">
</div>
<script type="text/javascript">
var so = new SWFObject("camera3Dg.swf", "mymovie", "140", "110", "3", "#000000");
so.write("flashcamera");
document.getElementById('flashcamera').onclick="doPhotos()";
</script>
</body>