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. Advertisements

  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. Advertisements

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. Charles A. Lackman

    Aspx and Javascript and Flash

    Charles A. Lackman, May 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    553
    =?Utf-8?B?c3Jpbmk=?=
    May 20, 2004
  2. Bernie
    Replies:
    0
    Views:
    869
    Bernie
    Sep 5, 2004
  3. Jim Higson
    Replies:
    1
    Views:
    762
    Jim Higson
    Sep 21, 2004
  4. Replies:
    8
    Views:
    24,155
    SABOND21
    Feb 9, 2012
  5. Mark
    Replies:
    2
    Views:
    268
    Michael Winter
    May 6, 2004
  6. Replies:
    4
    Views:
    149
  7. Replies:
    1
    Views:
    193
  8. Replies:
    2
    Views:
    796
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...