A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: WHAT DID I DO WRONG? I'm sure its an ez answer

  1. #1
    Member
    Join Date
    Aug 2001
    Posts
    58

    WHAT DID I DO WRONG? I'm sure its an ez answer

    Here is the problem I'm tiring to change the Var: name in this code below to "text123"

    ----------------------
    Original
    ----------------------

    loadVarsText = new loadVars();
    loadVarsText.load("../../text/sd_text2.txt");
    //assign a function which fires when the data is loaded:
    loadVarsText..onLoad = function(success) {
    if (success) {
    trace("done loading");
    //Now that we know the data is loaded,
    //set the text content of the Text Field
    //with the instance name "scroller" equal to the
    //contents of the variable
    _root.bad.text = this.Text;
    } else {
    trace("not loaded");
    }
    };

    ----------------------
    New
    ----------------------

    loadVarstext123 = new loadVars();
    loadVarstext123.load("../../text/sd_text2.txt");
    //assign a function which fires when the data is loaded:
    loadVarstext123..onLoad = function(success) {
    if (success) {
    trace("done loading");
    //Now that we know the data is loaded,
    //set the text content of the Text Field
    //with the instance name "scroller" equal to the
    //contents of the variable
    _root.bad.text = this.text123;
    } else {
    trace("not loaded");
    }
    };

    ----------------------

    Any Idea why this isn't working?

    -Cheers

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    For one thing you have a few extra dots in there:

    loadVarsText..onLoad = function(success) {

    And what's not working?

    Does the variable in the text file start off with "text123=..."?

  3. #3
    Member
    Join Date
    Aug 2001
    Posts
    58
    The code was from

    http://www.macromedia.com/support/fl...t_scrollmx.htm

    all I want to do is change the Var: names but it doesn't seem to work

  4. #4
    Member
    Join Date
    Aug 2001
    Posts
    58

    DUH!

    ok I understand now. The Var: is calling the Var name inside the .txt file. Sorry about that OldNewBie. I was looking in the wrong place for too long. Thanks anyways for the 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