all groups > macromedia flash flash remoting > february 2005 >
You're in the

macromedia flash flash remoting

group:

loadVariablesNum calling .cfm



loadVariablesNum calling .cfm eyal453
2/19/2005 12:14:41 AM
macromedia flash flash remoting: hey... I'm trying to do something simple here. i just want to import some text
from .cfm file... both the swf and the cfm files are on the same domain and in
the same folder. when i try to import text using loadVariablesNum from a .cfm
file it doesnt work.. but from a .txt file it does work... i used the code in
the help section of Flash MX... it is a coldfusion server that i'm working
on... the cfm file looks exactly like the .txt file... except i changed the
extension... all it contains for now is done=1&txt=blahblahblah i just
want to get the txt variable... the done is used for the verifying loop... to
tell me when it is done loading. it imports the text into a textField... i
tried using absolute path and relative path... still no go.. here's the code:
---------------------------- loadVariablesNum('feedback.cfm',2); function
chk(){ if(_level2.done!=undefined){ _root.txt1.htmlText=_level2.txt;
clearInterval(param_int); } } var param_int=setInterval(chk,500);
------------------------- any ideas??? Eyal.
Re: loadVariablesNum calling .cfm derobinson
2/20/2005 7:01:07 PM
I think it only works for .txt files, even if the content is the same. You
could have CF create the .txt file for Flash to consume. But since you have CF,
why not just use Remoting? You'd probably have a lot more control over things.

Good luck!

Re: loadVariablesNum calling .cfm eyal453
2/20/2005 7:07:22 PM
hey... thanks for replying... in the description of the loadVariable or
loadVaraiblesNum functions it says that they're meant to retrieve information
from server side pages... as in ASP,PHP, coldFusion and so on... my problem
is... the server i'm working on doesnt allow tags that write files on the
server... therefore i'm limited to using only databases with queries...
loadVariablesNum gives me the option to retrieve data from a database through
another CF page that calls the database... for some reason it won't open the
..cfm file... only .txt file... Eyal.
Re: loadVariablesNum calling .cfm naz2003
2/21/2005 4:29:23 AM
Hi I think there is a problem in if condition and the level(2) u loads the var
, because i can get a value from cfm file using loadVariablesNum
loadVariablesNum('feedback.cfm',2); change to
loadVariablesNum('feedback.cfm',0); ald place text field in the name of 'txt'
an check i hope this will work function chk(){ if(_level2.done!=undefined){
<---- _root.txt1.htmlText=_level2.txt; clearInterval(param_int); } } var
param_int=setInterval(chk,500);
Re: loadVariablesNum calling .cfm eyal453
2/21/2005 4:41:47 AM
hey... still nothing... i took this script straight from the flash help
file... and it worx fine with the .txt file... therefore i'm assuming there's
no problem with the script in the flash file... however, you think that CF5
server might cause problems like that? i dont see how it would be related but
maybe there is some sort of connection... Eyal.
Re: loadVariablesNum calling .cfm eyal453
2/22/2005 4:55:35 AM
problem solved !!! aparently, for some reason... when writing a .cfm file for a
loadVaribales function... you must begin the variables list with &amp; ex:
&amp;var1=123&amp;var2=34343 ... this is the only way the swf will read the cfm
file properly... when reading from txt files you can start without the &amp;
sign... ex: var1=12312&amp;var23434.... and it still reads them right... tiny
details.. it's always about that... Eyal.
AddThis Social Bookmark Button