开发者

foregoing initialization on a page

Once you load an actionscript page from scratch (in my case loading XML data from a file, initializing various other elements in a fairly time consuming way) if you navigate away from that page and then return to it, (via the browser 'back' key for example) is their a way to forego the previous initialization and just immediately bring up the previous Actionscript page in its fully i开发者_StackOverflow社区nitialized state.


Flash Player will always start up your SWF file from scratch. In most cases, navigating back will load the SWF and things like XML files from the browser's cache, and you'll be up and running faster than if you were to go there the first time. However, you're responsible for adding logic to remember the most recent state and restore it when the SWF is loaded again.

If you're using Flex, the History Manager might be useful. For AS3 without a framework, you might check out SWFAddress instead. Both of those use the browser's URL and history features to track the application state, which can allow you to navigate through the SWF as if it contains "pages" and even bookmark specific locations in the SWF. Alternatively, or maybe even simultaneously, you might also consider using Flash Player's cookie-like flash.net.SharedObject functionality to remember the the state. You lose the more granular browser navigation, but you might be able to remember more about a specific single state.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜