Question
flash to html to flash
I've read how to send a variable TO html and how to retrieve
a variable FROM html, but how do I do this in one swoop? I'm just
testing now, but I want to send text to a variable (to html) by
clicking a button in flash, then have another text field show that
same text at the same time.
I know that it is being sent by testing (an alert()) but the textfield is not updating. Please help.
* The Javascript part shows how I could use <PARAM><EMBED> and flash.swf?var=
ACTIONSCRIPT:
go_btn.onRelease = function(){
if(comment_add!=""){ //the textfield which you type
getURL("javascript:update('"+comment_add+"')");
}
}
if(comment_fv!=""){
comment_txt = comment_fv; //the textfield that shows the text you wrote
}else{
comment_txt = "Nothing has been typed";
}
JAVASCRIPT:
var whatswf = "flashvars";
var swf_w = "550";
var swf_h = "400";
var comment_html = "";
//var rannum = "";
function update(comment)
{
comment_html = comment;
window.location.reload();
}
//var paramst = "?comment_fv=" + comment_html + "&rannum=" + Math.floor(Math.random() * 65000); //FlashVars
var newtext = "<CENTER><OBJECT classid='clsid
27CDB6E-AE6D-11cf-96B8-444553540000' ";
newtext+= " codebase=' http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' ";
newtext+= " ID='" + whatswf + "' WIDTH='" + swf_w + "' HEIGHT='" + swf_h + "' ALIGN=''>";
newtext+= " <PARAM NAME=movie VALUE=" + whatswf + ".swf>";// + paramst + ">";
newtext+= " <PARAM NAME=quality VALUE=high>";
newtext+= " <PARAM NAME=scale VALUE=noborder>";
newtext+= " <PARAM NAME=bgcolor VALUE=#FFFFFF>";
newtext+= " <PARAM NAME=FlashVars VALUE=comment_fv=" + comment_html +">"; //FlashVars
newtext+= " <EMBED src=" + whatswf + ".swf";// + paramst;
newtext+= " quality=high scale=noborder bgcolor=#FFFFFF";
nnst += " FlashVars='comment_fv=" + comment_html + "'"; //FlashVars
newtext+= " WIDTH='" + swf_w + "' HEIGHT='" + swf_h + "' swLiveConnect=true ID='" + whatswf + "' NAME='" + whatswf + "' ALIGN='' ";
newtext+= " TYPE='application/x-shockwave-flash' ";
newtext+= " PLUGINSPAGE=' http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT></CENTER>";
document.write(newtext);
I know that it is being sent by testing (an alert()) but the textfield is not updating. Please help.
* The Javascript part shows how I could use <PARAM><EMBED> and flash.swf?var=
ACTIONSCRIPT:
go_btn.onRelease = function(){
if(comment_add!=""){ //the textfield which you type
getURL("javascript:update('"+comment_add+"')");
}
}
if(comment_fv!=""){
comment_txt = comment_fv; //the textfield that shows the text you wrote
}else{
comment_txt = "Nothing has been typed";
}
JAVASCRIPT:
var whatswf = "flashvars";
var swf_w = "550";
var swf_h = "400";
var comment_html = "";
//var rannum = "";
function update(comment)
{
comment_html = comment;
window.location.reload();
}
//var paramst = "?comment_fv=" + comment_html + "&rannum=" + Math.floor(Math.random() * 65000); //FlashVars
var newtext = "<CENTER><OBJECT classid='clsid
newtext+= " codebase=' http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' ";
newtext+= " ID='" + whatswf + "' WIDTH='" + swf_w + "' HEIGHT='" + swf_h + "' ALIGN=''>";
newtext+= " <PARAM NAME=movie VALUE=" + whatswf + ".swf>";// + paramst + ">";
newtext+= " <PARAM NAME=quality VALUE=high>";
newtext+= " <PARAM NAME=scale VALUE=noborder>";
newtext+= " <PARAM NAME=bgcolor VALUE=#FFFFFF>";
newtext+= " <PARAM NAME=FlashVars VALUE=comment_fv=" + comment_html +">"; //FlashVars
newtext+= " <EMBED src=" + whatswf + ".swf";// + paramst;
newtext+= " quality=high scale=noborder bgcolor=#FFFFFF";
nnst += " FlashVars='comment_fv=" + comment_html + "'"; //FlashVars
newtext+= " WIDTH='" + swf_w + "' HEIGHT='" + swf_h + "' swLiveConnect=true ID='" + whatswf + "' NAME='" + whatswf + "' ALIGN='' ";
newtext+= " TYPE='application/x-shockwave-flash' ";
newtext+= " PLUGINSPAGE=' http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT></CENTER>";
document.write(newtext);