10 Replies Latest reply: May 14, 2010 9:19 AM by d0brin RSS

    Little AS system help

    d0brin Community Member

      Okey i will try to explain it the best i can so you can understand me .

      • On the MAIN STAGE I have 1 button called c1.
      • In it i have a Dynamic Text field with Instance Name: symbolTF

       

      Now what i need is:

      • On press of the button c1, the text stored in symbolTF to be taken and loaded in: chevron1_glyph.glyph (this MC set is on the main stage not in the button) where i have a textfield named: glyphTF
      • And the code to be placed on a frame on the MAIN STAGE

       

      I think i explained it as good as i can.. can you help me? I really need such think. Thanks

        • 1. Re: Little AS system help
          d0brin Community Member

          ah.. forgot to mention that symbolTF is in the button. Hope that is not a problem :S

          • 2. Re: Little AS system help
            Ned Murphy CommunityMVP

            You will need to make your button a movieclip if you want to be able to access the textfield within it.  Button symbols have very limited properties, so you cannot add movieclips or textfields inside of them and  target them with code.  You need to create your button as a movieclip, which is a dynamic object that can have things added inside it and targeted.

            • 3. Re: Little AS system help
              d0brin Community Member

              okey if so... and my MC is c1 how exactly to do what i want... in theory i know that i have to take the text field content, store it and than load it into the desired location... but how exactly it goes with AS can you help me?

              • 4. Re: Little AS system help
                Ned Murphy CommunityMVP

                If your button_mc's instance name is "c1", then the code in the timeline that holds that button_mc would be...

                 

                c1.onPress = function(){  // could use onRelease instead

                     chevron1_glyph.glyph.glyphTF.text = c1.symbolTF.text;

                }

                • 5. Re: Little AS system help
                  d0brin Community Member

                  yeah thanks it kind of works... you seee i have 36 on the main stage of this c1 buttons... and i want the code to be applied for all.. they are all with diff instance names, even i changed the text instance name on the inside but the code works only for the first one... and for the second one doesnt want to work even that i have placed it twice with the changes in the instnace names... The point of what i want is actually this text that is loaded from the diff buttons to have one animation. I have animated the "glyph" MC and i want on the dif clicks the content of the text to be different but the animation the same. And for not making animation for every glyph i decided to make this system but apparently it kind of doesnt work :S

                  • 6. Re: Little AS system help
                    d0brin Community Member

                    actually made it work i have forgotten one code to add ... but one small problem appeared.. it doesnt load the content of my symbolTF it loads some strange content... and its always the same... if i press c1 or c2 even the texts inside are different it loads the same thing any ideas?

                    • 7. Re: Little AS system help
                      Ned Murphy CommunityMVP

                      You haven't explained anything as far as how the text gets assigned to the buttons, so I can't offer anything.

                      • 8. Re: Little AS system help
                        d0brin Community Member

                        i think i have found the problem.. it seams that the loading into the glyph mc in the text field work but it kind of always loads the word "Undefined" no matter of the code on the side after = ... any ideas? It seems that flash cant identify the text field possibly cuz its in a button?

                        i tried with MC and even than loads "Undefined"?

                        • 9. Re: Little AS system help
                          d0brin Community Member

                          the text is simply written into Dynamic Text Field into the button it self.

                          • 10. Re: Little AS system help
                            d0brin Community Member

                            Okey thanks a lot for yoru help . I made it work with Movie Clip. Thanks