Clear() method

gridPane.getChildren().clear()
I just would like to know if above method call is recursive to wipe out everything?
The reason is I don't want anything to stay on stack.

This is not a recursive call:
    grid.add(category, 1, 0);
    Label  chartTitle = new Label("Current Year");
    grid.add(chartTitle, 2, 0);
    Label  chartSubtitle = new Label("Goods and Services");
    grid.add(chartSubtitle, 1, 1, 2, 1);
    grid.getChildren().addListener(new ListChangeListener<Node>() {
            public void onChanged(ListChangeListener.Change<? extends Node> c) {
                while (c.next()) {
                   System.out.println(c); 
        grid.getChildren().clear();The clear method fired only one change notification.

Similar Messages

  • Clear method and Garbage Collector

    Hi Gurus,
    Does the Clear method (hashtable, vector etc..) is a good option for garbage collection ?
    In other words, if I have a vector V with 100 elements and I perform a V.clear(), am I sure that the 100 elements are now candidates for the Garbage Collection ?
    Or is it better to write a loop performing a NULL assignment for each element of the vector ?

    Hi schapel,
    I know it's not a good idea to force the garbage collector, but let me explain what I am confronted with.
    (FYI, I didn't write the source code. Comes from a 3rd party)
    The aim is to build a jsp page which is the list of the files contained in a web server directory.
    I have a "Directory" class, and a "File" class. To build the jsp, each directory of the webserver is represented by a directory class, and each file, ...by a file class.
    To simplify, when the tree structure of the web server is build in memory, I create a jsp page to list the files, and then, I do not need the vector anymore. But the vector can be quite huge and each client will build his own vector at the begening of his session (and will never use it again during the session).
    Don't you think it's usefull in that situation to free some memory ?

  • Reference.clear method

    I think that I do not understand the Reference.clear method. I am trying to use SoftReferences to store objects (actually Sets) that can be retrieved from filesystem files. And I am trying to use (override) the Reference.clear method to handle writing said file when one of them is about to go "byebye"...
    But what is happening is that my clear method never gets called AND the SoftReference.get method returns null. (Which means that the referent is gone without clear having been called...which means I don't understand the clear method!)
    SOOOOOO, can someone please either explain how I can be alerted to handle something just before something gets gc-ed, or else enlighten me to a better way to implement this?
    Here's the longer story:
    I have many "records", far too many to even consider keeping them all in memory at once. So I started storing them in "minisets" which I can serialize to files and retrieve as needed. The "minisets" are values in a HashMap with string keys.
    When one of these Sets gets "big enough", I start storing a SoftReference to it instead of "it". Then when I need a particular set, I do a hashmap.get(key), then either (a) I get the Set, or (b) I get the the softref from which I can get the Set, or (c) I get the softref from which I cannot get the Set, in which case I go reconstruct the Set by reading a file.
    The problem is writing the file... if I write a file every time I edit a (potentially large) Set then this program will take 5 days to run. So I think I want to write the file only when absolutely necessary....right before the gc eats it.
    Thank you for help,
    /Mel

    Okay, here it is.
    MyRef: My extension of PhRef. Also holds referent data that we need for cleanup, since we can't get to referent once Ref is enQ'ed.
    Dummy: thie is the class that you're storing in the Sets or whatever, and that gets put in a reference.
    Dummy's id_ member: This holds the place of whatever data you need for pre-bye-bye cleanup, e.g. a filename and the internal data of Dummy. MyRef grabs this when it's created.
    (Note: what you may want to create a new class, say DummyWrapper that holds a Dummy and provides the only strongly reachable path to it, pass DummyWrapper to the Ref's constructor, and then have the Ref store the wrapped Dummy (e.g. wrapper.getDummy()) as its member var in place of the id_ that I'm storing--that is, in place of storing a bunch of internal data individually. Like I said, this approach seems overly complex, but I've not found a simpler way that works. I originally tried having the Ref store the Dummy directly as a member var, but then the Dummy was always strongly reachable.)
    Poller: Thread that removes Refs from queue. You can probably just do this at the point in your code where you decide the set is "big enough", rather than in a separate thread.
    dummies_: List that holds Dummies and keeps them strongly reachable until cleanup time. I think you said your stuff was in a Set or Sets. This is the parallel to your Set(s).
    refs_: List of PhRefs to keep them reachable until they get enqueued.
    When I don't use Refs properly to clean things up, I get OutOfMemoryError after about 60 or 120 iterations. (I tried a couple different sizes for Dummy, so I forget where I am now.) With the Refs in place, I'm well over 100,000 iterations and still going.
    import java.lang.ref.*;
    import java.util.*;
    public class Ref {
        public static ReferenceQueue rq_ = new ReferenceQueue();
        // one of these lists was giving ConcurrentModificationException
        // so I sync'ed both cuz I'm lazy
        public static List dummies_ = Collections.synchronizedList(new ArrayList());
        public static List refs_ = Collections.synchronizedList(new ArrayList());
        public static Poller po_ = new Poller();
        public static void main(String[] args) {
            new Thread(po_).start();
            new Thread(new Creator()).start();
        public static class Poller implements Runnable {
            public void run() {
                // block until something can be removed, then remove
                // until nothing left, at which point we block again
                while (true) {
                    try {
                        MyRef ref = ((MyRef)rq_.remove());
                        // This println is your file write.
                        // id_ is your wrapped Dummy or the data you need to write.
                        // You probably want a getter instead of a public field.
                        System.err.println("==================== removed "
                                + ref.id_  + "             ======  ===  ==");
                        ref.clear();  // PhRefs aren't cleared automatically
                        refs_.remove(ref); // need to make Ref unreachable, or referent won't get gc'ed
                    catch (InterruptedException exc) {
                        exc.printStackTrace();
        public static class Creator implements Runnable {
            public void run() {
                int count = 0;
                while (true) {
                    // every so often, clear list, making Dummies reachable only thru Ref
                    if (count++ % 50 == 0) {
                        System.err.println("                 :::: CLEAR");
                        dummies_.clear();
                    // give Poller enough chances to run  
                    if (count % 16 == 0) {
                        System.gc();
                        Thread.yield();
                    // Create a Dummy, add to the List
                    Dummy dd = new Dummy();
                    System.err.println("++ created " + dd.id_);
                    dummies_.add(dd);
                    // Create Ref, add it to List of Refs so it stays
                    // reachable and gets enqueued
                    Reference ref = new MyRef(dd, rq_);
                    refs_.add(ref);
        public static class MyRef extends PhantomReference {
            private long id_;  // data you need to write to file
            public MyRef(Dummy referent, ReferenceQueue queue) {
                super(referent, queue);
                id_ = referent.id_;
            public void clear() {
                System.err.println("-------CLEARED " + get());
            public String toString() {
                return "" + id_;
        public static class Dummy {
            // just a dummy byte array that takes up a bunch of mem,
            // so I can see OutOfMemoryError quickly when not using
            // Refs properly
            private final byte[] bb = new byte[1024 * 512];
            private static long nextId_;
            public final long id_ = nextId_++;
            public String toString() {
                return String.valueOf(id_);
    }

  • Azure Dedicated Role Cache does not fire notification to client when call DataCache.Clear method

    Hi,
    I'm using Azure Dedicated Role cache and  Enabled the local cache and notification.
    <localCache isEnabled="true" sync="NotificationBased" objectCount="20000" ttlValue="3600" />
    <clientNotification pollInterval="1" maxQueueLength="10000" />
    but when I call DataCache.Clear method in one client, the notification does not send to all clients, the client's local cached content still been used.
    is this a bug of Azure SDK 2.5?

    I assume that you have correctly configured and enabled Cache notifications, instead of using the DataCache's clear method - have you tried clearing all regions in your cache because I am not sure if DataCache.Clear triggers the cache notification or not.
    so your code should look something like this
    foreach (string regionName in cache.GetSystemRegions())
    cache.ClearRegion(regionName)
    You can refer the link which explains about Triggering Cache Notifications  https://msdn.microsoft.com/en-us/library/ee808091(v=azure.10).aspx
    Bhushan | Blog |
    LinkedIn | Twitter

  • Alsett clearing method in dreamweaver

    Hi everyone, has anyone used this in DW? My page looks wrong
    in Dreamweaver design view, but displays fine in the
    browser.

    Yep. Like much of the stuff I find on ALA, it's academically
    interesting,
    but practically useless.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "T.Pastrana - 4Level" <[email protected]> wrote in message
    news:[email protected]...
    >I agree.
    >
    > In that article he states...
    >
    > "
    > First and foremost, this clearing method is not at all
    intuitive,
    > requiring an extra element be added to the markup. One
    of the major
    > premises of CSS is that it helps reduce the bloated HTML
    markup found it
    > the average site these days. So having to re-bloat the
    markup just so
    > floats can be kept within their containers is not an
    ideal arrangement.
    > "
    >
    > Adding this... <div
    style="clear:both;"></div> ... doesn't seem like HTML
    > bloat to me, but with the method in the article you need
    to add this to
    > the CSS...
    >
    > .clearfix:after {
    > content: ".";
    > display: block;
    > height: 0;
    > clear: both;
    > visibility: hidden;
    > }
    >
    > .clearfix {display: inline-table;}
    >
    > /* Hides from IE-mac \*/
    > * html .clearfix {height: 1%;}
    > .clearfix {display: block;}
    > /* End hide from IE-mac */
    > What a mess! and it is bloating the CSS file so it
    doesn't make much sense
    > to me :-)
    >
    >
    > --
    > Regards,
    > ..Trent Pastrana
    > www.fourlevel.com
    >
    >
    >
    >
    >
    > "Murray *ACE*" <[email protected]>
    wrote in message
    > news:[email protected]...
    >> Thanks. I don't like it. Sorry. It forces me to
    remember to hack/zoom
    >> for IE.
    >>
    >> My <br class="clearer" /> works fine.
    >>
    >> --
    >> Murray --- ICQ 71997575
    >> Adobe Community Expert
    >> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >> ==================
    >>
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >>
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    >> ==================
    >>
    >>
    >> ".: Nadia :. **AdobeCommunityExpert**"
    >> <[email protected]>
    wrote in message
    >> news:[email protected]...
    >>>
    >>> "Murray *ACE*"
    <[email protected]> wrote in message
    >>> news:[email protected]...
    >>>> Used what? Which DW?
    >>>
    >>>
    http://www.positioniseverything.net/easyclearing.html
    >>>
    >>> A way of clearing divs....
    >>>
    >>>
    >>> --
    >>> Nadia
    >>> Adobe� Community Expert : Dreamweaver
    >>>
    >>>
    http://www.DreamweaverResources.com
    - CSS Templates|Tutorials
    >>>
    http://www.csstemplates.com.au
    >>>
    >>>
    http://www.perrelink.com.au
    - Web Dev
    >>>
    >>>
    http://www.adobe.com/devnet/dreamweaver/css.html
    >>> CSS Tutorials for Dreamweaver
    >>>
    >>>
    >>>
    >>>
    >>
    >>
    >
    >

  • Regarding remove() and clear () method

    when we call clear() and remove(index) method for vector or hashtable, the element will be removed and the size decreases by one . The question is wheteher the memory will get freed when these methods are called?

    Hi,
    Vectors hold only references to other objects. Hence, when you "add or remove" elements to vectors, you are only adding or removing references to other objects in the heap.
    Memory taken by objects in the heap is freed as per the whims of the garbage collector. Unless your program does some memory-intensive computation, the garbage collector might not even run during your program's execution phase.
    If you have declared Vector v = new Vector();, the JRE will create a vector object in the heap, capable of storing 10 references. If you try to add an 11th reference to the vector, the Vector object will grow automatically by a default increment. Since in your code you are adding and removing references continuously, the Vector size will remain the same as long as the number of references never exceeds 10.
    Regards,
    Kumar.

  • Excise invoice clearing method for customs

    Hi Gurus
        this is chandu  , how to clear the excise invoice for imported materials is there  any transactional code to plz tell me 
    Example: if suppose i'm importing a material from USA so how can i clear the customs duty to make a GR at my company  plz help me in thios

    Hi,
    In Import procurement you hve separate pricing procedure, this you will assign to vendor.
    Freight, Customs duties and others create as Planned delivery condition types. While defining the condition type you can define this option. Once you define in this way, while creating Purchase order against to tht condition type you can enter the vendor name(customs vendor).
    For example Freight cost you hve to pay to C&F agent or FFAgent right ? In purchase order select the conditon type and click on details there you can enter the Vendor number. Like this do the same for custom duty condition types and enter customs vendor name.
    In Invoice verification in MIRO select planned derivery costs then the system will show pop screen which contains the vendors entered against condition types. Select the required vendor (FFAgent for Freight charges, customs vendor for customs duties) and post the Invoice verification.
    For material select Goods/Service items in MIRO, system by default it will take Imports vendor.
    Before posting GR for import PO you hve to post the planned delivery costs in MIRO.
    Hope its clear to you, still if u hve any questions let me know.
    Flow is as follows.
    1. create PO and enter the Customs vendor in condition types
    2.Post customs duty in MIRO as planned delivery costs
    3.MIGO
    4.MIRO for Import vendor
    reg
    Durga
    *Assign points if the info useful

  • Difference between vector obj.clear() and Vector obj = null

    What is the difference between clearing the Vector object with .clear() method and assigning null value to Vector object?
    As per memory point of view, is it advisable to first clear vector and then assaign it to null for garbage collection or it doesn't make any difference.
    Vector may contains large volume of data.
    Please reply this if any one has fair idea regarding this.
    Thanks in advance.
    Deepalee

    What is the difference between clearing the Vector
    object with .clear() method and assigning null value
    to Vector object?
    Vector victor = new Vector(); //victor is a reference to a Vector object
    victor.clear(); //now that Vector object has no elements
    victor = null; //now victor is a null reference; it doesn't point to any Vector object
    //if that was the only reference to that Vector, the Vector is now available to be GC'ed.
    As per memory point of view, is it advisable to first
    clear vector and then assaign it to null for garbage
    collection or it doesn't make any difference.Hard to say. My gut says there will be no advantages to first clearing it. You'd have to try and measure.

  • Not able to clear the cenvat suspense account

    Hi Experts,
    Is there any T.code or short-cut method to find out the clearing documents for every open items in cenvat suspense account. Is it possible to run in the automatic clearing method through T.code:F.13
    in the absence of month end processing.
    Thanks & Regards,
    J.Francis

    Yes , you can clear the clearing account even you are not doing month end process via f.13 subject to you have configured the Automatic clearing in system.
    You can find the clearing document in FBL3n itself by screen layout. Or in BSEG table AUBGL feild gives you details of clering document .
    Hope this will helps you
    Regards
    Parag

  • Video Clear

    Hi everyone, I'm trying to create a videochat using Flex 3
    and Flash Media server and I have some problems with the method
    "Clear" of Video object. When a user stop publishing its stream
    (from the webcam), I receive an event because a shared object
    property (with the id of the publisher) changes to "null". At this
    time, I invoke the method "clear" of the video object that contains
    the stream, but the screen (videoDisplay containing the video
    object) doesn't change. I continue seeing the last frame received.
    What can I do? Thanks!!

    You could also subclass the VideoDisplay control and add your
    own public "clear()" method which calls the
    mx_internal::videoPlayer.clear() code.
    [ActionScript]
    package {
    import mx.controls.VideoDisplay;
    import mx.core.mx_internal;
    public class MyVideoDisplay extends VideoDisplay {
    public function MyVideoDisplay() {
    //TODO: implement function
    super();
    public function clear():void {
    pause();
    mx_internal::videoPlayer.clear();
    [/ActionScript]
    [MXML]
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:custom="*" layout="vertical">
    <custom:MyVideoDisplay id="myVideoDisplay" source="
    http://www.helpexamples.com/flash/video/cuepoints.flv"
    />
    <mx:Button label="clear" click="myVideoDisplay.clear();"
    />
    </mx:Application>
    [/MXML]
    Peter

  • Issue with clearing a grayed out search criteria field

    Hi,
    I have grayed out a field ABC for its default  value XYZ in the search criteria of lead search...
    But when I click the CLEAR button, it clears the XYZ value of field ABC..
    I don't want the value of ABC to be cleared...
    Do I need to redefine the CLEAR method?
    How do I achieve this purpose?
    Thanks
    Madhukar

    Hi Madhukar,
    go to your eh_onclear event place the break point check the code where exactly parameters values are clearing. copy the standard code redefine the method eh_onclear past the code in your redefine method and change the logic where exactly the parameters are clearing as a standard.
    ex as the above code:
    WHILE lr_param IS BOUND.
         lr_param->get_properties( IMPORTING es_attributes = ls_param ).
    in ls_param you will get ATTR_NAME as ur field and low,high sign option values
    check this ls_param-ATTR_NAME ne 'urfield'. clear the content else check the low and high value of the remaining field values.
         IF ( ls_param-low  IS NOT INITIAL ) OR
            ( ls_param-high IS NOT INITIAL ).
           CLEAR: ls_param-low, ls_param-high.
           lr_param->set_properties( EXPORTING is_attributes = ls_param ).
         ENDIF.
         lr_param = lr_iterator->get_next( ).
       ENDWHILE.
    if you want more info share me your component and view name.
    Thanks & Regards,
    Srinivas.

  • Reflection and the field.set method

    OK, I've made 2 classes, a ClearParent and ClearChild (which extends ClearParent). I'd like to have a "clear" method on the parent which dynamically sets all the fields to null. I'd like to be able to have any child that inherits from the parent be able to call clear and dynamically have all it's fields set to null.
    Part of the restriction that I'm facing is that the fields are Objects (Integer) but the getter and setter methods take and return types (int). So I can't just loop through the Methods and call the setters with null.
    I'd like to be able to loop through the fields and call set for all the fields with the parent class.
    I'm inserting the code that I have for the parent and child classes at the end. Basically, the problem that I'm seeing is that if I do a
    this.getClass().getName()
    from the parent (when clear is called from the child) it shows me the child name ("ClearChild"). But when I try to do the
    field.set(this, null)
    it tells me this:
    Class ClearParent can not access a member of class
    ClearChild with modifiers "private"
    How come when I get the name it tells me that it's the child but when I pass "this" to the set method, it says that it's the parent?
    Any one know what's going on here? Is there anyway that I can have the parent set all the fields to null?
    Thanks in advance.
    Here's the code:
    ClearParent
    import java.lang.reflect.*;
    public class ClearParent {
        public boolean clear() {
            try {
                System.out.println(this.getClass().getName());
                Field[] fields = this.getClass().getDeclaredFields();
                Field   field;
                for (int i = 0; i < fields.length; i++) {
                    field = fields;
    field.set(this, null);
    } catch (Exception e) {
    e.printStackTrace();
    return true;
    ClearChild
    public class ClearChild extends ClearParent {
    private Float f;
    public ClearChild() {
    super();
    public float getF() {
    if (f == null) {
    return 0;
    return f.floatValue();
    public void setF(float f) {
    this.f = new Float(f);
    public static void main (String[] args) throws Exception {
    ClearChild cc = new ClearChild();
    cc.setF(23);
    cc.clear();
    System.out.println("cc.getF: " + cc.getF());

    It is an instance of ClearChild that is being used so
    that class name is ClearChild. However, the method
    exists in the parent class and thus cannot act upon a
    private field of another class (even if it happens to
    be a subclass).Ahh...makes sense.
    Why don't you just override clear in the child?We were trying to avoid this because we run into problems in the past of people adding fields to the class, but not adding to the clear, and things not being cleared properly.
    I talked it over with the guys here and they have no problem making the fields protected instead of private. If it's protected, then the parent has access to it and my sample code works.
    Thanks for your help KPSeal!
    Jes

  • ArrayList clears when placed in HashMap

    I have a series of ArrayLists (argValues), to be used as the values in a HashMap. They are not empty when they are placed in the table, but when I try to get one of them out, the ArrayList that is returned is empty. Here is the part of my code that has the problem. I'm parsing an XML file beforehand (doc_cmd is the Document into which the XML was parsed):
               NodeList nl_cmd = doc_cmd.getElementsByTagName("RFSW_CMD_PKT");
               if (doc_cmd != null) {
                   for(int i = 0; i < nl_cmd.getLength(); i++) {
                        if (!nl_cmd.item(i).getNodeName().equals("#text")) {
                            String key = nl_cmd.item(i).getAttributes().getNamedItem("NAME").getNodeValue();
                            //   System.out.println(key);
                            Element currentCmd = (Element) nl_cmd.item(i);
                            NodeList nlChildren = currentCmd.getChildNodes();
                            ArrayList argValues = new ArrayList();
                            for (int j = 0; j<nlChildren.getLength(); j++) {
                                if (!nlChildren.item(j).getNodeName().equals("#text")) {
                                    nodeName = nlChildren.item(j).getNodeName();
                                    if (!nodeName.equals("BITFIELD") && !nodeName.equals("UNION"))
                                        argName = nlChildren.item(j).getAttributes().getNamedItem("NAME").getNodeValue();
                                    else
                                        argName = "";
                                    value = nodeName + "_" + argName;
                                    argValues.add(value);
                            // THIS IS WHERE THE PROBLEM IS
                            System.out.println("ARGVALUES SIZE = " + argValues.size());
                            hashcmds.put(key, argValues);
                            argValues.clear();
                            ArrayList yo = (ArrayList)hashcmds.get(key);
                            System.out.println("SIZE = " + yo.size());

    Note that you're calling the clear method on the
    object you've inserted, not a copy of it. You should
    clone() itIn this case I there is no point in cloning the ArrayList because it goes out of scope. He isn't resuing it and there was never a reason to clear it anyway. The solution is to just not clear the ArrayList.
    If one were attempting to reuse it in that manner, cloning an ArrayList and clearing it to use again is less efficient than just creating a new one and letting the old one go out of scope.
    The steps required to fill clone and reuse.
    1. create new ArrayList
    2. copy references
    3. clear entries
    4. insert n refereneces
    The steps required to just create new
    1. create new ArrayList
    2. insert n references
    By clearing the ArrayList here, you are just doing more work.

  • Clearing a Drawing? [Mask]

    Hello,
    So I have a project I am working on in which I would like to teach how to cash a scratch off card. I have made the scratch and made it so it will "scratch", however my masking technique seems to not be working how it should...
    The idea is that the user would "scratch" the card and then hit "Next" after that it would load a new frame (Progress Bar would move) and then do what they need to on that frame, and so on.
    However it would seem that Flash is keeping the users "drawing" and still allows them to draw after the first frame, which is not what I want.
    Frame 1 (Before User Scratchs)                                                                                                         Frame 1 (After User Scratchs)                                                                                                   Frame 2 (After User Scratchs)
    I am using this code to make the scratch effect and I am having it load extranally:
    package {
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.ui.Mouse;
        public class ScratchTicket extends MovieClip{
            var scratcherIsActive:Boolean= false;
            var stuffUnderMask:Sprite = new Sprite();
            // init class
            public function ScratchTicket():void{
                stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseIsDown);
                stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseIsMoving);
                stage.addEventListener(MouseEvent.MOUSE_UP, mouseIsUp);
                // make mask           
                stuffUnderMaskClip.mask = stuffUnderMask;
                addChild(stuffUnderMask);
                makeCursor();
            // helper functions
            private function makeCursor():void{           
                trace();
            // hover effects
            private function mouseIsDown(e:MouseEvent):void{
                //Mouse.hide();
                Mouse.cursor="hand";
                scratcherIsActive = true;
            private function mouseIsUp(e:MouseEvent):void{
                //Mouse.show();
                Mouse.cursor="arrow";
                scratcherIsActive = false;
            private function mouseIsMoving(e:MouseEvent):void{
                if(scratcherIsActive){
                    stuffUnderMask.graphics.beginFill(0x000000);
                    stuffUnderMask.graphics.drawEllipse(mouseX, mouseY,60, 60);
                    stuffUnderMask.graphics.endFill();
        }// class
    }// package
    I would load this script locally, however I am not sure were to place it, or if it would even help.
    Thank you!

    Are you handling the situation that the user may leave the flash area altogether? This is often a problem. Even if it doesn't solve your issue, I see no mention of MOUSE_LEAVE in your events.
    I would change the event your mouseIsUp(e:MouseEvent):void function listens for to a generic event. So private function mouseIsUp(e:Event):void. Then you can do this:
    stage.addEventListener(Event.MOUSE_LEAVE, mouseIsUp);
    That will make sure that if the user leaves the flash area the mouse will have a chance to run mouseIsUp().
    When your user is done scratching don't forget to dispose of the surface you're drawing on with the graphics.clear(); method (e.g. stuffUnderMask.graphics.clear();) as well as removing any objects made to draw on.

  • Clear() vs. removeAll() for an ArrayList

    What's the difference between clear() and removeAll() for an ArrayList?
    Does one actually garbage collect the memory? Is one better for synchronized situations?
    From the documentation it's not clear how they differ except that removeAll uses an iterator and clear() doesn't give details.
    Anyone have a link to more info?
    Thanks!

    I do not find a removeAll() method in ArrayList!
    I find a method removeAll(Collection c)
    it takes a Collection as a parameter.
    here is it's specification
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html#removeAll(java.util.Collection)
    when you call this method on an ArrayList, it takes the Collection passed as a parameter and if an element in the passed collection exists in the ArrayList then the element is removed.
    The clear() method is specified here
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html#clear()
    I think it's purpose is "clear" (pun intended)
    sincerely
    Walken16

Maybe you are looking for