Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-01-2006, 02:56 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default memory leakage problem

I am working on a project for database supported multmedia application, on Database Manage function I want user to know how much the job done!
so, in FFish I write message back to Flash Form, in turn
the Flash shows the ProgressBar on it's canvas.
Reply With Quote
  #2 (permalink)  
Old 12-01-2006, 03:05 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:memory leakage problem

the problem is that untile all the ADO operation finished,no message is really write back to Flash. the user may confused when the ADO operations on going.

so, I think its the executing sequence problem on all asynchronism environment, I need to add some waiting on the script.

I use try...throw...catch to invoke Delay, in the Delay function I've using Application.setInterval and clearInterval to apply delay.
Reply With Quote
  #3 (permalink)  
Old 12-01-2006, 03:12 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:memory leakage problem

the FFish script like that:
// delay function
var timer;

function delay(n,prg){
trace(" delay")
timer= Application.setInterval(postInfo,
n,prg);
}
//
// write the progress message back to Flash
//
function postInfo(prg,msg)
{
FlashPlayer.setVariable(dbFormPath+".TDB.fArg",inf o);
Application.clearInterval(timer);
eval(prg);
}
.
.
.
.
// 2 merge biz info
function mergeInfo(){
while(cur<cnt){
rs.addNew();
rs.Fields(0).value=rsx.Fields(0).value;
rs.Fields(1).value=rsx.Fields(1).value;
rs.Fields(2).value=rsx.Fields(2).value;
rs.Fields(3).value=rsx.Fields(3).value;
rs.Fields(4).value=rsx.Fields(4).value;
rs.Fields(5).value=rsx.Fields(5).value;
rs.Fields(6).value=rsx.Fields(6).value;
rsx.moveNext();
cur++
// invoke Dealy()
try{
var e = "merge biz info";
throw(e);
}
catch(e)
{
info = "merge biz info|"+cur+"|"+cnt+"|";
trace(" catched:"+info);
delay(50,"mergeInfo()");
return;
}
}
rsx.close();
rs.update();
prepareFlow();
mergeFlow();
}
Reply With Quote
  #4 (permalink)  
Old 12-01-2006, 03:22 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:memory leakage problem

in the Code:
function postInfo(prg,msg)
{
FlashPlayer.setVariable(dbFormPath+".TDB.fArg",inf o);
Application.clearInterval(timer);
eval(prg);
}

eval(prg) invokes recursive Function Call.
I wonder this call cause Memeory Leak.

the script worked properly! user's experience is wonderful!
but, when I use Window PorgramManager to inspect the Available Memory, it's seems Memeory Leak!

kindly you may give me some suggestion?

oh, my God! allMighty swfKit save me !

nice swfKiting! regards!
Reply With Quote
  #5 (permalink)  
Old 12-04-2006, 01:45 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:memory leakage problem

During the running of the while loop, the Flash Player will not have any chance to render the swf movie. That is to say, it will have no chance to update the progress bar. To resolve this problem, you can call the "processMsg" method in the while loop like this:
Code:
if (!processMsg()) break;
This method will let the Flash Player do rendering.

About the memory leak, could you please send us an .exe file? We will test it and fix the problem. Thank you.
Reply With Quote
  #6 (permalink)  
Old 12-04-2006, 11:55 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:memory leakage problem

Thank a lot for your relpay!
I checkd your manual, and the code piece
var i = 0;
while (1)
{
trace(i++);
if (!processMsg())
break;
}

I'll try it!
Reply With Quote
  #7 (permalink)  
Old 12-15-2006, 07:45 AM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:memory leakage problem

I've tried processMsg() to allow FlashPlayer.setVariable() send msg to the Flash Form,that in turn show the ProgressBar.
but this method can't help the situation.

Is there any thing like sleep() of other programming language in FFish? that's what really I want.

regard!
Reply With Quote
  #8 (permalink)  
Old 12-18-2006, 07:55 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:memory leakage problem

We recommend that you use the "ffish_asynrun" command and the "processMsg" method, like the following sample:

Reply With Quote
  #9 (permalink)  
Old 12-25-2006, 03:23 PM
Member
 
Join Date: Oct 2005
Posts: 87
Default Re:memory leakage problem

what's ffish_asynrun?
it's V3 command?
I'm still using V2.2
Reply With Quote
  #10 (permalink)  
Old 12-26-2006, 01:41 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:memory leakage problem

No, it's an old command.
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 03:59 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.