TileList Add/Remove function problems for a flex beginner

I am starting up a new project for my university course which will allow users to drag and drop icons into their own area.
I wanted to use a TileList to provide the buttons for the users to select their area i.e. when a user clicks on a button in the TileList their area will be shown then they can drag items into it from another area that will always be shown (these items will later act as links to websites effectively making this application an interactive favourites menu but I'm nowhere near that point yet).
The thing is I also wanted the user's to have the ability to add a new user or remove a selected user by clicking buttons to either add a new user or click a button that will delete a selected user however after searching the internet for code and using it in my application it's a little but messed up.
The problem is I have created an array of 5 profiles (slots for each user) but I only want each slot to be added once whereas at the moment I can remove buttons easily using the remove item button when a user button is selected but if i add a few profiles then delete one and add another sometimes there will be 2 instances of the same button added. I only want ONE of each profile button from the array to be viewable in the application at any one time. It's hard for me to explain this so heres my full code for the applicattion. I'm sure it just needs slightly tweaking but if someone could edit it for me it would be greatly appreciated as I'm totally stuck:-
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:components="components.*" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#545351, #E3DFDF]">
   <mx:Script>
      <![CDATA[
         import mx.managers.*;
           private var _dragManager:DragManager;
           private var _historyManager:HistoryManager;
           private var _popupManager:PopUpManager;
           import flash.net.navigateToURL;
           import flash.net.URLRequest;
           import flash.net.URLVariables; 
           import mx.events.ListEvent; 
           import mx.controls.Button;
            import mx.collections.*;
            import mx.controls.Alert;
      ]]>
   </mx:Script>
    <mx:Script>
        <![CDATA[
            import mx.effects.easing.Elastic;
            import mx.collections.ArrayCollection;
            [Bindable]
            private var myDP:ArrayCollection = new ArrayCollection(
            private var dpArr:Array = [{label: "New Profile 1", data:1},{label: "New Profile 2", data:2}, {label: "New Profile 3", data:3},{label: "New Profile 4", data:4}, {label: "New Profile 5", data:5}];
            private function deleteItem():void {
                // Remove item from Array Collection
                if(myDP.length > 0){
                    var toRemove:Array = [];
                for (var i:int = 0; i < tlist0.selectedItems.length; i++)
                    toRemove.push(tlist0.selectedItems);
                for (i = 0; i < toRemove.length; i++)
                    myDP.removeItemAt(myDP.getItemIndex(toRemove));
            private var zcount:int = 0;
            private function addItem():void {
                // Add item from source Array to Array Collection
                if(myDP.length < dpArr.length){
                    myDP.addItemAt(dpArr[myDP.length],myDP.length);
             private function tileList_itemClick(event:ListEvent):void {
            private function showAlert(event:ListEvent):void{
              Alert.show("You clicked button #"+event.currentTarget.selectedItem.data);
        ]]>
    </mx:Script>
    <mx:Sequence id="itemsChangeEffect1">
        <mx:Blur blurYTo="12" blurXTo="12" duration="300" perElementOffset="150" filter="removeItem"/>
        <mx:Parallel>
            <mx:Move duration="750" easingFunction="{Elastic.easeOut}" perElementOffset="20"/>
            <mx:RemoveItemAction startDelay="400" filter="removeItem"/>
            <mx:AddItemAction startDelay="400" filter="addItem"/>
            <mx:Blur startDelay="410" blurXFrom="18" blurYFrom="18" blurXTo="0" blurYTo="0" duration="300" filter="addItem"/>
        </mx:Parallel>
    </mx:Sequence>
   <mx:Canvas width="1168" height="716" backgroundColor="#0219FB" horizontalCenter="0" verticalCenter="0" borderColor="#000000" borderStyle="solid" borderThickness="1" cornerRadius="20"  backgroundAlpha="0.8">
      <mx:Canvas id="UserArea" left="10" x="0" y="49" width="670" height="594" backgroundColor="#000000" cornerRadius="20" borderStyle="solid">
           <mx:TileList id="tlist0" itemClick="{showAlert(event)}" itemRenderer="mx.controls.Button" top="10" left="10" right="10"  color="#FFFFFF" height="50" width="100%" fontSize="12" fontStyle="bold" columnCount="5" rowCount="2" direction="horizontal" dataProvider="{myDP}" itemsChangeEffect="{itemsChangeEffect1}" backgroundColor="#000000" fontWeight="bold" borderStyle="none"/>
           <mx:Canvas x="63" y="129" width="200" height="200" fontSize="36" borderColor="#FFFFFF" id="Canvas1" visible="false">
              <mx:Label x="27" y="25" text="Profile 1"/>
           </mx:Canvas>
      </mx:Canvas>
      <mx:Button label="Remove item" click="deleteItem();" color="0x323232" x="96" y="10"/>
      <mx:Button label="Add item" click="addItem();" color="0x323232" x="10" y="10"/>
   </mx:Canvas>
</mx:Application>

I've changed the code for the additem function to this but it only works to an extent now:-
private function addItem():void
// Add item from source Array to Array Collection
if (myDP.length < dpArr.length && !myDP.contains(dpArr[myDP.length])){
     myDP.addItemAt(dpArr[myDP.length],myDP.length);
It does only allow 1 of only the 5 profiles from the array to be added to the tilelist as I wanted but it appears that it is now impossible to add buttons anymore in certain situations.
For example if i run the application add all the profile buttons so all profile buttons are shown in the tile list and then remove profile buttons 2 3 and 4 and then click the add item button 3 times buttons 2 3 and 4 should be added however only 3 and 4 appear after profile 5 and 2 doesn't appear no matter how many times I click 'add item'.
What I want is for all 5 buttons from the array to be addable at any time but only one of each number should be shown. This may be to do with other code but I'm not sure.

Similar Messages

  • [svn:bz-trunk] 22381: Add some unit tests for the flex.messaging.client. FlexClientManager, including one for the new getFlexClient(String id, boolean createNewIfNotExist) method signature.

    Revision: 22381
    Revision: 22381
    Author:   [email protected]
    Date:     2011-09-02 05:10:41 -0700 (Fri, 02 Sep 2011)
    Log Message:
    Add some unit tests for the flex.messaging.client.FlexClientManager, including one for the new getFlexClient(String id, boolean createNewIfNotExist) method signature.
    Added Paths:
        blazeds/trunk/modules/core/test/src/flex/messaging/client/
        blazeds/trunk/modules/core/test/src/flex/messaging/client/FlexClientManagerTest.java

  • Remove function location for equipment with status ESTO

    hello all,
    i want to remove function location for a given equipment,
    this i am doing it by BAPI_EQUIP_DISMANTLE,
    how ever i am unable to delete the function location for the equipment whose status is ESTO
    now my question is how do i remove function location for the equipment whose status is ESTO
    thanks in advance..

    Another option is Tcode BS22.
    Go to the Status I0184
    Here Double Click on the SysSt to reach this screen. Here in Business Transaction PM03 change the Radio button from Forbidden to Allowed as shown here.
    Confirm process implication won't be there.
    Jogeswara Rao K

  • PA30, PA0008 add/remove one record for onw wage type

    in PA30 we can add wage type & amount for an employee. It creates entry in PA0008.
    How to add or remove a wage type through program ?
    screen is quite complex & with small table control, so BDC is not a good idea. Some ppl told me we can change record in PA0008. is it common practice to do it in HR ABAP ?
    Vivek

    Hello Vivek,
    First you should not modified the PA0008 tables directly using SQL stmt.
    please use the BAPI BAPI_BASICPAY_CHANGE to modify it.
    when you are using these BAPI or Tcode PA30 there are lots of validation is happening.
    And when you will modify it using SQL stmt it will create discrepancies into the Transaction data.
    If you have still query do revert.
    Regards,
    Chandrashekhar

  • How to Uninstall iTunes when not in Add/Remove

    How do you uninstall iTunes when it does not appear in Add/Remove programs. For the record, I have used the Window Install Clean-up Utility as described in another thread. Although iTunes appeared in the utilities' list, and seemed to process my request to uninstall (it disappeared from the list), all iTunes program files still remain on my computer, and the icon still appears on my desktop.
    Thanks - Jeff.

    I figured it out.

  • A strange problem for Find Value Function

    Hi, Dear
    I have a strange problem for search Function, my SRM_SERVER is 550 and Package is SAPKIBKT11.
    SRM_PLUS is SAPKIBK011.
    When I use Find Value Function to find Cost Ctr, Such as:
    Account object values = * (it is possible), Search Result: 300 Entries. I have no find my foucs data(12000)
    But
    Account object values = 12000, Search Result: 1 Entries,(Maximum No. of Hits is 500) I can find it. It is very jocularity.....Faint.
    Please help me.
    Thanks a lot.

    This is due to security permissions.
    You can do one thing, edit C:\Jdk1.3(your java home)\jre\lib\security\java.policy and add the following line,
    permission java.net.SocketPermission "*.*.*.109:1521-" "connect,resolve"; or
    permission java.net.SocketPermission "shenpeng:1521-" "connect,resolve";
    Save the file and run the applet from the command prompt. If this is not working, copy the java.policy file to C:\jdk1.3 (your java home) and execute the applet.
    Hope this helps.
    PS:- It is not recommended to access the database from applets.

  • Uninstall missing for adobe 9...not on add/remove programs

    I have 2 adobe readers now.  The desktop has adobe 9 and adobe x (inside says 10.1.1).  Downloaded newest a while ago.  I think I thought it would automatically uninstall 9, but I may have uninstalled it but is still there, because there isnot a line in add/remove list.  There is a line for the reader x (10.1.1)

    Is it really still installed, or is it just a non-functioning desktop shortcut?
    If it is still installed (without an uninstaller), then you can use the Windows Installer Cleanup Utility to remove the application.

  • Anyway to "UN" Ken Burns stills globally or as default bringing in jpeg's?  New to iMovie. I have 3 titles that build.  First is logo, add prod't name second line, add date 3rd line.  They shift when dissolving between them. Title function NG for this.

    Anyway to "UN" Ken Burns stills globally or as default bringing in jpeg's?  New to iMovie. I have 3 titles that build.  First is logo, add prod't name second line, add date 3rd line.  They shift when dissolving between them. Title function NG for this.
    The people at the Apple store gave me a long, tedious workaround which is open Pages and bring in logo.  Export it as a PDF.  Open the PDF in Review and then "Save As" a jpg to the desktop and drag and drop into the imovie.  Even with this process, the text will sometimes shift.  When it works, it looks good, the logo comes up, then the second line fades in under it as part of the build and then the third line completes the graphic.  It would something this easy and straight forward would be easy. 
    HarveyV

    I did the work around for the titles/jpg's in this short video. 
    I'll try your fix on the next one.  I have 22 short 3-5 minute videos to produce
    and I'm on number 5.  This should save me a bunch of time. 
    It would appear that you know more than the guy at the Apple Store. 
    Thank goodness for on-line forums.
    I already tried fixing them individually as you suggested,
      by going the crop/fit route.  However, even then,
      the second in the series had always shifted. 
    The first and the third images lined up, but not number 2.. 
    So  I brought in all the images, (1, 2 and 3).  
    and then the 2nd image again and put it in the third position
    in the sequence on the time line. I deleted the "original" 2nd image.
    So I had 1, 3, then 2.  Then I dragged and dropped the correct number two
    into position two and it worked.  So what happens is that the
    client logo appears, then that stays put and the next line dissolves in
      and then the third dissolves in.  They are three separate titles, but they
    are aligned perfectly so that they build as I dissolve between them.
    I think the problem with the edit copy route would be that while
    I could edit/copy the logo, I couldn't position text through the
    iMovie text function exactly as it only gives you middle or bottom third etc.
      Each title with the product name is positioned individually depending on
    length and number of lines. By going through Pages, I can position the logo
    and the text exactly.  Also, some logos are horizontal, while others
    are square etc., so text positioning is crucial.Anyhow,
    I'll try the global approach for the next one and see how that works.
      Thanks very much for your insight and especially for your prompt reply.
    I trust you're inside on this gorgeous July 4th because you're
    making money on your computer. ;-)HarveyVOn 7/4/2011 3:57 PM, Apple Support Communities Updates wrote:
    > Apple Support Communities <https://discussions.apple.com/index.jspa>>>>       Re: Anyway to "UN" Ken Burns stills globally or as default>       bringing in jpeg's? New to iMovie. I have 3 titles that build.>       First is logo, add prod't name second line, add date 3rd line.>       They shift when dissolving between them. Title function NG for...>> created by AppleMan1958 > <https://discussions.apple.com/people/AppleMan1958> in /iMovie/ - View > the full discussion > <https://discussions.apple.com/message/15552380#15552380>> ------------------------------------------------------------------------>> I am baffled by what you are asking...but if you are asking how to > turn off the Ken Burns effect, you can do it for future photos you add > by going to File/Project Preferences and setting the default initial > photo placement to FIT or CROP rather than Ken Burns.>> For a global change on photos that are already in your project, pick a > photo. Open the Rotate, Crop, Ken Burns Tool. Select FIT or CROP.  > Exit the tool. Now select this same photo and EDIT/COPY.>> Now, EDIT/SELECT ALL.>> Finally, EDIT/PASTE ADJUSTMENTS.../CROP ADJUSTMENTS.

  • I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage - I´d like to add an EMail account on top to my mobile number. My password will not be accepted!!!???

    I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage -
    I´d like to add an EMail account on top to my mobile number to use more this services. My password will not be accepted!!!??? I try it and i try it and i try ist, throughout the same problem. Whats on? The user help desk said, i´ve to reset and use the WLAN key new as well as possible - no way!

    Contact the App store for Apple ID help. Their support link is on the right of the App store window
    LN

  • Windows App Certification Kit - Test Fails for Validate Desktop App at "Write appropriate Add/Remove Program values"

    Hi,
    I am trying to validate a .Net Framework 4 WinForms application for use in the Microsoft Partner Network portal.
    I am using Windows App Certification Kit 3.4 for Windows 8.1 , and the Validate Desktop App option.
    To build the package I am using InstallShield 2012 SPR Limited Edition (for Visual Studio), and the validation fails
    only with the following error (please also see the attached image):
    Clean reversible install test: Failed to Write appropriate Add/Remove Program values
    Error Found: The registry population test detected the following error: app didn't create the required registry entries.
    A non-optional value 'DisplayName' is missing or invalid (same for 'Publisher', 'ProductVersion')
    Please note that I have filled in all the publisher/product details in the InstallShield project, on the General Information page.
    Also I have tried to use the Microsoft Visual Studio Installer Project for VS2013, and the validation failed with the exact same error.
    (https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d)
    Any help would be very appreciated.
    Thank you.

    You may need to add the necessary info to the app’s Windows Installer package so it can configure Add/Remove Programs in Control Panel correctly. Setting these properties automatically writes the corresponding values into the registry. From the picture,
    you are missing some necessary information about your desktop app.
    Also You need the correct admin permissions to write to the registry.
    Please refer to this thread:
    http://stackoverflow.com/questions/21182856/windows-app-certification-kit-test-result-app-didnt-create-the-require-regist
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Has anyone had a problem with TapMedia File Manage on iPhone 5. I reported a WIFI functionality problem to the developer and asked for support. Instead they have been very unprofessional by name calling me instead of logically evaluate and troubleshoot th

    Has anyone had a problem with TapMedia File Manage installed on iPhone 5? I reported a WIFI functionality problem to the developer and asked for support. Instead the company has been very unprofessional by name calling me instead of logically evaluate and troubleshoot the problem

    Hi AKE1919,
    Welcome to the Support Communities!
    The following information should help you with this:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/HT1933?viewlocale=en_US
    Cheers,
    Judy

  • I was told I need to remove the enterprise server account I have and need to add a new one for work but the IT person did not tell me how to do this.  Can anyone help?

    I was told I need to remove the enterprise server account I have and need to add a new one for work but the IT person did not tell me how to do this.  Can anyone help?

        Jennymbell, never fear help is here!
    Have you tried contacting your IT department for assistance? You can visit http://bit.ly/QECbGh for steps on how to enterprise activation.
    Keep me posted if you need further assistance.
    John B
    Follow us on Twitter @VZWSupport

  • While in Add/Remove Prog. in computer, I found apps named: iPOD for Windows 2006-03-23 (138 Mb) and another 2005-09-23 (106 Mb).  I'm trying trying to free up computer HD space.  What are these and can I delete either?

    While in Add/Remove Prog. in computer, I found apps named: iPOD for Windows 2006-03-23 (138 Mb) and another 2005-09-23 (106 Mb).  I'm trying trying to free up computer HD space.  What are these and can I delete either?

    Those are outdated iPod software updaters which can be safely deleted.
    (58627)

  • OIM: Trigger for add/remove Role?

    Is there any out of the box way to attach a trigger/event handler to a target resource Process Definition such that code can be executed when an OIM Role is added/removed from the parent OIM User record?
    I've gotten as far as the following:
    I can hook into the "Add/Remove Role" event via event handlers
    From the event handlers in #1 above, I can add process tasks such as "OIM Role Added", "OIM Role Removed" to the user's resources using the OIM API addProcessTaskInstance method.
    The issue is I need to know which Role was added/removed in the process tasks and there does not seem to be a way to pass any data dynamically into the task when it's created.  I thought about storing the added/removed Role in a UDF; however, this doesn't scale well when multiple Roles are being added/removed.
    Is there a better way to do this?
    Thanks.

    You can refer to Doc ID 1461252.1 for sample code.
    ~J

  • SCCM 2012 Report for Software registered in Add/Remove programs

    Hi
    Am looking to create an SCCM 2012 Report for Software registered in Add/Remove programs on windows 7 machines but dont have enough experience with report builder to do this.
    Was hoping someone could help.

    When i use the url i still only see the following categories
    Administrative Security
    Asset Intelligence
    Client Push
    Client Status
    Compliance and Settings ManagementHave looked through them all and that one is not there
    the only software ones are the following
    Report Software 01A - Summary of installed software in a specific collectionThis report provides a summary of installed software ordered by the number of instances found from inventory.
     Open Menu
    Report Software 02A - Product families for a specific collectionThis report lists the product families and the count of software in the family for a specific collection.
     Open Menu
    Report Software 02B - Product categories for a specific product familyThis report lists the product categories in a specific product family and the count of software within the category. This report is linked to Software 02C - Software in a specific product
    family and category.
     Open Menu
    Report Software 02C - Software in a specific product family and categoryThis report lists all software that is in the specified product family and category. This report is linked to Software 06B - Software by product name.
     Open Menu
    Report Software 02D - Computers with specific software installedThis report lists all computers with specific software installed. This report is linked to Software 02E - Installed software on a specific computer .
     Open Menu
    Report Software 02E - Installed software on a specific computerThis report lists all software installed on a specific computer.
     Open Menu
    Report Software 03A - Uncategorized softwareThis report lists the software that is either categorized as unknown or has no categorization.
     Open Menu
    Report Software 04A - Software configured to automatically run on computersDisplays a list of software configured to automatically run on computers.
     Open Menu
    Report Software 04B - Computers with specific software configured to automatically runDisplays all computers with specific software configured to automatically run.
     Open Menu
    Report Software 04C - Software configured to automatically run on a specific computerDisplays installed software configured to automatically run on a specific computer.
     Open Menu
    Report Software 05A - Browser Helper ObjectsThis report displays the Browser Helper Objects installed on computers in a specific collection.
     Open Menu
    Report Software 05B - Computers with a specific Browser Helper ObjectDisplays all of the computers with a specific Browser Helper Object.
     Open Menu
    Report Software 05C - Browser Helper Objects on a specific computerDisplays all Browser Helper Objects on the specific computer.
     Open Menu
    Report Software 06A - Search for installed softwareThis report provides a summary of installed software ordered by the number of instances based on search criteria for the product name, publisher, or version.
     Open Menu
    Report Software 06B - Software by product nameThis report provides a summary of installed software ordered by the number of instances based on selected Product Name.
     Open Menu
    Report Software 07A - Recently used executable programs by the count of computersThis report displays executable programs that have been used recently with a count of computers on which they have been used. The Software Metering client must be enabled for this
    site to view this report.
     Open Menu
    Report Software 07B - Computers that recently used a specified executable programThis report displays the computers on which a specified executable program has recently been used when you enable the software metering client setting.
     Open Menu
    Report Software 07C - Recently used executable programs on a specified computerThis report displays executables that have been used recently on a specified computer when you enable the software metering client setting.
     Open Menu
    Report Software 08A - Recently used executable programs by the count of usersThis report displays executable programs that have been used recently with a count of users that have most recently used them when you enable the software metering client setting.
     Open Menu
    Report Software 08B - Users that recently used a specified executable programThis report displays the users that have most recently used a specified executable program when you enable the software metering client setting.
     Open Menu
    Report Software 08C - Recently used executable programs by a specified userThis report displays executable programs that have been used recently by a specified user when you enable the software metering client setting.
     Open Menu
    Report Software 09A - Infrequently used softwareThis report displays software titles that have not been used during a specified period of time. You can specify a value that will represent the number of days that have elapsed since the last use (e.g. if you
    enter 90 days, you will see software that was not used in the past 90 days or more). You can also leave the Days not used field empty to see all software titles that were never used.
     Open Menu
    Report Software 09B - Computers with infrequently used software installedThis report displays computers which have software installed that has not been used for a specified period of time. The specified period of time is based on the value specified in the
    'Software 09A - Infrequently used software' report.
     Open Menu
    Report Software 10A - Software titles with specific multiple custom labels definedThis report allows you to view software titles based on matching of all selected custom label criteria. Up to three custom labels can be selected to refine a software title search.
     Open Menu
    Report Software 10B - Computers with a specific custom-labeled software title installedThis report shows all computers in this collection, that have the specified custom-labeled software title installed.
     Open Menu
    Report Software 11A - Software titles with a specific custom label definedThis report allows you to view software titles based on matching of at least one of the selected custom label criteria.
     Open Menu
    Report Software 12A - Software titles without a custom labelThis report displays all software titles that do not have a custom label defined.
     Open Menu
    Report Software 14A - Search for software identification tag enabled softwareThis report provides the count of installed software with a software identification tag enabled.
     Open Menu
    Report Software 14B - Computers with specific software identification tag enabled software installedThis report lists all computers that have installed software with a specific software identification tag enabled.
     Open Menu
    Report Software 14C - Installed software identification tag enabled software on a specific computerThis report lists all installed software with a specific software identification tag enabled on a specific computer.
     Open Menu

Maybe you are looking for

  • Unsupported major.minor version  exception in 10g IAS

    I have developed a simple web-app based on JSF/MyFaces. In it I have included a managed bean. Upon deploying and running this web-app to Oracle 10g AS I get the following exception: javax.faces.FacesException: uk/ac/ukbiobank/crms/infobean (Unsupport

  • GL master data - display translation in GL account list report

    Hello all. I would like to produce a report that shows the Spanish translations we've assigned to GL accounts in the Translation section of master data. However, I can't see where I can define the language "ES" in any of the standard reports criteria

  • Identifying the blocking Lock

    In one of our production DB we are experiencing huge bottlenecks due to locks. I am using OEM lock monitor to detect and identify the problematic lock. I am trying this out randomly as OEM list all the blocking locks. . Most times I am not able to an

  • Full screen mode and the tab key: how to ignore invisible UI elements

    Hi there, When Mozilla is in windowed mode, the tab key moves between the page content, which is great. However, when it reaches the end of the page, it then goes to the tab bar, the address bar, the search bar, something I can't figure out, and only

  • ----   Grups in OCS -----

    I've made integration between OID as AD, and all users, groups are stored in CN=Users,DC=Domain,DC=com,DC=pl In OIDAS I set Search Base to "cn=Groups, dc=prolan,dc=com,dc=pl cn=Users,dc=prolan,dc=com,dc=pl" in order to OCS could see my groups from AD