开发者

yield control to child SWF's

开发者 https://www.devze.com 2022-12-13 06:35 出处:网络
I have a function (call it funcX) that at certain time开发者_高级运维s is being called on the enterFrame event.At those times it is extremely computation intensive and is for example using 70% of the

I have a function (call it funcX) that at certain time开发者_高级运维s is being called on the enterFrame event. At those times it is extremely computation intensive and is for example using 70% of the available processing power of the computer or more.

Scroll events and other input events in the swf page are still being processed just fine. However, input events of child swf objects (i.e. those loaded by SWFLoader) are not being processed adequately while funcX is operating. So what can I call within funcX to yield time and precedence to whatever child SWF that needs it. callLater(funcX ...) in the enterFrame (or exitFrame) event of the parent SWF doesn't accomplish anything. I also don't want to slow down funcX if no child SWF has to process input events.


Unfortunately, there is no way to directly control this in Actionscript 3 – Here's a more authoritative resource on the subject. There are a couple of hacks you could try:

  • Before calling funcX, check with your child SWFs and make sure they don't need to process anything
  • split up your funcX function into several smaller functions if possible
  • consider optimizing your funcX function.

But really the bottom line is Actionscript 3 is not great for any sort of intensive computation.

0

精彩评论

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