13 Replies Latest reply on Feb 2, 2009 6:47 PM by kglad

    Setting dynamic text not working in AS2

    senortim
      I'm working on a complex file given to me by another designer and I'm having a problem with being able to set dynamic text. Basically, I just want to set the text of a nested instance (e.g., with an instance called foo and a instance inside foo called bar, I'm using foo.bar.text = "test".) This works beautifully and as expected in a test file. But when I move the symbols and code to the other designer's file, nothing happens. I.e., the dynamic text is blank.

      I feel confident that I'm not making any errors (I'm using tested code and symbols!), but I cannot think what else could be causing the error. Mine is the only ActionScript in the entire file.

      Are there bugs with dynamic text? Could this have to do with font substitution? I did change the fonts to Arial and "device fonts" without effect.

      Thanks!
        • 1. Re: Setting dynamic text not working in AS2
          kglad Adobe Community Professional & MVP
          what do you mean by, "when I move the symbols and code to the other designer's file"?

          how did you move it and where did you move it? ie, is foo on the main timeline of the other file? do you need to embed your font?
          • 2. Re: Setting dynamic text not working in AS2
            senortim Level 1
            I'm moving the symbols in the Library panel (choosing the library from my test, and dragging the symbol to the stage in the designer's file). In both cases the instance foo is on the main timeline. In other words, if I could delete all the other layers in the main timeline, the files should be identical except that everything happens in frame 195 of the designer's file. (BTW, deleting all the other layers does not have any affect.) Re embedding, as I said, I'm using the device font.
            • 3. Re: Setting dynamic text not working in AS2
              kglad Adobe Community Professional & MVP
              using a device font is irrelevant to the need to embed your font in flash.

              are you masking, rotating or fading foo or bar?

              where's the code assigning text to foo.bar?
              • 4. Re: Setting dynamic text not working in AS2
                senortim Level 1
                Both dynamic text elements are within the symbol ("foo"). Eventually, foo will have a scale transformation applied to it, but this is not in place yet. The code lives on the main timeline in the frame where my symbol is first used. (Once I get this error figured out, some variables will get set in frame 1, but the "bar" dynamic text assignations will stay where they are.

                With regard to the embedding, where does one embed a font, if not with the object in question? That button is currently disabled in my interface (though I could create another text object off stage and embed it there.)

                Thanks.
                • 5. Re: Setting dynamic text not working in AS2
                  kglad Adobe Community Professional & MVP
                  foo is the library name?

                  and you drag foo to the main timeline of your other fla?

                  and you're giving foo an instance name in the properties panel of your other fla?

                  and you're copying the code from the main timeline of the fla that contains foo in its library to the main timeline of your other fla?
                  • 6. Re: Setting dynamic text not working in AS2
                    senortim Level 1
                    As I said in my original post, the instance of the symbol is named foo. The instance of dynamic text is named bar.

                    In my test file and in the other file, the symbol I'm attempting to manipulate has an instance name of foo. In both cases, the AS is on the main timeline, in the frame where foo is instantiated.

                    So your last line of questions is getting away from the mark.
                    • 7. Re: Setting dynamic text not working in AS2
                      kglad Adobe Community Professional & MVP
                      what questions do you think are not relevant?
                      • 8. Setting dynamic text not working in AS2
                        senortim Level 1
                        Turns out nearly all of them were. :-) I've done a little additional testing and the problem IS NOT with the code or the instances.

                        When I put my additions in the other person's file, everything works great until I rotate or scale the symbol. As soon as I do that, the dynamic text elements are blank.

                        I'm going to try some tests with just these transformations. But in the meantime, any ideas??

                        Thanks,
                        Tim
                        • 9. Re: Setting dynamic text not working in AS2
                          kglad Adobe Community Professional & MVP
                          jeez, i asked if you were masking, rotating or fading foo or bar.

                          you need to embed a font.
                          • 10. Re: Setting dynamic text not working in AS2
                            senortim Level 1
                            OK, that worked. Thanks.

                            Just as a process point, if you'd told me that embedding was necessary for those transformations, I wouldn't have been confused or led you down blind alleys. I did, after all, originally think it was a font problem.

                            • 11. Re: Setting dynamic text not working in AS2
                              kglad Adobe Community Professional & MVP
                              you're welcome.

                              i answer 10 to 20 threads per day. it takes too long to explain why i'm asking every question i'm asking. in addition, you may not have enough knowledge to be able to respond accurately to a question like, "do you need to embed your font?" (which was in my first post).

                              your respond to that question led me to believe that you didn't understand some of the intricacies of flash and font embedding and that's why i asked if you were masking, rotating or fading foo or bar.
                              • 12. Re: Setting dynamic text not working in AS2
                                senortim Level 1
                                I appreciate your taking the time to help me and others on this board. (I actually have another -- probably related question -- that has never been answered, but that one is more confusing because it involved multiple language support and worked *until* I embedded the font.)

                                My understanding of Flash is definitely a mixed bag. I have encountered so many problems (really quirks) with Flash that I kind of start with the assumption that I'm dealing with something quirky.

                                In this case, since I don't know your style, I just couldn't see where you were going with your questions. In any case, thanks. I'm smarter re Flash as a result of your help.

                                • 13. Re: Setting dynamic text not working in AS2
                                  kglad Adobe Community Professional & MVP
                                  you're welcome.

                                  and flash/actionscript 2 is very quirky and has lots of gotcha's.

                                  actionscript 3 is more difficult to learn and use but has less quirks and less inconsistencies.