Link to home
Start Free TrialLog in
Avatar of sucram
sucram

asked on

Javascript & Flash

Hi to all flashers out there!

My Q:

I would like to interact with a flashmovie by using javascript. My
Problem: I have serveral movies-clips in a flash-file which are
invisible. by clicking on a normal button in a normal html page in a
frame, a movie-clip in the flash, which is not in the same frame as the
button, should become visible.

Is there anyone who has a idea how to manage this?

thank you very much

sucram
ASKER CERTIFIED SOLUTION
Avatar of shekarkr
shekarkr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ssdesign
ssdesign

Suppose you have a page with left and right frame. Left has buttons and right has Flash movie.

1. in the page on the left, you need to add followinf code to the buttons that are to control the movie on the right. the actions are:

<a href="javascript:controlFlash(20)">

and

<a href="javascript:controlFlash(40)">

This is supposing that on clik of these two buttons you want to move to frame 20 and frame 40 of your flash movie respectively. Change this code to your requirement.

save the page.
Call it "left.html"

2. in the HTML page for left.html, add this code right after the </title> tag:

<script language="JavaScript">
<!--
function controlFlash(theFrame){
parent.frames.right.right.GoToFrame(theFrame);
}

</script>

4. in the HTML for right.html (the one with flash movie), add this to the EMBED tag, right after this part "<EMBED src="right.swf"" -

name=right

5. save all the documents and
test in browser.

this should work on most browsers, with the exception of macintosh internet explorer 4.5 and below, which has limited implementation of javascript.

let me know if this works for you.

Sajid
This is one of the many implementations that is covered in the tutorial. Check it out and lemme know...

Best Rgds,
Shekar.