Posted By

GunnarHKarlsson on 10/15/11


Tagged

view pop


Versions (?)

return data from a popped view


 / Published in: ActionScript 3
 

  1. //In view to be popped;
  2.  
  3. [Bindable]private var _returnObject:Object = new Object();
  4.  
  5. protected function onPhotoRemoved(event:FlickrResultEvent):void
  6. {
  7. if(event.success){
  8. currentState = "completeState";
  9. _returnObject.removedFromList = "removed";
  10. }else{
  11. currentState = "errorState";
  12. }
  13. }
  14.  
  15. override public function createReturnObject():Object
  16. {
  17.  
  18. return _returnObject;
  19. }
  20.  
  21. //in next view
  22.  
  23. //the view listens for the add event, which happens before creation complete:
  24.  
  25. private function onAdd():void{
  26. if(navigator.poppedViewReturnedObject){
  27. if(navigator.poppedViewReturnedObject.object.removedFromList == "removed"){
  28. _removedFromSet = true;
  29. _completeState = "completeStateNoHeader";
  30. }
  31. }
  32. }
  33.  
  34. //the poppedViewReturnObject is destroyed before you can access it inside a creationCompleteHandler:
  35.  
  36. if(data.setTitle && (_removedFromSet==false))_completeState = "completeStateHeader"

Report this snippet  

You need to login to post a comment.