Posted By

TheRabbitFlash on 12/11/14


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

TheRabbitFlash


JSFL that save FLA's and call listener


 / Published in: ActionScript 3
 

determination of saving state

  1. var even_saved_id = fl.addEventListener('documentSaved', documentSaved);
  2.  
  3. function saveAllDocuments(){
  4. for ( var i = 0; i < fl.documents.length; i++){
  5. fl.setActiveWindow( fl.documents[i] );
  6. fl.documents[i].save(false);
  7. }
  8. }
  9. function documentSaved(){
  10.  
  11. alert ( fl.getDocumentDOM().name + " saved!");
  12. if ( fl.documents.length == 0 ) {
  13. var answer = confirm("You don't have opened documents. Remove JSFL Listeners for this session?");
  14. if ( answer ) {
  15. fl.removeEventListener('documentSaved', even_saved_id);
  16. alert('Listener removed');
  17. }
  18. }
  19. }

Report this snippet  

You need to login to post a comment.