Try this: ... <mx:Component> <mx:VBox> <mx:Script> <![CDATA[ import valueObjects.ShoppingCartItem ]]> </mx:Script> <mx:Button label="Remove" click="outerDocument.removeItem(valueObjects.ShoppingCartItem(data));" /> </mx:VBox> </mx:Component> ...
This gives the outerDocument method the visibility to the ShoppingCartItem component from within the VBox.