iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
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

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-11-2006, 04:01 PM
WebProWorld Pro
 
Join Date: Aug 2005
Location: Shasta lake, California
Posts: 132
adacprogramming RepRank 0
Default Dynamically change which flash movie shows EMBED problem

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>
THis is my code for the small pic
[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
Reply With Quote
  #2 (permalink)  
Old 09-11-2006, 09:28 PM
WebProWorld Member
 
Join Date: Jul 2006
Location: Oakland, CA
Posts: 45
holyhttp RepRank 0
Default Dynamically change which flash movie shows EMBED problem

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.
Reply With Quote
  #3 (permalink)  
Old 09-12-2006, 03:41 AM
WebProWorld New Member
 
Join Date: Nov 2005
Location: Auckland, New Zealand
Posts: 19
rwil02 RepRank 0
Default Did you remember to start the movie?

I suspect that even if you could change the src of the embed, you probably need to restart the movie.
Reply With Quote
  #4 (permalink)  
Old 09-12-2006, 11:34 AM
WebProWorld Member
 
Join Date: Jun 2006
Location: islip, ny
Posts: 42
philscanlan RepRank 0
Default

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
Reply With Quote
  #5 (permalink)  
Old 09-12-2006, 04:18 PM
WebProWorld Pro
 
Join Date: Aug 2005
Location: Shasta lake, California
Posts: 132
adacprogramming RepRank 0
Default

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
Reply With Quote
  #6 (permalink)  
Old 09-12-2006, 04:20 PM
WebProWorld Pro
 
Join Date: Aug 2005
Location: Shasta lake, California
Posts: 132
adacprogramming RepRank 0
Default Re: Did you remember to start the movie?

Quote:
Originally Posted by rwil02
I suspect that even if you could change the src of the embed, you probably need to restart the movie.
I tried this, but I couldn't get the movie to restart. It kept playing the old one. I'm not using a control panel, I have the move play like an image.

Is there a way to have the movie restart automatically?
Reply With Quote
Reply

  WebProWorld > Site Design > Flash Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:26 AM.



Search Engine Optimization by vBSEO 3.3.0