Help, New to Flash and Javascript

Discussion in 'Javascript' started by Eric, Jan 7, 2004.

  1. Eric

    Eric Guest

    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+'")');
    }
    //-->
     
    Eric, Jan 7, 2004
    #1
    1. Advertising

  2. Eric wrote:

    > 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);
    }
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 7, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernie
    Replies:
    0
    Views:
    561
    Bernie
    Sep 5, 2004
  2. Jim Higson
    Replies:
    1
    Views:
    519
    Jim Higson
    Sep 21, 2004
  3. Replies:
    8
    Views:
    23,521
    SABOND21
    Feb 9, 2012
  4. Replies:
    1
    Views:
    102
  5. Replies:
    2
    Views:
    470
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page