Flex:在播放过渡效果时做有用的事情
我们有一个 Flex 应用程序,其中有几个“页面”的内容。每次用户打开页面时,页面上的一些信息都需要刷新(只需不到一秒钟的时间)。我们当前显示“加载”动画。 我们的想法是用整个页面的某种过渡效果来替换它,并在过渡过程中加载背景中的内容。
是否可以?这是个好主意吗?有人可以分享有关该主题的好示例或文章的链接吗?
非常感谢
We have a Flex application which has several 'pages' worth of content. Each time a page is opened by the user some of the information on the page needs to be refreshed (takes less than a second to do so). We currently display a 'loading' animation.
The idea is to replace it with some kind of transition effect for the whole page and load the content in background while the transition is in progress.
Is it possible? Is it a good idea? Could someone share a link to a good example or article on the subject?
thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以对微调器使用类似于 this 的内容。不确定这是否是您问题的一部分。
否则,对于您的主页,您只需在加载时设置
myPage.visible=false
即可。获取FlexEvent.CREATION_COMPLETE
事件后,您可以将其设置回visible=true
。即使可见性为 false,includeInLayout
仍应为 true,这意味着组件将正确加载。为了使微调器更容易显示,您可能需要一个画布作为父级。将您的微调器附加到该画布上,您的真实页面将成为父级的子级。
You can use something like this for the spinner. Not sure if that's part of your problem or not.
Otherwise, for your main pages, all you need to do is set
myPage.visible=false
while you're loading it. Once you get theFlexEvent.CREATION_COMPLETE
event, you can set it back tovisible=true
. Even if visibility is false, theincludeInLayout
should still be true, which means the component will load correctly.To make the spinner easier to show, you might need a canvas as the parent. Attach your spinner to that canvas, and your real page will be a child of the parent.
听起来很有趣,但您可能会让某些用户比其他用户更快地加载内容。
为此,您可能需要同步两者(加载和转换),因此可能首先进行速度测试,一旦您知道 bytesTotal,您就可以使用它来估计转换的持续时间。如果您在 deosn 中添加的内容没有太多作用(它只是一个图像或静态的东西)并且没有任何需要初始化的内容,那应该没问题。
Sounds interesting, but you might have some users loading the content faster than others.
For this to work you might need to synch the two ( loading and the transition ), so maybe do a speed test initially and once you know bytesTotal you can use that to estimate the duration for your transition. If the content you add in deosn't do much ( it's just an image or something static ) and there isn't anything that needs to init, that should be ok-ish.