Page 3 of 3 First 123
  • Jump to page:
    #31
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    ok. i like the sound of the loadvars - reminds me of a recordset

    i have this in frame1:

    MyData = new LoadVars();
    MyData.Load("viewleadf.txt");
    curagt = MyData.CurrentAgentNumber;
    trace(MyData.CurrentAgentNumber);
    trace(curagt)

    Both traces come out undefined. Also, now that im using loadvars, my variable isnt showing up in my textbox.

    I know that once i sort this out and get it working, i'm probably going to laugh at my current stupidity, but right now...

    I just bought the book you were talking about. Seems heavily geared towards PHP and MySQL., but should still be usefull.
  2. #32
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    oops - missed the on load bit
  4. #33
  5. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    you're forgetting to put the onLoad event handler, which is the "listener" that will wait until the data is loaded and then execute a function.

    Code:
    MyData = new LoadVars();
    MyData.onLoad = function(){
         curagt = MyData.CurrentAgentNumber;
         trace(this.CurrentAgentNumber);
         trace(curagt)
    }
    MyData.Load("viewleadf.txt");
    also notice i put a "this" in the trace because "this" will refer to the MyData object inside that function...
  6. #34
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0

    Sucess!!!!!! kind of


    Ok! I got the pulldown working.

    Thankyou Thankyou Thankyou!!!!

    Now that i'm using the LoadVars(), how do i fill the variable field in my text box. I used to just use the name of the variable in my record source, but that doesnt work any more. I tried entering _level0.CurrentAgentNumber and also MyData.CurrentAgentNumber. All to no sucess.

    Do i now have to populate my text boxes with code?
  8. #35
  9. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    without knowing the paths and everyhing, it would probably be easist to set the text of those text boxes in your onLoad function.

    you can either set the variable or the .text value of your text field, depending on whether or not you gave it an instance name or just a variable name. As long as your get yoru path right it should work.

    cheers,

    bret
  10. #36
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    k.. on my load (frame 1) i now have this:

    MyData = new LoadVars();
    MyData.Load("viewleadf.asp");
    MyData.onload = function() {
    // Populate Variable for Pulldown boxes
    curagt = MyData.CurrentAgentNumber;
    // Populate text fields
    strTEXTBOX.text=MyData.CurrentAgentNumber;
    };


    This populates the text box on the screen. On my post button i have this:

    on (release, keyPress "<Enter>") {
    agentnumPD = _root.cbox1.getvalue();
    txtmsgmelon = strTEXTBOX.valueOf();
    getURL("flashagenttest.asp", "", "GET");
    }

    Before i started using the loadvar() I defined the value of the text box by simply entering the variable into the text box parameter 'variable' Now that im setting the value for this in load, its populatng the box, but not sending the value...

    Can i do loadvars and the old method at the same time? will that mess it up?
  12. #37
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    after i thought about it, i decided that using two methods at the same time was daft.

    i messed with it and now i can put the variable in the text box as i did before, but i am still having trouble picking it up using the valueof setting. its actually giving the the name of the control in place of the value.

    Any ideas?
  14. #38
  15. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    when you are retrieving the value of a text box, you don't need valuof, that's just a retriever for boolean values. Just use the instance name.text and it will return the textual value of that text box.

    cheers,

    bret
  16. #39
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    Doh! Yup. I think that macromedia have made this language especially to confuse VB users!!!

    Ok. My test form is complete. One last question, then i'll stop bothering you :-^

    Whats the best (easiest) way to put a "loading data - please wait" animation on there to give the users something to look at while the data is loading?!
  18. #40
  19. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    the simplest way to do it is to just have your results display a "loading..." in the text box... but this only works if you are loading text into a text box In your LoadVars function, you can set the callback to go to the screen that has your display info, and display a "loading" frame when they view the page or try to refresh the info. Does that make sense?

    have your first frame of your movie "Loading". in the onLoad even handler function, tell the movie to gotoAndStop your content display page.

    in your getURL function, there's no way, since you only get the URL and aren't returning the data back into flash.

    make sense?

    bret
  20. #41
  21. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    Can i use action script to hide a layer? I was maybe thinking of having a layer with the please wait message on it and then once the data is loaded, hide it
  22. #42
  23. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    well not a layer, but you can put your loading thing in a movieclip, and use actionscript to hide that movieclip. (placing it on the top most layer).

    instancename._visible = false; //0 or 1, false or true
  24. #43
  25. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    ok. I made a cute little please wait box, with a spinning circle and the words 'please wait'. I saved it as a SWF - I want to be able to reuse it. When i import it into my movie, the text doesnt show up. Any ideas what i did wrong?
  26. #44
  27. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    here's a sample of my code:
    MyData = new LoadVars();
    MyData.Load("viewleadf.asp");
    MyData.onload = function() {
    // Populate Variable for Pulldown boxes
    curagt = MyData.CurrentAgentNumber;
    // Populate text fields
    newagtnumber = MyData.CurrentAgentNumber;
    setProperty(pleasewait1, _visible, false);
    };

    When i run this, everything becomes invisible, form and all!!!

    i tried not using the setproperty function like in your example, but nothing happened.
  28. #45
  29. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    25
    Rep Power
    0
    I decided to use a progressbar for my loader. It works great on my local test machine (running Microsoft Personal Web Server), and it works on our website, until you hit refresh - then it doesnt repopulate.

    Is there some special code i have to add to my movie to refresh the data when it closed and reopens?
Page 3 of 3 First 123
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo