dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Scrollbar works with LoadVar with on level0, not higher.

  1. #1
    Member
    Join Date
    Apr 2002
    Location
    Whidbey Island WA
    Posts
    40

    Scrollbar works with LoadVar with on level0, not higher.

    Well, that is part of the problem, but not all of it. I read the macromedia tech note (attached for those who are interested) about scrollbars and loading with LoadVar. I followed their directions and it works great when I test the file. Of course that is only on level0. The text loads fine when the file is launched from level0 and played on level three, but the scroll bar does not.

    I wondered if part of the problem was that I used two Loadvars objects. The first LoadVars object loads text into the dynamic textbox a very small file). When the second LoadVar is loaded, the movie moves to a frame with buttons for different txt variables. I tested the hypothesis that the second LoadVars was affecting thigs by removing the second loadVar object. That changed things slightly. The up/down arrows on the scrollbar work, but the bar does not (i.e., can't drag to scroll).

    Since it works fine on level0 but not on level3, it would seem to be a path issue. Where would I specify the path, do you think?

    Here is the code I am using:
    Frame one
    stop();
    fstLoadVars = new LoadVars();
    fstLoadVars.load("Open.txt");

    // loadMovieNum("AppWait.swf",4);
    //assign a function which fires when the data is loaded:
    fstLoadVars.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 "Heavybox" equal to the
    //contents of the variable
    Heavybox.text = this.Greeting;
    gotoAndPlay("SecondLoad")
    } else {
    trace("not loaded");
    play();
    }
    };
    Frame two-
    prevFrame();
    Frame three-
    stop();
    scndLoadVars = new LoadVars();
    scndLoadVars.load("units.txt");
    // loadMovieNum("AppWait.swf",4);
    //assign a function which fires when the data is loaded:
    scndLoadVars.onLoad = function(moresuccess) {
    if (moresuccess) {
    trace("done loading");
    //Now that we know the Units data is loaded,
    //stop preloader and show buttons (ButtonsHere)
    //The dynamic test stays unchanged until buttons
    //are clicked.
    unloadMovieNum(4);
    gotoAndPlay("ButtonsHere");
    } else {
    trace("not loaded");
    play();
    }
    };
    Frame four-
    prevFrame();
    Fame five (ButtonsHere)-
    stop();


    Anybody have an idea?
    Attached Files Attached Files
    Tommy, the third orienteer

  2. #2
    Member
    Join Date
    Apr 2002
    Location
    Whidbey Island WA
    Posts
    40

    Multiple LoadVars = scrollbar trouble

    Actually, this is not true if you code right. I was using myLoadVars.text=this.myvariable I was thinking this refered to level.

    Actially it refers to the LoadVar object. When you have two loadVar objects you have to specify which one when you assign text. Then the scrollbar behaves. I used two LoadVar objects because I wanted to have two files to draw from. The LoadVar only holds one set of variables at a time (as I understand it).

    Ok, I don need youse guys any more. (smilie here, bring on the smilie face.)
    Tommy, the third orienteer

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