Help, New to Flash and Javascript

E

Eric

I have the following code I am calling from a flash file. Everything
works fine except that the string it returns for the file location
does not include the slashes. It is returning
G:SwaneyDownloadsReadme.txt instead of G:\Swaney\Downloads\Readme.txt.
Is it something in my code that is causing this, or how flash is
interpreting the variable?

<!--
function browse()
{
document.forms.upload.file.click()
while(document.forms.upload.file == "")
{
setTimeout(100)
}
idio_controller()
}

function submitIt(){
document.upload.submit()
}

function idio_controller() {
var obj=parent.main.uploadflash;
if (obj) eval('obj.SetVariable("filename",
"'+document.forms.upload.file.value+'")');
}
//-->
 
M

Martin Honnen

Eric said:
I have the following code I am calling from a flash file. Everything
works fine except that the string it returns for the file location
does not include the slashes. It is returning
G:SwaneyDownloadsReadme.txt instead of G:\Swaney\Downloads\Readme.txt.
Is it something in my code that is causing this, or how flash is
interpreting the variable?

<!--
function browse()
{
document.forms.upload.file.click()
while(document.forms.upload.file == "")
{
setTimeout(100)
}
idio_controller()
}

function submitIt(){
document.upload.submit()
}

function idio_controller() {
var obj=parent.main.uploadflash;
if (obj) eval('obj.SetVariable("filename",
"'+document.forms.upload.file.value+'")');

Throw out the eval, use
if (obj && obj.SetVariable) {
obj.SetVariable("filename", document.forms.upload.file.value);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top