A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Strange LoadVars Problem

  1. #1

    Strange LoadVars Problem

    This may be something stupid that I'm looking over, but I can't find it... I'm trying to load some variables on the main timeline. I can trace(); the variables as they load in the function but trying to recall them later comes back undefined, please check out the code below, I'm so frustrated.

    code:

    // first the LoadVars
    var myLVMusic = new LoadVars();
    function loadMP() {
    myLVMusic.load("/musicPlayer.asp");
    myLVMusic.onLoad = function(success) {
    if (success) {

    _root.TotalRecordsMP = this.TotalRecordsMP;

    for(i=0; i<_root.TotalRecordsMP; i++){
    _root["strSongMP"+i]=this["strSongMP"+i];
    _root["idMP"+i]=this["idMP"+i];
    }

    }
    };
    }

    loadMP();

    // Then I try and trace the Total Records to make sure and it comes back undefined
    trace(_root.TotalRecordsMP);



    These variables are loading on Scene 2, would that make a difference?

    Thanks everyone, any thoughts would be awesome.
    Last edited by sjcallan; 12-05-2005 at 11:40 PM.

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