Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-11-2009, 06:45 PM
Junior Member
 
Join Date: Oct 2008
Posts: 9
Default Application freeze ?

Hello =)

I've got a little question.
Do you know if it is "normal" that when my app communicate with the externalInterface, it freezes ?

example when I run a shell or I upload on a ftp :

ftp.setEventHandler("onUpload", onupload);

private function onupload(percent){
sortie.text +=percent;
}

all works properly but during the upload, the application freeze, and the sortie.text is updated only when upload has finished...

is there any solution to that ?
Thank's a lot !! =)
Reply With Quote
  #2 (permalink)  
Old 02-16-2009, 07:44 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

Yes, because upload is running in block mode. You can try the following code
Code:
private function onupload(percent){
    if (!Global.processMsg()) return;
    sortie.text +=percent;
}
Reply With Quote
  #3 (permalink)  
Old 06-10-2009, 08:03 AM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default

I seem to have the same problem, while uploading the file the program freezes. The above code doesn't fix that.

Code:
uploadFile = function(){
	var f = "Alle files(*.*)|*.*|";
	var res = Dialogs.fileOpen(f, "", "", false);
	var inet = new Inet;
		
	if(res != false){
		f = new File(res);
			
		var ftp = inet.openFtp("ftp server", "port", "username", "password");
			
		ftp.connect();
		ftp.currentDir = "/kenney";
		
		ftp.setEventHandler("onUpload", onupload);
		
		ftp.onupload = function(percent){
			if (!Global.processMsg()) return;
			FlashPlayer.setVariable("percent", percent);
			FlashPlayer.setVariable("percent_show", percent + "%");
			return true;
		}
		
		ftp.upload(f.name, res);
		
		ftp.close();
	}
}
Reply With Quote
  #4 (permalink)  
Old 06-10-2009, 09:22 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

Does "ftp.setEventHandler("onUpload", ftp.onupload);" work?
Reply With Quote
  #5 (permalink)  
Old 06-11-2009, 12:41 PM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default

Quote:
Originally Posted by SWFKit View Post
Does "ftp.setEventHandler("onUpload", ftp.onupload);" work?
Nope, application still freezes until file is uploaded.
Reply With Quote
  #6 (permalink)  
Old 06-12-2009, 12:01 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

Is it actionscript or ffish script?

If the former, the code should be
Code:
ftp.setEventHandler("onUpload", ftp.onupload);
		
		ftp.onupload = function(_percent){
			if (!Global.processMsg()) return false;
			percent.text = _percent;
			percent_show.text  = _percent + "%";
			return true;
		}
otherwise the code should be
Code:
// ftp.setEventHandler("onUpload", onupload);
		
		ftp.onUpload = function(percent){
			if (!processMsg()) return false;
			FlashPlayer.setVariable("percent", percent);
			FlashPlayer.setVariable("percent_show", percent + "%");
			return true;
		}
Reply With Quote
  #7 (permalink)  
Old 06-12-2009, 01:26 PM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default

Yeah, it was supposed to show up in Flash. The last code worked Thanks!
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:36 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.