Selecting Items from an Inventory

So you start off with all of the items in the inventory. You do not have to collect them.
I  have 8 MovieClips on the stage each with a different instance name. I  made a class called Rebound and linked all the inventory MoivieClips to  the Rebound class as the base class. they each have their own unique  class.
What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)
it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.
but  when you click another item in the inventory I want it to deselect the  item you clicked first so it goes back to frame 1 and isSelected =  false. The problem I'm having is that it selects the first item when you  click it. But when I click another the first stays on frame 1 and  isSelected stays true. So if I click all 8 in a row they all become  selected.
here's the class
Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Rebound extends MovieClip {
public var isSelected:Boolean;
public function Rebound():void {
this.addEventListener(MouseEvent.MOUSE_UP, starting);
public function starting(e:MouseEvent):void {
this.isSelected = false;
this.gotoAndStop(1);
e.currentTarget.gotoAndStop(2);
e.currentTarget.isSelected = true;
I thought this. called on every movieclip of the Rebound class?
So  instead of this. if there is something that can choose all of the  movieclips that belong to the Rebound class I think I could use that  instead. If there is such thing.
Help would be much appreciated. Thanks.

you can create a static array to keep track of all class members:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Rebound extends MovieClip {
public var isSelected:Boolean;
public static var a:Array=[]
public function Rebound():void {
a.push(this);
this.addEventListener(MouseEvent.MOUSE_UP, starting);
public function starting(e:MouseEvent):void {
// iterate through a and deselect all but "this"
this.isSelected = false;
this.gotoAndStop(1);
e.currentTarget.gotoAndStop(2);
e.currentTarget.isSelected = true;

Similar Messages

  • Getting selected item from combobox itemrenderer and storing in object

    Hi Guys,
    Can anyone help me in this regard. Its very urgent.
    I have a combo box itemrenderer in datagrid column. I want to get the user selected item from the dropdown of the row(s) (User may select values from combo box from multiple rows of datagrid) and corressponding values of all other columns of the rows and store it in an object . Then pass this object to database to update only those rows that user has changed.
    I am able to get the selected item from combo box using "event.currentTarget.selectedItem" and corressponding values of all other columns of the rows using "valueSelect.ID", etc where valueSelect is object which contains data for datagrid. But am stuck up with, how to store the selected item value of the combobox  and corressponding values of all other columns of the rows into an Object ?.
    Can anybody help me with sample to store selected item from combobox and its corressponding values of all other columns into an object which i can send to db...?
    Kindly help me in this regard.
    Thanks,
    Anand.

    Hi!
    Are you using a collection of VO or DTO as the dataprovider of the combobox component?
    If so, have you created some attribute there to control the user's selection in the combobox?
    For instance:
    private var selected:Boolean = false;
    If your solution fits this approach, you may create a new collection that contains just the objects that were selected by the user, it means you can loop through the datagrid's dataprovider and only insert in this new collection those objects that have the attribute "selected" set to true.
    For instance:
    private function getSelectedRecords(datagridDataProvider:ArrayCollection):ArrayCollection
        var newCollection:ArrayCollection = new ArrayCollection();
        for each (var item:Object in datagridDataProvider)
            if (item.selected)
                newCollection.addItem(item)
        return newCollection;
    Afterwards, you may serialize this new collection with your back-end.
    Hope it helps you!
    Cheers,
    @Pablo_Souza

  • How to get the selected items from listbox

    Regarding listbox i have two questions
    1) I want to get the selected items as per the order in which ihave selected.Presently i'm getting in the ascending order.For example after selcting the 1,2,6 if i select 3 then its giving 1,2,3,6.But i want it in the order 1,2,6,3
    2)I want to select items from a single list box to many other listboxes.(ie) my first selection should goto first,second one to the second listbox and like this.How should i write the logic.
    please give me a suggestion.

    In order to have the selected items line up in accordance to the selection order, please do it one at a time. (That's the limit for that VI)
    If you need more than that (i.e. to regconize which item clicked first and which one comes later), you may have to figure it out ya
    Wish you good luck. Perhaps, someone else has a already made vi.
    Cheers!
    ian.f
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com

  • How to get selected items from a tree in backing bean without adfbc

    Hi ADF Experts,
    Below is my code for af:tree. My question is how can I get selected Items from the selectionListener (without adf bc) this uses formation of tree from backing bean.
    Using Jdev 11.1.1.7.0
    <af:tree var="node" value="#{pageFlowScope.MerchandizeBean.model}"
                      binding="#{pageFlowScope.MerchandizeBean.treeModel}"     id="tree" immediate="true" autoHeightRows="0"
                           styleClass="AFStretchWidth" rowSelection="multiple"
                           selectionListener="#{pageFlowScope.MerchandizeBean.treeNodeSelection}">
                    <f:facet name="nodeStamp">
                      <af:commandLink text="#{node.classDescription}"
                           actionListener="#{pageFlowScope.MerchandizeBean.createListManyItemForMerchandise}"           id="displayTable" partialSubmit="true">
                      </af:commandLink>
                    </f:facet>
                  </af:tree>
        public void treeNodeSelection(SelectionEvent selectionEvent) {
            // Add event code here...
            RichTree tree = (RichTree)selectionEvent.getSource();
                    TreeModel model = (TreeModel)tree.getValue();
                    //get selected value
    Thanks
    Roy

    Hi,
    in a multi select case, try
    RowKeySet rks = tree.getSelectedRowKeys();
    Iterator iter = rks.iterator();
    while(iterator.hasNext()){
    Object aKey = iterator.next();
    tree. setRowKey(aKey);
    Object rowData ? tree.getRowData();
      .... do something with the data here ...
    Frank

  • Error in transfer item from sub inventory to anther

    Hi all experts
    i have an error when i try to transfer item from sub inventory to anther in subinventory transfer form, and press lot/Serial button to but the lot number the system show this form error frm: 41051 You cannot create records here. 3 times, after that the system show the next form
    anyone can explain to me what is this error and how i fix it ??

    M.N.D wrote:
    Hi all experts
    i have an error when i try to transfer item from sub inventory to anther in subinventory transfer form, and press lot/Serial button to but the lot number the system show this form error frm: 41051 You cannot create records here. 3 times, after that the system show the next form
    anyone can explain to me what is this error and how i fix it ??Please see these docs.
    Error "FRM-41051: You cannot create records here" When Clicking the Lot/Serial button on Batch Material Transactions [ID 1385879.1]
    R12 Inventory Misc Receipt Lot/Serial Button Error Message You Cannot Create Records Here [ID 1457642.1]
    INVTTMTX - Misc Receipt - Lot/Serial button - FRM-41051: You Cannot Create Records Here [ID 1306767.1]
    Getting An Error During Lot Number Creation For Product In The Batch [ID 1365464.1]
    Thanks,
    Hussein

  • Removing selected items from listbox

    Hi ADF Experts,
    I have a selectmanylistbox with few values displaying in UI and a Remove Button at the bottom.
    User selects certain items from the listbox and clicks on Remove button. The selected items should be reomved. Can anybody suggest how to do this.
    Thanks,
    Animesh

    Duplicate of https://forums.oracle.com/thread/2562542
    User, please don't ask the same question multiple times. If you don't get the answer you want it may be because you did not give the right information and or use case me understand.
    Timo

  • Display selected item from Listbox

    hi,
    i get <h:selectOneListbox> value from database, now i want to know which item is selected in the listbox
    my JSP code is
    <h:selectOneListbox binding="#{DynamicListBean.std_list_lbx}" id="std_list_lbx" immediate="true"
                                onchange="common_timeoutSubmitForm(this.form, 'std_list_lbx');" required="true" size="5"
                                style="height: 312px; left: 168px; top: 192px; position: absolute; width: 216px" value="#{DynamicListBean.selectedCategory1}" valueChangeListener="#{DynamicListBean.std_list_lbx_processValueChange}">
                                <f:selectItems id="listbox1SelectItems1" value="#{DynamicListBean.items1}"/>
                            </h:selectOneListbox>Java code is public String getSelectedCategory1() {    
            return selectedCategory1;
        public void setSelectedCategory1(String selectedCategory1) {
            this.selectedCategory1 = selectedCategory1;
    public void std_list_lbx_processValueChange(ValueChangeEvent vce) {
            connection();
            int n1 = 0;
            String a = "";
            if (con != null) {
                try {
                    stmt = con.createStatement();
                    String query = "select std_id, std_name from std_detail";
                    rs = stmt.executeQuery(query);
                    String iddata = "";
                    if (rs != null) {
                        while (rs.next()) {
                            iddata = rs.getString("std_id");
                      //      System.out.println(rs.getInt("std_id"));
                            stmt1 = con.createStatement();
                            String query1 = "select chpt_detail from chapter_detail right outer join std_detail on chapter_detail.std_id = std_detail.std_id where chapter_detail.std_id = " + iddata + " ";
                            String data3 = "";
                            rs1 = stmt1.executeQuery(query1);
                            if (rs1 != null) {
                                while (rs1.next()) {
                                    data3 = rs1.getString("chpt_detail");
                                    chpt_lst_lbx.setValue(data3);
                                    dList2.add(data3);
                                stmt1.close();
                                rs1.close();
                                List selectItems = new ArrayList();
                                Iterator it = dList2.listIterator();
                                while (it.hasNext()) {
                                    String label = (String) it.next();
                                    chpt_lst_lbx.setValue(label);
                                    selectItems.add(new SelectItem(label));
                                items2 = (SelectItem[]) selectItems.toArray(new SelectItem[0]);
                        stmt.close();
                        rs.close();
                        con.close();
                } catch (Exception e) {
                    System.out.println("Sorry failed to display values from the database table. " + e.getMessage());
                    System.out.println(e);
        }any idea or suggestion tell me

    You usually use the property behind value="#{DynamicListBean.selectedCategory1}" for that. But in your case you'll need the vce.getNewValue() as the valueChangeListener is been invoked before the property is been set.
    Having said that, your code is terrible. Please read on about the DAO pattern. Further on, did you know that you can also just use List<SelectItem> instead of SelectItem[] as f:selectItems value?
    If you want to populate child menu's, you may find this article useful to avoid future and painful problems: [http://balusc.blogspot.com/2007/10/populate-child-menus.html].

  • How to create a report  based on selected item from Select list?

    Hi,
    I have created a tables_LOV based on:
    select table_name d, table_name r from user_tab_cols
    where column_name like '%_type%'
    Then I created a page item ListOfTables,  Display as select list and pointing to tables_LOV.
    I run the page, and i can select the table i want from the drop down list.
    How to create a report  based on the selected item? (ex: select * from selected_table)
    many thanks in advance
    Salah

    Hi Salah,
    Allright, have a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
    I think that simulates what you're trying to accomplish. I've set up the simplest method I could think of.
    The report is based on an apex collection. If you are not familiar with that, you should study the documentation: APEX_COLLECTION
    To recreate my example you should:
    1) create an (interactive) report on your collection
    SELECT *
       FROM APEX_collections
    WHERE collection_name = 'MY_COLLECTION'
    2) create a page_item select list for the tables you want to display (in my case this is called "P38_TABLES" )
    3) create a dynamic action that triggers on change of your select list page_item. The dynamic action must be a PL/SQL procedure perfoming the following code:
    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
    end;
    Make sure you add your page_item to the "Page Items to Submit" section.
    4) Add an extra true action that does a refresh of the report region.
    Here are two pictures describing the da:
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA1.png
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA2.png
    Good luck and regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • Using selected items from drop-down list in rest of page

    Hi,
    I hope I'm able to describe clearly what's the problem.
    So I'm implementing a form for the moment. It contains a drop-down list. The user has to select one item from it and as a result another drop-down list on the same page needs to be filled with a couple of options. I wanna do this without refreshing the page, cos else I have to retrieve all the values from boxes that were allready filled in. Is it possible?
    Greetings,
    Raf

    This cn be done with javascript. But you need to cache the data on first load of your jsp.
    regards

  • Javascript help to copy selected items from one list to another list on same site

    Hello,
    So I have a request that I am not sure how to handle. I have created a page with a list view webpart that displays all the items from one list.
    The user is then supposed to select off multiple list items and click on a button (most likely a ribbon button) that will take the selected items and copy them to another list on the same SharePoint site.
    I would like to do this with JavaScript, but have only found an example that copies library items to another library.

    Hi KansaiKel,
    According to your description, my understanding is that you want to copy selected list items to another list.
    I suggest you can use JavaScript Client Object Model to achieve it.
    Here is a code snippet for your reference:
    <script type="text/javascript">
    var context = SP.ClientContext.get_current();
    var siteUrl = 'http://sp2013sps/sites/test';
    var clientContext = new SP.ClientContext(siteUrl);
    var web = context.get_web();
    context.load(web);
    var sourceId = SP.ListOperation.Selection.getSelectedList();
    var source = web.get_lists().getById(sourceId);
    var oList = context.get_web().get_lists().getByTitle('Copy');
    context.load(oList);
    var selectedItems = SP.ListOperation.Selection.getSelectedItems(context);
    alert('debut');
    for(var i in selectedItems)
    var currentItem = source.getItemById(selectedItems[i].id);
    context.load(currentItem);
    context.executeQueryAsync(Function.createDelegate(this,test),Function.createDelegate(this,error));
    function test(sender, args){
    var itemCreateInfo = new SP.ListItemCreationInformation();
    var oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', currentItem.get_item('Title'));
    oListItem.update();
    oList.update();
    alert('done');
    function error(sender, args){ alert('error');}""
    </script>
    Here is a detailed article for your reference:
    Complete basic operations using JavaScript library code in SharePoint
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

  • Get Selected Items from ListBox

    Hi,
    How do I get the Selected items of a List in Flex.
    I am using a multi-select List.
    Thx

    Never mind..I got it.
    it as simple as that:
    Alert.show (lst.selectedItem.fieldname);
    ;)

  • Select items from a list

    Hi,
    in a backing bean (MyBean) which exposes a List of MyItem objects.
    I show this list in a report page using a dataTable.
    I associate a link "details" to each row and I want that selecting this link a detail page is shown, with all the data for the specific item selected.
    How can I do this ?
    Pietro

    ok! I've wrapped my item List in a ListDataModel obejct with very few changes to my code and set up detail method as:
    /** list bounded to the report page */
    private ListDataModel myList;
    /** detailed item */
    private MyItem myItem;
    /** action called from a single report page row */
    public String itemDetails(){
    this.myItem = (MyItem) myList.getRowData();
    // goes to the item details page
    return "details";
    and it works well.
    thanks!
    Pietro

  • How to only sync selected items from library

    *I am a new owner of a 120GB iPod classic. How do I sync only certain songs from the itunes I currently have ? I removed the check mark from the box and those songs still downloaded to the ipod. Not sure how to set itunes to only snyc those items selected. Any help is appreciated.*

    Hey there,
    One thing you want to check is to make sure you have your iPod set to only sync checked songs. To do this, plug your iPod in and when it appears in iTunes, on the Summary tab, you will see a section called "Options" below. You want to make sure you have a check mark next to "Sync only checked songs and videos" and then hit Apply and see if that helps.
    B-rock

  • How can I select items from Bridge for a web gallery in CS4

    I have installed the plug-in for Photoshop in order to create a web gallery. In the past, I have been able to choose items selected from Bridge, but now that function is greyed out and I can only choose a folder. Is there something I should download for Bridge in order to activate this option?

    Thats right, they have to go to:
    /Library/Application Support/Adobe/Startup Scripts CS4/Adobe Photoshop/
    Maybe you copied the files by mistake to the
    /Library/Application Support/Adobe/Startup Scripts CS4/Adobe Bridge/
    or maybe you copied to the Library folder in your Home directory (User) instead, as you mentioned, you had to make the directory your self.
    You could make a fast check by hitting  «Command+Shift+G» shortcut from your desktop and paste the first link from this reply, then you should see something like this:
    and if you can't recognize the structure above, you have located the problem.

  • Javascript needed - need checkbox to check automatically based on selected item from dropdown list

    I am building a fillable form.  In this form, I have created items in a dropdown list.  Based on the item picked from the dropdown list, I need a corresponding checkbox to be checked.  I am certain there is an easy javascript to resolve my current problem.  Please assist.
    For example: dropdown list field (SubSupplier1) -   Demolition                            export value 2
                                                                                    Rough Carpentry Labor       export value 4
                                                                                    Rough Carpentry Material    export value 3
    I need the corresponding checkbox (SalesTax1) to automatically be checked when Demolition (export value 2) or Rough Carpentry Material (export value 3) is selected.
    Thank you,
    Jennifer

    Hi Jennifer,
    This should help you do what you need. Place it in the Custom Calculation property of the dropbox and select "commit selected value immediately" in the fields options:
    var drop = this.getField("SubSupplier1");
    var check = this.getField("SalesTax1");
    if ((drop.value == 2) || (drop.value == 3)){
    check.checkThisBox(0,true);
    else {
    check.checkThisBox(0,false);
    The code is asking if the export value of the field is either '2' or '3' and if so, check the box.
    Otherwise uncheck the box.
    If you don't want it to uncheck on other selections, remove the 'else' section of code.

Maybe you are looking for

  • Embed webquery in PDF using Adobe LiveCycle Designer

    Dear BI Gurus,..Pls. help !!!! We have  NW2004s with Portal and ADS installed Is it currently possible to embed BW objects like query results and Documents into PDF, may  be using Adobe LiveCycle Designer to design a pixel-perfect layout? So for e.g.

  • SWFLoader issue

    Hi, When loading and external .swf file, I get the following error: URIError: Error #1052: Invalid URI passed to decodeURI function.     at global/decodeURI()     at mx.controls::SWFLoader/OSToPlayerURI()[E:\dev\4.0.0\frameworks\projects\framework\sr

  • Firefox and thunderbird integration

    I'm sure this has been posted before but we now have many newer users and it may well help their enjoyment.:) to open links in thunderbird with firefox edit /home/$username/.thunderbird/$randomnumbers.default/prefs.js in your favourite editor and add

  • Configurator -  free apps will not open

    I am in the process of setting up configurator for our 60 ipads. I downloaded free apps into iTunes account using an apple ID for that purpose. I then loaded the free apps into configurator. I created a VPP account and have successfully purchased mul

  • Ssis 2012 configuration package wizard is hanging

    Hi, I am trying to edit the dtsconfig package xml file in SSIS 2012 VS envoirnemnt and the wizard is hanging up for minutes until I need to close VS. Has anyone experienced this problem and what can be done to solve other than editing the XML file di