A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: textfield loads locally but not online?

  1. #1
    Senior Member
    Join Date
    Nov 2003
    Location
    Bournemouth, UK
    Posts
    144

    textfield loads into .swf but not when loaded into main movie?

    I'm loading a textfile into a textfield, this works fine locally but when I upload to the site the textfield remains empty? Heres my code: -

    code:

    loadVarsText = new loadVars();
    loadVarsText.load("mytextfile.txt");
    loadVarsText.onLoad = function (success){
    if (success){
    textfield.text = this.mytext;
    }else{
    textfield.text = "not loaded";
    }
    }


    it doesn't even display the text "not loaded".
    Any help appreciated, cheers
    Last edited by danthomas; 03-16-2004 at 01:12 PM.

  2. #2
    Senior Member
    Join Date
    Feb 2003
    Posts
    825
    check the path of "mytextfile.txt"

    also, did you upload "mytextfile.txt" to your server?

  3. #3
    Senior Member
    Join Date
    Nov 2003
    Location
    Bournemouth, UK
    Posts
    144
    Thanks but I think I'm just about getting to the root of the problem. Everything was fine(ish) apart from trying to load dynamic text into a loaded swf whereby the main movie uses a mask!!???!!!?!??!

    Aparently this can't be done unless using pixelfonts or loading the swf above the mask layer on the main movie.

    Anyone else come across this? Weird or what, I do love spending hours finding out the most random errors!

    Dan

  4. #4
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    Code:
    textfield.embedFonts=true;
    if its masked ,embed it ..then NP
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  5. #5
    Senior Member
    Join Date
    Nov 2003
    Location
    Bournemouth, UK
    Posts
    144
    Didn't work and I have found out its nothing to do with the mask, completely deleted the mask from main movie and still same prob, have tried embedding font (thru code and at design time) to no avail either.

    heres loaded swf

    which works fine (loads the text into textbox at top right)

    and heres the main movie

    click on Joe Writes, which loads the swf into level 2 and doesn't work at all. All the files are in the same directory and definately there, same happens locally and remotely.

    here is the exact code if anyone can see what is wrong u go straight to the top of my xmas card list: -

    code:

    // on 'joe writes' button in main movie
    on (release) {
    unloadMovieNum(2);
    loadMovieNum("joewords.swf", 2);
    }

    // on first frame of loaded swf
    loadVarsText = new LoadVars();
    loadVarsText.load("book_ttv.txt");
    loadVarsText.onLoad = function(success) {
    if (success) {
    scroller.text = this.mytext;
    // just some extra traces; delete afterwards
    trace("this.mytext = " + this.mytext)
    trace("scroller = " + scroller)
    trace("scroller.text = " + scroller.text)
    // scroller = instancename of textfield on the same timeline as this LoadVars object
    } else {
    trace("not loaded");
    }
    };


    Resetscroll()
    function ResetScroll(){ //Reset ScrollBar
    bookscroll.setScrollTarget(scroller);
    bookscroll.setScrollPosition(0);
    }
    stop();


  6. #6
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    Code:
    if (success) {
                    scroller.text = this.book_ttv;
    try that ..let me know
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  7. #7
    Senior Member
    Join Date
    Nov 2003
    Location
    Bournemouth, UK
    Posts
    144
    no joy i'm afraid

  8. #8
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    is this a different dynamic txtifeld form your other 1 .. make sure its html rendered..
    in the properties inspeector ..
    also post the fla ..please
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    What's this bit for?

    Resetscroll()
    function ResetScroll(){ //Reset ScrollBar
    bookscroll.setScrollTarget(scroller);
    bookscroll.setScrollPosition(0);
    }
    stop();

    It works for me loading it in another movie...

    http://blake.prohosting.com/~tektips/joemain.swf

    on (release) {
    loadMovieNum("joewords.swf", 2);
    }

  10. #10
    Senior Member
    Join Date
    Nov 2003
    Location
    Bournemouth, UK
    Posts
    144
    What's this bit for?
    That resets the scrollbar to the top and to the right size when different textfiles are loaded (for the other books - buttons down the middle) which again all load fine when directly looking at the swf but not when loaded in my main movie.

    Its a site i've inherited so will have a good look through the main movie to see if there's anything there that could be affecting this.

    But what could possibly cause it to not work? I've tried loading the textfiles into simple movies (the same as oldnewbie) and it works fine (so textfile should be ok), renaming the variables (so no conflicts), setting the variables to the _root (so no pathing probs), removing all masks (so no masky bugs), embedding fonts... etc etc!

    Fortunately i've only resulted to chewing through the desk a couple of times so patience is bearing up well! I'll have another look tonight and if I can't solve it i'll post the fla.

    Really appreciate the help guys,
    Dan

  11. #11
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    good luck .. post it !!!
    cheers
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  12. #12
    Senior Member
    Join Date
    Nov 2003
    Location
    Bournemouth, UK
    Posts
    144
    AAAAARrrrrrrrrrrrrrgggggggggghhhhhhhhhh!!!!!!!!!


    Time of first post = 12:03pm (and that was after an hour of searching)
    Time now = 6:53pm

    What the fool did wrong (long version) = several hours ago (pre-problem) I changed the publish settings of the loaded swf to flash 6 instead of 5 (to accomodate the newly added scroll bar - thats all I was trying to do!) This allowed me to use a scrollbar but I needed to change from old 'loadVariables' method to 'loadVars' in order to reset the scrollbar for different textfiles, which all worked fine on the loaded swf. Its just taken me best part of a day to realise I should have changed the publish settings of the main movie to flash 6 as well in order for it all to work in the main movie... Doh!

    What the fool did wrong (short version) = got up this morning.

    Thanks again guys, I'm off to sit in the corner and hang my head in shame!

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