Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transfering variables from html form to flash

Status
Not open for further replies.

leearach2004

Technical User
Dec 8, 2005
86
GB
Hi there hope somone can help this is realy frustrating me now

I am trying to transfer some text from a html form to a flash movie text area, i havent done thi sbefor ebut i have seen loads of examples on the net and they all say they work but i cant get them 2

my flash file has a:

dynamic text area with the var set to myVar

the code fork the html is below


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns=" xml:lang="en" lang="en">
<head>

<SCRIPT LANGUAGE=JavaScript>
<!--
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("myVar", sendText);
}
//-->
</SCRIPT>



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>javascript_to_flash</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<p>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" width="550" height="400" id="myFlash" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="javascript_to_flash.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="javascript_to_flash.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="myFlash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" swLiveConnect="true"/>
</object>
</p>
<form name="form1" id="form1" method="post" action="">
<input type="text" name="sendText" maxlength="45" onChange="doPassVar(this)">
</form>
<p>&nbsp;</p>
</body>
</html>


acording to all the tutorials i have read this should run fine. It doesnt through any errors but after typing into the form text box nothing showsup in the flash files as it is surposed to

hope somone can help me its driving me mad

lee
 
hi there have done what you asked and firefox showd an error saying that the javascript was barred from accessing the flash file by flash player

i added the file to the flash players allowed list and it works now and thats fine but what do i do when other people come to use it, surley everyone dosent need to add it to there allowed list thats a long process is there away arounf this

if you need any more info just ask

speek soon

lee
 
hi there thanks for the reply, the problem i have is this applications runs of a cd as well as over the web so it needs to run in both.

it runs fine over the web but has this error when run localy unlese u add it to allowed list

is there any way of this running localy without having to add it to the flash player settings. maybee some actionscript to allow access or some security setting i dont know can this be done

lee
 
hi there ill try that thank you do you know where in my swf i would put that actionscript so i know where to start

thanks for all your help couldnt have got anywere without you much appreciated

lee
 
hi there thanks for all your help unfortunatly that didnt work but i do have an idea now i found somthing on

system.security.sandbox (properties)

this apparently can set an application as trusted to run localy just like if you add it in the settings of flash player but have no idea how it works

can i add this as a new thread or leave it as part of this one

lee
 
hi there the code line you gave me

system.security.allowdomaine(*)

did not work

i found somthing about that flash player 8 and above block local usage of script to script unless u add it to the allow list or you use some code like
system.security.sandboxtype {properties} but cant fined that much about it and when i do its all like reading italian

lee
 
hi there i have found a way that acording to macromedia is the only way of setting local secuirty espicaly from cd-rom

Thought id post the answer to you after you helped me so much so you could pass it on

You need to add a security file to

c:\windows\system32\macromed\flash\FlashPlayerTrust\

you may need to craete the flash player trust directory

you just add a text file to this using notepad with the directory that the flash file is in

e.g c:\flash
d:\flash

one for each location

save the file as a text file with coding unicode-8 or unicode-16

this then grants acess to local file for thouse programs in thouse directories

you can then add this to an installer otr somthin to add it to all computers when they run the the cd

this was macomedias way of doing it I have tried it and it works

let me know

lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top