开发者

Decrypting XML File with Actionscript 2.0, memory problem?

I have an encrypted XML file that needs to be decrypted and displayed in Flash. The Encrypted XML file contains over 33000 characters, Flash crashes when I try to decrypt it. Is there a limit to amount of 开发者_Go百科data that Flash can decrypt? I'm using rijndael to decrypt and Actionscript 2.0.


Your problem is caused by the non-existing multithreading capabilities in Flash: All calculations are supposed to happen "in-between frames", i.e. user algorithms should not take longer to execute than the interval at which the screen is refreshed. If your calculation takes too long to finish, the Flash player will first start to drop frames, and (unless you changed settings) after 15 seconds show the warning you described.

You can get around this by "spreading" your algorithm across multiple frames, making sure only part of the calculation is executed until the screen is refreshed. You can do so by simply splitting up your encrypted string into small enough parts and executing an enterFrame loop to decrypt one at a time, or by implementing something like Alex Harui's PseudoThread class (which essentially does the same, but comes with encapsulation and all that Jazz).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜