8 Replies Latest reply on Nov 7, 2007 2:54 PM by jl2000

    Load external htmlText

    jl2000 Level 1
      Hi - I'm using the attached code to: 1.create a textField, 2.fill it with text from an external html file (updatable1.html). All of this is supposed to happen when I rollover the btn "rollover_btn".

      When I test it and rollover the btn, the border for the textField shows up in the correct place but there is no text AND there is no message "Unable to load HTML file".

      Can someone please tell me why this isn't working?

      TIA your help
        • 1. Re: Load external htmlText
          clbeech Level 3
          Hey jl - looks like you need to specify and embed a Font. Might want to use the TextFormat class, and you may need to 'embed' a Font into the Library.
          • 2. Re: Load external htmlText
            jl2000 Level 1
            clbeech - Thanks for the quick reply.
            I didn't think that was needed since the stylesheet specifies "Verdana, Arial"...which are common fonts on my system.
            In the code below I create my_css and, if needed, display the error message in a different text field than the one I'm having trouble with. It works fine that way.

            I'm applying my_css to all the fields in the MC. There are 3 altogether. Only one uses external htmlText.

            I hope this helps.
            • 3. Re: Load external htmlText
              clbeech Level 3
              cool, I think though (at least i don't see it here) that you still may need to assign the stylesheet Object to the fields, ie.

              news_txt.stylesheet = my_css;

              I think :)
              • 4. Load external htmlText
                jl2000 Level 1
                got that already in my first post...
                news_txt.styleSheet = my_css;

                But a missing stylesheet wouldn't stop text from being loaded, right? The htmlText would load but not be styled...default font and all that. Besides - where's the message taht says - can't find text (whatever) from the if/else thingy?
                • 5. Load external htmlText
                  Have you parsed the StyleSheet?
                  • 6. Re: Load external htmlText
                    clbeech Level 3
                    LOL!!! ha missed that!

                    yeah you wouldn't think it would stop the text from loading, although I think if there no embedded font when constructing a TextField, it might act like that 'cuz' no font is getting applied. I'm thinking you might still be getting the the css, when are you loading it up? And have you tried a trace in the success condition to see if it's getting through?
                    • 7. Re: Load external htmlText
                      clbeech Level 3
                      say, in the docs, where the example is very close to this ;) they are assigning the styleSheet to the field in the css.onLoad handler, maybe you should try it there, instead of styling it in the onRollOver handler.

                      actually I'd think about moving all of that into the background and put it in an MC or something, and then just toggle it visible with your btn handlers.
                      • 8. Re: Load external htmlText
                        jl2000 Level 1
                        clb -
                        no doubt - I go right for the Help docs. There's no other way for me...this AS is not sinking in. Especially loadVars! It's just not "conversational" enough.

                        I was in the process of moving it all into an MC as you suggested and decided to just start from scratch.
                        It's working now and I don't really know what I did differently.

                        Thanks for hanging in there with me...