A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: LoadVariablesNum problems

  1. #1
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304

    LoadVariablesNum problems

    I am trying to use the loadvariablenum actionscript to load a external text file. It works but the text opens in its own internet explorer window and not the text box that I want it to load into. This is the code I am using

    loadVariablesNum("Otterspecs.txt","textbox");

    What am I doing wrong?

    thanks

  2. #2
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    welll... wrong syntax, loadVariablesNum requires two inputs, a path to the file, and a number.

    assuming your text file is formatted corrcetly, eg
    Code:
    &textbox=a long string of text
    then
    code:

    loadVariablesNum("Otterspecs.txt",0);


    should safely load text into a text box with variable name "textbox" in the _root of your movie.

    However, I'd suggest not using loadVariablesNum, instead the loadVars object is much nicer!
    code:

    var ld=new loadVars
    ld.onLoad=function(success){
    if(success) {
    _root.textbox=ld.textbox;
    } else {
    trace("an error occured!")
    }
    }
    ld.load("Otterspecs.txt")


    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

  3. #3
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Ok, I tried both and it still doesn't work.. I am using MX 2004 does that matter???

  4. #4
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    wait 1 minutre, i'll make a .fla for you.
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

  5. #5
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    thanks.. how do I add a scroll bar to it.. I can't get that to work either.. newbie sorry

  6. #6
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    sorry- sloppy code I wrote out the first time!

    attached a working example.
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

  7. #7
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    and this one has a scroll bar attached..
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

  8. #8
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Thanks alot that worked.. the scrollbar didn't though.. my text seems to be spread out thats why i was going to use a scroll bar..

  9. #9
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    The scrollbar should work, as long as the text is long enough.

    anyway, you can add your own easily enough: just create a textBox on the stage. Give it an instance name. Now drag a scrollBar componant from the componants panel onto it.

    Look at the properties panel of the scrollbar- in the parametres, you'll see that the instance that it is targeting is the textbox you've just created.

    Now, feel free to move the scrollbar to whereveer you wish, and to resize it to whatever pleases you.
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

  10. #10
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Thanks for you help.. I must be doing something wrong because it wont work.. anyway, I appreciate all your help..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center