Help, New to Flash and Javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric

    #1

    Help, New to Flash and Javascript

    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:SwaneyDownloa dsReadme.txt instead of G:\Swaney\Downl oads\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.cli ck()
    while(document. forms.upload.fi le == "")
    {
    setTimeout(100)
    }
    idio_controller ()
    }

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

    function idio_controller () {
    var obj=parent.main .uploadflash;
    if (obj) eval('obj.SetVa riable("filenam e",
    "'+document.for ms.upload.file. value+'")');
    }
    //-->
  • Martin Honnen

    #2
    Re: Help, New to Flash and Javascript



    Eric wrote:
    [color=blue]
    > 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:SwaneyDownloa dsReadme.txt instead of G:\Swaney\Downl oads\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.cli ck()
    > while(document. forms.upload.fi le == "")
    > {
    > setTimeout(100)
    > }
    > idio_controller ()
    > }
    >
    > function submitIt(){
    > document.upload .submit()
    > }
    >
    > function idio_controller () {
    > var obj=parent.main .uploadflash;
    > if (obj) eval('obj.SetVa riable("filenam e",
    > "'+document.for ms.upload.file. value+'")');[/color]

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

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    Working...