all groups > flash actionscript > august 2005 >
You're in the

flash actionscript

group:

Creating HTML based link to make flash play ?!?


Creating HTML based link to make flash play ?!? johnegbert
8/8/2005 8:16:44 PM
flash actionscript:
hey all,
I tried searching for this because I am sure its been answered, but the only
thing I could find was the Localconnection information which I am not looking
for.

Half of the page I have set up is HTML based, it has some flash stuff
integrated into it. I need to have one of my buttons when clicked make flash
perform an action. so when i click the link it sets a flash property or makes
flash play.... can anyone help me with this? or send me a link to something?
Thanks in advance.
John
Re: Creating HTML based link to make flash play ?!? daveystew
8/8/2005 8:53:28 PM
Re: Creating HTML based link to make flash play ?!? johnegbert
8/9/2005 7:43:06 PM
Re: Creating HTML based link to make flash play ?!? JFincanon
8/9/2005 8:11:23 PM
Originally posted by: johnegbert
....one of my buttons when clicked make flash perform an action...

Re: Creating HTML based link to make flash play ?!? johnegbert
8/9/2005 9:38:02 PM
Re: Creating HTML based link to make flash play ?!? JFincanon
8/9/2005 10:17:40 PM
ok... check http://www.fincanon.com/posts/JS2Flash.zip

First, you need to publish the swf AND the html from Flash to get most of the
JavaScript used here.
Next, take a look at my html in that zip and pay attention to the 3 parts that
say the following:

1:
//Script to handle play button
if(command == "play"){
JS2FlashObj.Play();
}


2:
<!--Script to handle play button-->
function play(){
JS2Flash_DoFSCommand("play","")
}


3:
<!--button to play flash movie-->
<form name="theForm">
<a href="#" onClick="play()">PLAY</a>
</form>

Add those parts to YOUR html and then replace "JS2Flash" with the name of your
movie and (of course) replace my "PLAY" link with your image.


Good luck to you and let me know if that helps.
Re: Creating HTML based link to make flash play ?!? johnegbert
8/12/2005 12:00:00 AM
JFincanon, u are officially the man!!! big thanks!! out of curiousity, do you
have something prebuilt where it doesnt just do the Play command, more of a
gotoAndPlay type thing so you can have multiple links? If not, no worries, I
can figure it out, but just curious if there was something you had already.
Thanks again!!!
Re: Creating HTML based link to make flash play ?!? JFincanon
8/12/2005 12:00:00 AM
Try this:


1:
//Script to handle play button
if(command == "play"){
JS2FlashObj.Play();
}
if(command == "goto"){
JS2FlashObj.GoToFrame(args);
JS2FlashObj.Play();
}


2:
<!--Script to handle play button-->
function play(){
JS2Flash_DoFSCommand("play","")
}
function goto(){
if(theForm.frameNum.value == ""){
theForm.frameNum.value = "0";
}
JS2Flash_DoFSCommand("goto",parseInt(theForm.frameNum.value));
}

3:
<!--button to play flash movie-->
<form name="theForm">
<a href="#" onClick="play()">PLAY</a><br>
<a href="#" onClick="goto()">Go To Frame:</a><input type="text" size="2"
name="frameNum">
</form>
AddThis Social Bookmark Button