dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: html text works but not when swf is loaded into main movie

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    133

    html text works but not when swf is loaded into main movie

    hi

    i have the following code to load some text as html:

    var my_lv = new LoadVars();
    my_lv.onLoad = function() {
    scrollWindow.html = true;
    scrollWindow.htmlText = this.profile;

    //where profile is the txt document variable name: &profile=blah,blah,blah...&

    };
    my_lv.load("profile.txt");

    it works fine except when loaded into the main movie.

    any ideas why this isn't working are gratefully received, thanks...

  2. #2
    Member
    Join Date
    Nov 2005
    Location
    near my PC
    Posts
    46
    PHP Code:
    var my_lv = new LoadVars();
    my_lv.onLoad = function() {
        
    scrollWindow.html true;
        
    scrollWindow.htmlText this.profile;
    };
    my_lv.load("profile.txt"); 
    You have wrong path... becouse you are loading variables from loaded movie, no from main movie. So you must change your path. (_level1....)

  3. #3
    Senior Member
    Join Date
    Sep 2000
    Posts
    133
    the movie is loaded into a clip that resides on _level0 in the main movie.

  4. #4
    Member
    Join Date
    Nov 2005
    Location
    near my PC
    Posts
    46
    THis is sample. It works... Try it.
    Attached Files Attached Files

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Posts
    133
    it works when viewed in the browser but i can't open the fla files, they keep crashing my copy of flash (mx)!

  6. #6
    Member
    Join Date
    Nov 2005
    Location
    near my PC
    Posts
    46
    Becouse, it was in Flash 8 format. This is that sample in 2004MX format...
    Attached Files Attached Files

  7. #7
    Senior Member
    Join Date
    Sep 2000
    Posts
    133
    thanks, but i'm using flash mx not the 2004 version, so i still can't open the files!

  8. #8
    Member
    Join Date
    Nov 2005
    Location
    near my PC
    Posts
    46
    I hope, that this is format for you. Flash MX...
    Attached Files Attached Files

  9. #9
    Senior Member
    Join Date
    Sep 2000
    Posts
    133
    thanks for your time with this. your code was not different to mine except that you used loadMovieNum (ie, target: level) rather than loadMovie (target: clip), which is what my current code does.

    so i changed your code to loadMovie to see if it would still work and it does. This means that i now have your files with identical code to mine: but whilst the text as html works when using your files, it doesn't with mine (when loaded into the main movie)!

    very confusing! as i say, everything is set up the same: loadMovie code, the new LoadVars() code, the txt file, etc, etc...

    any ideas??? could i be overlooking something?

  10. #10
    Senior Member
    Join Date
    Sep 2000
    Posts
    133

    Resolved

    yes, i was overlooking something!

    the call to load the text was misaddressed: instead of "profile.txt" it should have been "subfolder/profile.txt" because the files were in different folders!

    sometimes we can look too closely and miss the bigger picture...

    the positive outcome is that p3k's code is working. thanks!

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