8 Replies Latest reply on Aug 3, 2007 12:52 AM by Beatie3

    Clearing dynamically generated mc

    Beatie3
      I'm still working on getting what I had working in AS2 working in AS3 - hehe looks like "***" doesn't it? I'm playing with the drawing api sample provided by Adobe to try and work it all out. My particular problems are based on getting things to work with a MouseMove event. I'd be very grateful for any help you could offer. Here's the code:

        • 1. Clearing dynamically generated mc
          Marghoob Suleman Level 1
          for clearing your dynamic mc you can use... your_mc = null;

          Set movieclip to null to make the movieclip eligible for garbage collection.

          • 2. Clearing dynamically generated mc
            Beatie3 Level 1
            Thank you for that, but I've tried that and I'm still getting "1120: Access of undefined property <clip name>."
            The problem remains of the text field I need to show how many pixels have been drawn pixel by pixel. In AS 2.0 this worked perfectly:



            What am I missing?
            • 3. Re: Clearing dynamically generated mc
              Beatie3 Level 1
              Knock knock
              • 4. Re: Clearing dynamically generated mc
                Beatie3 Level 1
                Getting very frustrated here. I thought maybe it would work if I used the Sprite stuff and spent ages working on a class that was all about the draggy thing that would display as the mouse was dragged, then set the sprites to null and draw the final line. Not working. Could someone please help?
                • 5. Re: Clearing dynamically generated mc
                  Marghoob Suleman Level 1
                  see this... could help you...

                  • 6. Re: Clearing dynamically generated mc
                    Beatie3 Level 1
                    Yes, thank you, I understand that code very well. What I don't understand is why my code, which is trying to do something different, doesn't work. It's all fine and dandy to have the bits and pieces all created at runtime and sitting there waiting to be dragged and double clicked to make them disappear, but it's quite a different matter to nest the creation of those bits and pieces inside an event and try to do something with them in a different event.

                    And still no one has told me why my code that should update a dynamic text field with the number of pixels being drawn won't work at all in the mouseMoveEvent.

                    But thank you for trying.
                    • 7. Re: Clearing dynamically generated mc
                      Marghoob Suleman Level 1
                      i dont know what you are trying to do...
                      but see this...


                      • 8. Re: Clearing dynamically generated mc
                        Beatie3 Level 1
                        Ummm, thank you. I did have those two variables there already I just hadn't bothered to include them. I did say I was using the Adobe example to work it all out. What I'm trying to do, with no success in AS 3.0 despite having it working perfectly in AS 2.0 is draw a line constrained to the x axis. As the line is drawn I want there to be a temporary clip with markers at each end and a hairline between them that will stretch as the mouse is dragged across the picture in the scrollpane. When the mouse is released the tempporary line will disappear and the drawShape function will draw the final black or white line. Also as the mouse is dragged across the image in the scrollpane I need the textfield, pixel_tf, to dynamically update and show how many pixels there are as they're drawn. I then also want to have the clr_btn clear both the pixel counter text field and the final line in case the line was incorrect.

                        Thank you, I think I'm nearly there, but it's a lot harder to do in AS 3.0 than it was in AS 2.0.