Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. public function loadSavedProfile(path:String):void{
  2. var exists:File = new File(path);
  3. if (!exists.exists) {
  4. FlexGlobals.topLevelApplication.dispatchEvent(new BusinessLayerEvents(BusinessLayerEvents.LOAD_PROFILE_ERROR, false, false));
  5. }
  6. else {
  7. addEventListener(BusinessLayerEvents.INTERNAL_OPERATION_COMPLETED, function(event:BusinessLayerEvents):void
  8. {
  9. fstream.writeUTFBytes("finished refresh()\n");
  10. removeEventListener(BusinessLayerEvents.INTERNAL_OPERATION_COMPLETED, arguments.callee);
  11. _internal = true;
  12. _dbFilePath = path;
  13. _tempFile = File.createTempFile();
  14. _dbFile = new File();
  15. _dbFilePath = path;
  16. _dbFile.nativePath = _dbFilePath;
  17. _dbFile.addEventListener(Event.COMPLETE, function(e:Event):void
  18. {
  19. fstream.writeUTFBytes("Copying imported db to temp file complete\n");
  20. _dbFile.removeEventListener(Event.COMPLETE, arguments.callee);
  21. _conn.addEventListener(SQLEvent.CLOSE, handleLoadingProfileDBClosed);
  22. _conn.close();
  23. });
  24. _dbFile.copyToAsync(_tempFile, true);
  25. });
  26. refresh();
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement