Connecting Tech Pros Worldwide Help | Site Map

Using Child Object to control parent

Newbie
 
Join Date: Oct 2007
Posts: 6
#1: Mar 8 '08
in Actionscript 3.0 Ive created a datagrid that populated with data. I want to create a pop up window to confirm whether the removal of an entry. When I call from the child object the following, I get an object undefined error. Is there anyone that can help me? I know its doing that because the datagrid object is not defined within the child but I thought using the this.parent.parent would help me solve that.

Also, I have another inquiry, the items I have on the datagrid are flv files loaded from an shared object file using a media server. FSO/RSO, that doesn't matter, but when I remove items using the following code the items reappear on the grid when i restart my application. Initially i thought it was because of the physical files themselves not being removed but that would not make sense and doing some research I found it could be to do with a command called delstream however I can't find sufficient information to help me in using it in my code.

Expand|Select|Wrap|Line Numbers
  1.  
  2. no_btn.addEventListener(MouseEvent.CLICK, closeWindow);
  3.  
  4. function closeWindow(event:MouseEvent):void
  5. {
  6.     this.parent.parent.removeChild(this.parent);
  7. }
  8.  
  9.  
  10.     yes_btn.addEventListener(MouseEvent.CLICK, remove);
  11.  
  12. function remove()
  13.     {
  14.  
  15.     this.parent.parent.myDataGrid.dataProvider.removeItemAt(myDataGrid. selectedIndex)(this.parent);
  16.     }
  17.  
  18.  
  19.  
  20.  
  21.  
Reply