|
|||
|
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. |
|
|||
|
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. |
|
|||
|
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(); } |
|
|||
|
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! |
|
|||
|
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; About the memory leak, could you please send us an .exe file? We will test it and fix the problem. Thank you. |
|
|||
|
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! |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|