11 Replies Latest reply on Jul 15, 2006 1:39 PM by Need_Sleep

    Dynamic Sprite


      is it possble to create a sprite on stage with out dragging it on the stage but get it from the cast
      if any 1 got a tut online would be well helpfull
      need to destroy them after i used them to
        • 1. Re: Dynamic Sprite
          Level 7
          > is it possble to create a sprite on stage with out dragging it on the
          > stage


          MX 2004, makeScriptedSprite(), like this:
          channel(x).makeScriptedSprite(member("yourcastmember"), point(x, y))

          Earlier versions of Director:
          Search in google-groups for puppetSprite - there are many posts about the

          • 2. Re: Dynamic Sprite
            Need_Sleep Level 1
            Thank you but another question i got a textArea to go onto stage now i want to put text in to it tryed

            sprite(5).text = "hello"

            dont work and also

            channel(5).sprite.text = "hello"

            that dont work either ho how do u control the new sprite
            • 3. Re: Dynamic Sprite
              Level 7
              Real close! Try

              • 4. Re: Dynamic Sprite
                Need_Sleep Level 1

                RAAAAA its not working this is my code:

                its a imput box im trying to do it with a flash one

                • 5. Re: Dynamic Sprite
                  Level 7
                  You need to save a reference to the scripted sprite so you can make
                  changes to it. I recommend using a global variable to do that, though
                  depending on your needs that may not be necessary. Under the assumption
                  that you have a text member named "TextInput", this will work (watch for
                  line wraps... (there should be 2 lines of code between the on exitFrame
                  and end):

                  global gTextSprite
                  on exitFrame me
                  point(200, 200))

                  This way, you can do whatever you want to the sprite by using the
                  gTextSprite reference. You can change the text (like in the example
                  above), or the font


                  You can adjust the location

                  gTextSprite.loc=point (100,100)

                  • 6. Re: Dynamic Sprite
                    Need_Sleep Level 1
                    Thank you Loads that works if u ever in wales ill buy u a pint

                    still not doing what i want it to do the script works the thing is i want alot of text boxes each 1 having diffrent text this methord they all have the same text as im changing the member
                    there must be a way with out me having to place the text boxes on the stage
                    what i need to do is create the sprite on the stage then name the sprite and edit it

                    oh well who needs sleep
                    • 7. Re: Dynamic Sprite
                      Level 7
                      If you want lots of different pieces of text around the screen, you need
                      to use multiple members, since, as you've seen, changing the text of the
                      member changes the text of all the sprites that use that member.

                      You can create a new member on the fly. That way you don't need to make
                      them all 1st. Just make sure that you delete them when you are done
                      with the member(membername).erase() function or you'll have lots of
                      extraneous members laying around....

                      global gTextSprite1, gTextSprite2
                      on exitFrame me

                      point(100, 100))
                      gTextSprite1.member.text="this is some text"


                      point(200, 200))
                      gTextSprite2.member.text="this is some other text"
                      • 8. Re: Dynamic Sprite
                        Need_Sleep Level 1
                        Thank you Loads you are litterlay saving me
                        the last question can i use the flash label of the flash textarea
                        • 9. Re: Dynamic Sprite
                          Level 7
                          What do you mean? How do you want to use it?
                          • 10. Re: Dynamic Sprite
                            Need_Sleep Level 1
                            well i wana use html in the text box u see in the flash components you can in this one i cant
                            • 11. Re: Dynamic Sprite
                              Need_Sleep Level 1

                              ok this is what i got so far

                              gFlashSprite = new(#flash)
                              gFlashSprite.name = "flasher"
                              gFlashSprite=channel(7).makeScriptedSprite(member("flasher"),point(150, 150))

                              but i need to get the flash textarea component
                              so i can use html