我的 Flash 网站经常在刷新之前不会呈现
我们的客户端与 Rails 后端通信以获取登录详细信息,然后登录到 Adobe LCCS 服务器。我们一直在巡航,但昨天中午左右我们开发了一个错误,导致 swf 在刷新页面之前无法呈现。在后续刷新时,它会立即弹出。即使我禁用了与 Rails 服务器签入的代码,问题仍然发生。
刷新如何带来改变?
Our client communicates with a Rails backend to get login details and then logs into an Adobe LCCS server. We have been cruising right along but around noon yesterday we developed a bug that causes the swf to not render until you refresh the page. On subsequent refreshes it pops up right away. The problem happened even when I disabled the code that checks in with the Rails server.
How could refreshing make a difference?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您的用户访问您的页面,swf 在完全下载之前就开始播放,并且在到达最后加载的帧后停止并且不再继续播放 即使 swf 已加载完毕。
当用户刷新时,swf 已被缓存,并且他们会加载之前应该看到的版本。
解决此问题的一个简单方法是在第一帧上放置
stop()
操作,然后向主阶段的loaderInfo
添加一个Event.PROGRESS
监听器代码>对象。当事件bytesLoaded
与您的bytesTotal
匹配时,您的 swf 已完全加载,您可以在此时play()
您的 swf(或gotoAndPlay()
示例发生在项目的第一帧:
It sounds like your users visit your page and the swf starts playing before it's fully downloaded and stops once it hits the last loaded frame and doesn't continue to play even when the swf is done loading.
When the user refreshes, the swf has been cached and they load the version they should have been seeing before.
An easy way to fix this is to put a
stop()
action on the first frame and then add aEvent.PROGRESS
listener to the main stage'sloaderInfo
object. When the eventsbytesLoaded
match yourbytesTotal
then your swf is fully loaded and you canplay()
your swf at that point (orgotoAndPlay()
.Example takes place on the first frame of your project: