Remove an Element from the Element level...?

i have appliction and a component. i put the component to stage using the addElement(new myComponent());
i use vertical layout so you can add the component over and over by clicking the button at the application level.
I just want to be able to delete the components that i choose after adding it so removeElement... tried the this. route not working
any help is appreciated
Here is the application code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:comp="comp.*">
    <fx:Declarations>
        <comp:PhotoButton />
    </fx:Declarations>
   <s:SkinnableContainer x="14" y="108" width="180" height="325" backgroundColor="#CCD9DE">
        <s:Group id="layerGroup" width="180" y="33" >
            <s:layout>
                <s:VerticalLayout gap="0" />
            </s:layout>
        </s:Group>     
    </s:SkinnableContainer>
   <s:Button x="10" y="63" label="Button"
        click="{layerGroup.addElement(new PhotoButton());}"/>
</s:Application>
and my component:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" width="183" height="33">
    <s:layout>
        <s:HorizontalLayout />
    </s:layout>
    <s:SkinnableContainer backgroundColor="#ffffff">
        <s:Button id="removeBtn" label="X" width="29" x="0" y="0"/>
        <s:Button x="25" y="0" label="layer"/>
    </s:SkinnableContainer>
</s:Group>

I figured it out ....  so in the component I wrote a function that did
this:
private function sendClick(event:Event):void{
                parentApplication.layerGroup.removeElement(this);
thanks for looking at it!

Similar Messages

  • Kill a thread and remove the element from the vector

    Hi All
    I have attached each Vector element to a thread which I later want to kill and remove that element from the Vector.
    Thread.join(milliseconds) allows this functionality to let the thread die after n milliseconds.
    However, I want to delete this element from the Vector now.
    Can someone please throw some light on this?
    Here the code I have written for this:
    try
         System.out.println(counter);
         int xCoord = generator.irand(25,200);     // X-coord of AP
         int yCoord = generator.irand(25,200);     // Y coord of AP
         listMN.addElement(new MobileNode((int)mnId,new Point2D.Double(xCoord,yCoord)));
         listMNcoords.addElement(new Point2D.Double(xCoord,yCoord));
         for(int i=0;i<vnuBS.returnBSList().size();i++)
              if(vnuBS.returnBSListCoords().get(i).contains(xCoord,yCoord)&&(vnuBS.returnBSList().get(i).getChannelCounter()<=3)&&(vnuBS.returnBSList().get(i).getChannelCounter()>0))
                   double c = exponential() * 10000;
                   long timeToService = (long)c;
                   System.out.println("BS "+vnuBS.returnBSList().get(i).id+" is connected to MN ");
                   vnuBS.returnBSList().get(i).reduceChannelCounter();
                   System.out.println("Channel Counter Value Now: "+vnuBS.returnBSList().get(i).getChannelCounter());
                   mobileNodesThread.addElement(new Thread(listMN.elementAt(mobileNodeCounter)));
                   mobileNodesThread.elementAt(mobileNodeCounter).setName(mobileNodeCounter+"");
                   mobileNodesThread.elementAt(mobileNodeCounter).start();
                   mobileNodesThread.elementAt(mobileNodeCounter).join(100);
    //                              System.out.println("Died");// thread dies after join(t) milliseconds.
                   System.out.println("ListMN getting generated : " + mobileNodesThread.get(mobileNodeCounter));
              else if(vnuBS.returnBSListCoords().get(i).contains(xCoord,yCoord)&&(vnuBS.returnBSList().get(i).getChannelCounter()<=0))
                   listMN.remove(this.listMN.lastElement());                         //dropcall
                   System.out.println("Removed "+mnId);
                   removeCounter++;
                   mnId = mnId--;
                   mobileNodeCounter--;
              mnId = mnId+1;
         Thanks a lot.

    I'm not sure if what you are trying to accomplish is correctly implemented.
    The method join does not kill the thread. It will wait for the specified time for the thread to exit. If you want the thread to run for a specified ammount of time, develop the run method of that thread with that in mind. Do not try to kill it from the outside, but let it terminate itself (gracefull termination).
    Now for your question regarding the vector (you should probably be using ArrayList nowadays): I would implement the observer pattern for this job. Make the threads post an event on the interface when they are done, let the main thread register itself with the threads and synchronize the method that handles the events. In that method you can remove the object from your list.
    I'm not sure if you want to use thread anyhow, could you tell us what it is that you are trying to accomplish?

  • How do I remove a picture from Photoshop Elements 9 editor?

    I can't remove a picture from the Photoshop Elements 9 editor.  I am using an imac with the Lion operating system.  I have tried to close the picture, but everytime I open the editor from iphoto to do more advanced editing than is possible in iphoto the picture is still there.  Can anyone help with this BIG PROBLEM?  Please response directly to my e-mail.  Thank you.
    [email protected]
    March 16, 2012

    This is a quirk with the Elements editor and lion's feature for reopening saved windows. If you go to system prefs>general and turn off Restore Windows when quitting and reopening apps it will stop happening. See this thread for more:
    http://forums.adobe.com/thread/975625?tstart=0

  • I accidently deleated file from the Elements organizor and from the hard drive. Can I get it back?

    I accidently deleated a file from the Elements organizor and from the hard drive. Can I get it back? How to do it?

    There's a good chance that you can if you haven't done too much work after deleting it.  Typically files are not actually wiped from the hard drive, rather the space they take is marked as free to use by another file if needed.  So if it hasn't been used by another file it can be recovered.
    Try this program...  it will help if you know where the images were stored.
    http://www.piriform.com/recuva
    Colin

  • How to remove the worksets from the Top level navigation for the ESS role.

    Hi All,
    I am working on enabling and disabling certain services in the ESS worksets.
    we are using EP 7.0, ECC 6.0 (NW2004s).
    When I login as a user with ESS role, I can view the changes in the overview pages. However, the worksets are still visible in the TOP Level navigation of th poral. can anyone please explain me how to remove the workset from the Top level navigation.
    Thanks for your help
    Regards
    SM

    Hi,
    Go to the ESS role via Content Admin, then double click the workset (or page or iview) and in the drop down select navigation. Then click the <i>Yes</i> radio button of the "<i>Invisible in Navigation</i>" property.

  • How to save only newly added elements from the trailing list

    Dear,
    I have a shuttle bean with left and right trailing lists.
    At some point I save the right trailing list content to DB. Then I add additinal elements to the trailing list. Trying to save again gives me oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key
    exception.
    What is the approach I can take to only save newly added elements from the shuttle?
    I am wondering if I can put the extra logic (what logic would that be - do I need to check the PK value that is already in the database?) in the AM method with which I save the shuttle like here (TicketID and ResponsibilityID are primary key)
    if (items != null)
    Object ia[] = items.toArray();
    for(int i=1; i<ia.length; i++)
    Row rowApproval = vo.createRow();
    vo.insertRow(rowApproval);
    rowApproval.setNewRowState(Row.STATUS_INITIALIZED);
    Row row = vo.getCurrentRow();
    row.setAttribute("TicketId",items.get(0));
    row.setAttribute("ResponsibilityId",items.get(i) );
    row.setAttribute("Status",items.get(i));
    or should I do something in the EO?
    Thank you
    Anatoliy

    Hi,
    Can you please clarify - do I have to make a loop? I mean for every record/element in the trailing list
    I run the VO (that I will create) VO.executeQuery?Yes you do need to execute the VO for every record....by passing the different parameter in each iteration.
    Regards,
    Gyan

  • Anyone bought Photoshop Elements from the Apps Store just recently?

    Anyone bought Photoshop Elements from the Apps Store, either recently (April 2014) or in the last 12 months, say? The version on the Apps Store is just the editor and so doesn't incorporate an organiser.
    I'm just wondering if anyone happens to know whether the Store edition of this app includes support for Canon RAW files of the CR2 type. I've looked all over the Adobe website for the answer but without success.

    Hi..
    You can post a question in the Adobe Photoshop Elements forum here.

  • Accessibility, exclude UI elements from the Tab-chain

    Hi,
    I have a complex UI which is very uncomfortable to access with the Tab key when using sap-accesssibility=true parameter. The main problem are the many transparent containers, which are necessary to create the refined composition of the UI. They get focused when the Tab key is pressed and this is completely useless. I there a way to exclude UI elements from the Tab-chain?
    Best regards,
    Krasimir

    Hi,
    I have same prolem here.
    In my UI I am using mastercolumn for expand /collapse functionality in parent - child node .
    The problem is the keyboard tab-chain is skipping the master column which makes it a accessibility issue.
    Is there any way we can include/exclude UI elements from tab chain.
    My NWDS version is 7.0.10.

  • Is there a way to upgrade from the Elements 12 editor app to the full version?

    Is there a way to upgrade from the Elements 12 editor app to the full version?  I misread something and accidentally downloaded the app and I really miss the content that I´m mostly using.

    There are no student upgrades.  Never have been, never will be.  Your options are to either buy a new student verison or pay for the full retail upgrade price.  That's always been Adobe's policy.  If you are looking to jump on a cloud, then you need to contact Adobe sales for help.

  • I am trying to install photoshop elements from the shop bought card. After I put in redemption code the yellow line came up with "redemption is not available at the moment". What do I do?  Please help! Many thanks

    I am trying to install photoshop elements from the shop bought card. After I put in redemption code the yellow line came up with "redemption is not available at the moment". What do I do?  Please help! Many thanks

    There's been a few of these today. I think there must be a problem with the redemption server and you probably just need to wait a while and try again.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • How do you remove a symbol from the stage in Edge animate?

    Hello-
    I'm wondering how to remove a symbol from the stage in Edge Animate so you can jump to another place in the timeline.  In Flash, the symbol was only on the stage for the amount of frames you indicated.  Not sure how it works here.
    For example, I have 2 buttons on my first screen with some text that animates in.  I want the button click to take the user to another section in the timeline or (basically another scene, like in Flash)  that contains different content.  If I change the visibility the buttons are still there and will ( I assume) create problems when other elements are placed on top. 
    Or is the only way with code.  If that is the case what would that code be?
    I would appreciate any help.
    Thank you!

    What I usually do, is, once you have everything set up in the scene you are done with. highlight it all
    right click
    group elements in DIV
    Now all those items act as 1 group and then you give it a properties name, much like a symbol.
    THEN you can refer to that scene name and move it anywhere or hide it and slide in another scene that has the content for that next scene.
    basically you take all the elements that make up 1 scene, gruop it up, name it, and then in the code for the button say something like:
    on click:
    scenename.play(framenumber);
    that will then animate that scene according to any animation you gave it, such as moving to the left, off stage. while moving scene 2 that you create into the stage.
    or just have something like this hide it
    sym.$("scenename").hide();
    sym.$("scene2name").show();
    but if you do that, make sure in your CompositionReady code you hide all scenes EXCEPT the 1st one, so the user doesnt see them all instanatly anyway.

  • Problem Deleting a row from the bottom level of a tree binding

    We have the following requirement: To allow user to delete an item on an order (which is the lowest level node in tree) by updating the quantity textbox to zero in a jsp page.
    We display a listing of Ad Items for a Department with quantity textboxes. The user enters quantities and clicks on “add to my order” button. The items in which they have entered quantities for are persisted to a database table. The user is then directed to an order summary screen (shown below) where it displays the items and quantities for which they have placed an order for. The quantities are updateable. If the user changes a quantity to zero, we want to remove that item from the Order Items View Object (all VOs described are Entity based).
    Update Screen - click here (http://members.awiweb.com/images/adspl_summary.jpg)
    We are using a 3-level tree binding
    -- Department Level
    ---- Ad Items Level (items that they can order)
    ------ Order Items Level (items that they have ordered)
    Attributes on the Order Items View Object:
    ConfoOrderDeptId (key attribute)
    Itemcode (key attribute)
    DeliveryDate (key attribute)
    Quantity
    Customercode
    Custom method in the app module:
    //Gets the VO for the Order Items Level
    ConfoOrderItemEOVOImpl confoOrderItem = (ConfoOrderItemEOVOImpl)getConfoOrderItemEOVO1();
    //Creates an Object from the values being passed into the custom method.
    //There is a value for each key attribute in the Order Items VO
    Object [] myKeyObj = new Object[]{confoOrderDeptId,itemcode,date};
    Key myKey = new Key(myKeyObj);
    Row [] orderItemRow = confoOrderItem.findByKey(myKey,1);
    //newQty is updated quantity
    if ("0".equals(newQty))
    orderItemRow[0].remove();
    else
         orderItemRow[0].setAttribute("Quantity",newQty);
    The updates (setAttribute) is working fine. The deletes (.remove()) is throwing a null pointer exception (see stack trace below).
    We also tried overloading the setQuantity method in the RowImple class and called this.remove() if the quantity being passed in was zero, but we got the same null pointer result.
    04/08/27 16:57:29 java.lang.NullPointerException
    04/08/27 16:57:29      at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.myUpdateValuesFromRows(JUCtrlHierNodeBinding.java:419)
    04/08/27 16:57:29      at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.updateRowDeleted(JUCtrlHierNodeBinding.java:326)
    04/08/27 16:57:29      at oracle.jbo.uicli.binding.JUIteratorBinding.rowDeleted(JUIteratorBinding.java:220)
    04/08/27 16:57:29      at oracle.jbo.common.RowSetHelper.fireRowDeleted(RowSetHelper.java:222)
    04/08/27 16:57:29      at oracle.jbo.server.ViewRowSetIteratorImpl.deliverRowDeletedEvent(ViewRowSetIteratorImpl.java:3026)
    04/08/27 16:57:29      at oracle.jbo.server.ViewRowSetIteratorImpl.notifyRowDeleted(ViewRowSetIteratorImpl.java:2915)
    04/08/27 16:57:29      at oracle.jbo.server.ViewRowSetImpl.notifyRowDeleted(ViewRowSetImpl.java)
    04/08/27 16:57:29      at oracle.jbo.server.ViewObjectImpl.notifyRowDeleted(ViewObjectImpl.java:6565)
    04/08/27 16:57:29      at oracle.jbo.server.ViewObjectImpl.notifyRowDeleted(ViewObjectImpl.java:6603)
    04/08/27 16:57:29      at oracle.jbo.server.QueryCollection.removeRow(QueryCollection.java:2118)
    04/08/27 16:57:29      at oracle.jbo.server.QueryCollection.afterRemove(QueryCollection.java:2083)
    04/08/27 16:57:29      at oracle.jbo.server.ViewObjectImpl.sourceChanged(ViewObjectImpl.java:7770)
    04/08/27 16:57:29      at oracle.jbo.server.EntityCache.sendEvent(EntityCache.java:616)
    04/08/27 16:57:29      at oracle.jbo.server.EntityCache.deliverEntityEvent(EntityCache.java:642)
    04/08/27 16:57:29      at oracle.jbo.server.EntityCache.notifyStateChange(EntityCache.java:763)
    04/08/27 16:57:29      at oracle.jbo.server.EntityImpl.setState(EntityImpl.java:2875)
    04/08/27 16:57:29      at oracle.jbo.server.EntityImpl.remove(EntityImpl.java:5548)
    04/08/27 16:57:29      at oracle.jbo.server.ViewRowImpl.doRemove(ViewRowImpl.java:1773)
    04/08/27 16:57:29      at oracle.jbo.server.ViewRowImpl.remove(ViewRowImpl.java:1813)
    04/08/27 16:57:29      at com.awiweb.om.model.dataaccess.ConfoOrderItemEOVORowImpl.setQuantity(ConfoOrderItemEOVORowImpl.java:112)
    04/08/27 16:57:29      at com.awiweb.om.model.services.ConfoOrderingAppModuleImpl.updateConfoOrderItemWithValues(ConfoOrderingAppModuleImpl.java:247)
    04/08/27 16:57:29      at com.awiweb.om.view.CurrentOrderSummaryAction.onUpdateCurrentOrder(CurrentOrderSummaryAction.java:39)
    04/08/27 16:57:29      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    04/08/27 16:57:29      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)
    04/08/27 16:57:29      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    04/08/27 16:57:29      at java.lang.reflect.Method.invoke(Method.java)
    04/08/27 16:57:29      at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:512)
    04/08/27 16:57:29      at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:211)
    04/08/27 16:57:29      at oracle.adf.controller.lifecycle.PageLifecycle.processComponentEvents(PageLifecycle.java:447)
    04/08/27 16:57:29      at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:246)
    04/08/27 16:57:29      at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:440)
    04/08/27 16:57:29      at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:114)
    04/08/27 16:57:29      at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:233)
    04/08/27 16:57:29      at com.awiweb.om.ext.AWIDataAction.handleLifecycle(AWIDataAction.java:191)
    04/08/27 16:57:29      at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:163)
    04/08/27 16:57:29      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    04/08/27 16:57:29      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    04/08/27 16:57:29      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
    04/08/27 16:57:29      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
    04/08/27 16:57:29      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    04/08/27 16:57:29      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    04/08/27 16:57:29      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    04/08/27 16:57:30      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    04/08/27 16:57:30      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    04/08/27 16:57:30      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:228)
    04/08/27 16:57:30      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
    04/08/27 16:57:30      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
    04/08/27 16:57:30      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    04/08/27 16:57:30      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    04/08/27 16:57:30      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    04/08/27 16:57:30      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    04/08/27 16:57:30      at java.lang.Thread.run(Thread.java:534)

    This looks like a bug in TreeBinding. Please file this as a bug/tar with OracleSupport with your reproducible testcase (or steps to reproduce). Thanks.

  • How to remove available downloads from the list

    how to remove available downloads from the list without it resuming when i open itunes or check for available downloads?

    There is not a way to remove them from the list.  Just let them download, and then delete them from your library when they are done.

  • How to remove characters/lines from the beginning of an InputStream

    Hi,
    I have a program which receives several InputStreams. From each of these streams I have to remove 2 lines from the beginning. After the lines are removed, all the streams are combined to one with SequenceInputStream and read in one chunk. Is there an easy/simple way of doing this?
    One option I thought would be to read the char by char until 2 end of line chars have been detected and then read the rest of the data to a buffer. And the create a ByteArrayInputStream out of this buffer. Problem with this approach is, that the amount of data can be large, so putting all the data in to memory might cause problems.
    Another option is to use BufferredInputStream and use the readline() method twice to get rid of the lines that are not needed. After this I would write the data to some output stream, which is then converted back to input stream. Propably would work, but sound too much of work for a simple thing like this. There has to be better way.
    To make it simple, what I need is a method that looks like the following, or something similar
    *  Removes n number of lines from the beginning of a InputStream.
    *  @param is InputStream where the lines are removed
    *  @param numberOfLines int value to indicate how many lines whould be removed
    *  @return InputStream where lines have been removed.
    public InputStream removeLines(InputStream is, numberOfLines);Thanks.

    Here's the code, feel free to use it. Comments are also welcome.
    public InputStream removeLinesFromTheBeginning(InputStream is, int numberOfLines) throws IOException
              char c = 'c';
              int i = 0;
              for(int n = 0 ; n < numberOfLines ; n++)
                   do
                        c = (char)is.read();
                        System.out.print(c);
                        if(c == (char)-1)     // end of stream reached before any newline characters were found.
                             return null;
                        i++;
                   while(c != '\n');
                   System.out.println();
                   System.out.println("Characters removed:" + i);
                   System.out.println("n: " + n);
                   i = 0;
              return is;
         }Edited by: dave_spaghetti on Jun 16, 2009 5:42 AM
    Fixed a bug.

  • HT5622 We have two iphones with the same Apple ID. Since I installed iOS this morning I have started receiving all my sons texts and when I send him a text it is delivered to both of us. How can I remove my phone from the joint Apple ID and remove myself

    My son and I both have iphones with the same Apple ID. Since I installed iOS this morning I have started receiving all my sons texts and when I send him a text it is delivered to both of us. How can I remove my phone from the joint Apple ID and remove myself from finding out what he is up to during Freshers week!

    You have to use a different Apple ID for your son.
    Read this note:
    iOS 5 & iCloud Tips: Sharing an Apple ID With Your Family
    still valid for ios 7

Maybe you are looking for