A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: LoadVars() problem

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    202

    LoadVars() problem

    This is my scenario:-

    I have the main page, ie main.html which has a main menu embedded in it, and in the main menu, I have a button called News from which I load an asp page, news.asp, and populate some text fields which I have on the news.swf. However, these fields are not showing up. I have done some testing to check wether the asp is loading, and I am sure it is since it is going to the appropriate frame, so the problem must be either with the asp or else with the variables. Here is the code I have in the first frame of the news.fla file:-

    stop();
    myVars = new LoadVars();
    myVars.load("data/news.asp?cachebuster="+getTimer());
    myVars.onLoad = function(success) {
    if (success) {
    _root.NewsTit1.variable = "_root.myVars.news1";
    _root.NewsTit2.variable = "_root.myVars.news2";
    gotoAndPlay(5);
    } else {
    trace("not loaded");
    }
    };

    and here is the contents of the asp file, which is like a text file with an asp extension:-

    news1=This is the first news article, it has plenty of text. It relates to the setting up of voices, advertising and PR. Lots of text to go hear.. We need enough for the scroll bar.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ulliam corper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem veleum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel willum lunombro dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

    &news2=This is the second articleIt has planty of text which you can add to!!!Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ulliam corper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem veleum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel willum lunombro dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

    Can you tell me what am I doing wrong please?

    Thanks for your help and time.

    Johann
    http://www.johannmontfort.com

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Location
    Jerusalem, Isreal
    Posts
    254

    have you tries it before?

    i mean, for all i know, ASP pages are not like text files, and when i wanted to transfer data from it to flash i needed to use Response.Write "" of VBScript.
    so, have it worked for you before in that way you are discribing, cause if not, that may be your answer.
    bye
    Matti Bar-Zeev,
    scriptaholic.

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    202
    Hi Mattman,

    it can be done cause I already did it but by using loadVarsNum

    loadVariablesNum("data/about_us.asp?cachebuster="+getTimer(), 1);


    Now I wanted to do it with LoadVars()

    Thanks
    http://www.johannmontfort.com

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