PDA

View Full Version : opening and closing layers using get url in flash


chrisbees1
01-22-2003, 08:03 PM
Hi!

In a flash movie i want a piece of code what i would persume to be javascript which would allow me to use a GetUrl command to open and close layers on the .html page which the flash movie is based on.

I have an attachment to this message - im not asking you to do it for me but i thought it may help.

Thanks in advance, Chris

Danne
01-22-2003, 08:55 PM
I think you have to use the fs_command in flash, and write a responding function with that name in the HTML-file.



<script language="JavaScript"><script>
<script language="VBScript">

Sub FlashMovieID_FSCommand(ByVal command, ByVal args)
call FlashMovieID_DoFSCommand(command, args)
end sub

</script>
<script language="JavaScript">

function FlashMovieID_DoFSCommand(command, args)
{
// hide / show divs
}

</script>



I haven't seen a solution without that VB Script part, but it was a whlie since I messed with flash-movie integration...:p

chrisbees1
01-23-2003, 06:50 PM
ok thanks for the help but me fairly new to this and dont really have a clue!!!

is there any way you can break down that code and explain whether it goes in the flash movie or the .html page ?

Thanks in advance, Chris

Danne
01-23-2003, 07:47 PM
In the flash-file you probably have some event on some button like:


on (release)
{
fscommand ("hide", "div1");
}



And in the html-file you put this code:


<script language="JavaScript"><script>
<script language="VBScript">

Sub FlashMovieID_FSCommand(ByVal command, ByVal args)
call FlashMovieID_DoFSCommand(command, args)
end sub

</script>
<script language="JavaScript">

function FlashMovieID_DoFSCommand(command, args)
{
if(command=="hide")
document.all(args).style.display="none";
else
document.all(args).style.display="block";
}

</script>

<div id="div1">
Content1</div>
<div id="div2">
Content2</div>
<div id="div3">
Content3</div>



Btw, the purpose of that first script tag is only to set the default scripting language to javascript.

Check the flash manual for more info about the fscommand...