Jump to content


deleteSelection function bug [SOLVED]

Recommended Posts



I have a problem when using the function deleteSelection. When I use it with one item, everything is fine. But when I delete several item at the same time (multiple selection) it deletes only one item and throws an error (cannot access object of null reference).


So for instance we have 2 items:


On the first looping it deletes the first item. On the second looping,

 item = _selectedItems[i]

only points to null because _selectedItems is empty (while there were 2 items in it on the first looping)


Do you have any idea where that might come from ?

Thank you

Link to comment
Share on other sites

How can I reproduce this problem? I just double-checked and selected multiple items and pressed the DELETE key and it worked perfectly. No errors whatsoever. Maybe I didn't understand your description properly, though. Can you tell me exactly how to get the error? Feel free to post a simple FLA or Flex project that I can publish to see the problem (the simpler the better - no need to post production files).

Link to comment
Share on other sites

  • 2 weeks later...

Hello, I am very sorry for the delay. I was into my work and completely forgot I posted a message here.


The problem was coming from my code. The click off event is launched when deleting an item. I added an event listener that called the deselectAll() function, hence causing the bug described above.


Thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.