12 Replies Latest reply on Apr 24, 2006 2:13 PM by Peter Lorent

    LoadVars() w/ Dynamic Text

    beevyarr
      OK. My text file is: Who_txt=<HTML><BODY> yadda yadda </HTML></BODY>
      First frame code:
      ---
      var txtWho_lv = new LoadVars();

      txtWho_lv.onLoad = function() {
      who_txt.htmlText = Who_txt;
      }

      txtWho_lv.load("../folder/folder/Who.txt");
      ---
      When tested, I am only getting the following message in my textbox:

      level0.whotxt
        • 1. Re: LoadVars() w/ Dynamic Text
          Peter Lorent Level 2
          >>who_txt.htmlText = Who_txt;
          Should be:
          who_txt.htmlText = this.Who_txt; // this points to the LoadVars object

          <HTML><BODY> are not supported so you will get that as a string in your text box. Refer to the doc's for supported tags.

          >>level0.whotxt
          Odd, you should get 'undefined' with your code.
          • 2. Re: LoadVars() w/ Dynamic Text
            beevyarr Level 1
            actually, <HTML><BODY> work fine. All the tags that I had prior weren't supported.

            And adding "this." prevents anything from being loaded into the textField. I haven't really instantiated anything as "this." --- so...to make things even more difficult, once I get the text to load properly, I will be placing the movie within another movieClip, and will have to retarged where the LoadVars() will load.

            ps. Also having trouble getting my text to present as Full Justified. I have it an Input TextField, Font embedded, and it appears Full Justified when in author mode, but onced published returns to Left Justified. If I adjust to Right or Center, they will publish, but Full Justified text still won't.

            • 3. Re: LoadVars() w/ Dynamic Text
              Level 7
              I suggest you do not temp the Flash HTML parser with tags it does not
              understand. <html> and <body> are not understood and may be the reason you
              are seeing nothing as what happens in a web browser when you feed it tags it
              does not understand.

              See: http://livedocs.macromedia.com/flash/8/main/00001459.html for supported
              tags. You can go beyond that list with styles and CSS or TextFormat.

              Add a trace before the assignment to see what is in the value
              From LuigiL's correct notation:

              who_txt.htmlText = this.Who_txt; // this points to the LoadVars object
              trace (this);
              trace ("this.Who_txt = ["+ this.Who_txt +"]");


              The this inside of txtWho_lv.onLoad refers to txtWho_lv

              --
              Lon Hosford
              www.lonhosford.com
              May many happy bits flow your way!
              "beevyarr" <webforumsuser@macromedia.com> wrote in message
              news:e2j0tr$ao$1@forums.macromedia.com...
              actually, <HTML><BODY> work fine. All the tags that I had prior weren't
              supported.

              And adding "this." prevents anything from being loaded into the textField.
              I
              haven't really instantiated anything as "this." --- so...to make things even
              more difficult, once I get the text to load properly, I will be placing the
              movie within another movieClip, and will have to retarged where the
              LoadVars()
              will load.

              ps. Also having trouble getting my text to present as Full Justified. I
              have
              it an Input TextField, Font embedded, and it appears Full Justified when in
              author mode, but onced published returns to Left Justified. If I adjust to
              Right or Center, they will publish, but Full Justified text still won't.


              • 4. Re: LoadVars() w/ Dynamic Text
                Peter Lorent Level 2
                >>ps. Also having trouble getting my text to present as Full Justified
                Makes perfect sense because you can't justify the text in a dynamic text field.
                • 5. Re: LoadVars() w/ Dynamic Text
                  beevyarr Level 1
                  >>Makes perfect sense because you can't justify the text in a dynamic text field.

                  ain't that a bummer.

                  But again, to be honest, I've been playing with these text files for days now, and I swear to you <HTML<>BODY> tags are working perfect. The only problem I'm having with my tags are that some <a href="yadda"> tags will allow hyperlinks while others seem to break Flash's html-readability and won't load.
                  • 6. Re: LoadVars() w/ Dynamic Text
                    beevyarr Level 1
                    btw,

                    I'm loading my text files through loadVariables();

                    and calling w/ buttons >>> txtField_txt.htmlText = name;
                    • 7. Re: LoadVars() w/ Dynamic Text
                      Peter Lorent Level 2
                      >> <HTML<>BODY> tags are working perfect.
                      I believe you, but probably in Flash Player 8.5?
                      • 8. Re: LoadVars() w/ Dynamic Text
                        beevyarr Level 1
                        I don't discount your skepticism, but this is one of those days when nothing that was supposed to work did, so I'm not looking this gift horse in the mouth.

                        Besides, I've pretty sure that my computer is high.
                        • 9. Re: LoadVars() w/ Dynamic Text
                          beevyarr Level 1
                          oh yeah >>> Flash Player 6.0 baby!
                          • 10. Re: LoadVars() w/ Dynamic Text
                            beevyarr Level 1
                            of course, I'm only running locally.

                            When I post to a server, you may get your last laugh.
                            • 11. Re: LoadVars() w/ Dynamic Text
                              Level 7
                              1. How do you know the HTML and BODY tag work? Is it because you do not see
                              errors? You are reporting you see somthing other than expected!!!!

                              2. You cannot use what you see (your eyeballs) in a TextField to validate
                              what data it has. As I mentioned you can use a trace statement to see what
                              you are putting into the TextField. As well if you Control->Test Movie, you
                              can use Debug List Variables or List Objects and look for the TextField
                              instance name to see what Flash decided to do with the HTML you fed it.
                              Still the trace statement is the more definitive.

                              --
                              Lon Hosford
                              www.lonhosford.com
                              May many happy bits flow your way!
                              "beevyarr" <webforumsuser@macromedia.com> wrote in message
                              news:e2jc0e$ea7$1@forums.macromedia.com...
                              >>Makes perfect sense because you can't justify the text in a dynamic text
                              field.

                              ain't that a bummer.

                              But again, to be honest, I've been playing with these text files for days
                              now,
                              and I swear to you <HTML<>BODY> tags are working perfect. The only problem
                              I'm
                              having with my tags are that some <a href="yadda"> tags will allow
                              hyperlinks
                              while others seem to break Flash's html-readability and won't load.


                              • 12. Re: LoadVars() w/ Dynamic Text
                                Peter Lorent Level 2
                                Checked for version 8.5, but the tags are just not supported. Well, I don't get it so it's time to say goodnight...