|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Flash Discussion Forum Flash design presents a limitless number of possibilities for your sites and designs. Discuss your Flash ideas, questions and issues here. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
The site I am working with is
http://www.halemakaicottages.com/Cottage5.aspx What I am trying to do is when I click on one of the small pictures I want to change the large picture to show a diffent flash movie. Currently I am using images for the small pic and a javascript onclick. When it is clicked I am changine the src for the lage pic which will be a embed this is my code for the large Pic Code:
<DIV align="center"><EMBED id="MainPic" src="Common/Images/bath1.swf" AUTOSTART=TRUE width="295" height="220" type="application/x-shockwave-flash"></EMBED></DIV> [code][img]Common/Images/Cottage1LivingThumb.jpg[/img] If I change this to use images it works fine, but when I do the flash, the movie does not change to the new movie, No errors, it just doesn't change. Do I need to add something to get it to start running the new src? Thanks For the help |
|
|||
|
I suggest you use the innerHTML property to change the embedded code. Here is a sample html page tested successfully in IE.
Feel free to use relative path. I had to use the abosulte path to get the flash files from your server. ================================================ <html> <head> <title></title> </head> <body> <DIV align="center" id="flcontainer"><EMBED id="MainPic" src=" http://www.halemakaicottages.com/Common/Images/bath1.swf" AUTOSTART=TRUE width="295" height="220" type="application/x-shockwave-flash"></EMBED></DIV> Click Here <script language="javascript"> var ie=(document.all)?1:0; function LoadNew(mov){ var tmp; if(ie){ tmp=eval('document.all.flcontainer'); tmp.innerHTML='<EMBED id="MainPic" src="http://www.halemakaicottages.com/Common/Images/'+mov+'" AUTOSTART=TRUE width="295" height="220" type="application/x-shockwave-flash"></EMBED>'; } } </script> </body> </html> ============================================= Feel free to make the code cleaner and portable. |
|
|||
|
If you wanted to have one master .swf which loads different movies into it with ActionScript, this should do the trick.
Macromedia Flash / JavaScript Integration Kit http://weblogs.macromedia.com/flashjavascript/ http://www.communitymx.com/content/a...ge=2&cid=D7491
__________________
if you're reading this, I'm bored |
|
|||
|
Thanks for the tip. I'll give that a try. I'm currently using a round trip to the server, But I like this better.
Thanks |
|
|||
|
Quote:
Is there a way to have the movie restart automatically? |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |