Flash SWF not initializing until visible - can I force them to initialize?

∥☆過路亽.° 提交于 2019-12-03 08:55:50
Jason

So...

After a lot of forum searching - I agree, there is no graceful way to do this haha! The solution I ended up going for was basically to make JS objects for each swf on $(document).ready()

Basically, the JS object would have various values, among them "data" and "isReady". When a swf became visible and would call the JS to say "im ready" I would simply catch that call, then find the JS object it was referring to (I managed to do this by passing the DOM id for each swf as one of its flashVars; yes it made me feel dirty). From there it was basically just a game to make sure that the each JS had "isReady" before I tried manipulating it.

The only bit of elegance in this whole mess was that by using JS objects, I could still apply new data to "hidden" swfs by simply updating the "data" property in their respective JS objects. Then, when a swf finally became visible, I would just update whatever data it had (ie, current data) and it worked pretty well but yeah, I still agree that this whole situation is unfortunate.

So... *answered.

I know this is probably a late answer.

But you need to change your wmode from opaque to wmode="window", that's why it's not working properly in firefox, IE doe the same thing, but only on the first page load.

Setting wmode to opaque causes firefox to not initialize the swf until it is viewed by the browser. However, this is not the same for all browers. IE only dose it on first page view, chrome and safari doesn't do it at all.

Unfortunately for me I found this question looking for the opposite. I'm attempting to make a player not initialize across ALL browsers until it is visible inside the browser.

i never really found a good way of forcing the load of the flash other than to reposition the elements after page init, forcing the load to start then hiding them again (cheap and nasty, but seems to work).

position all the flash elements towards the top left corner of the page (to make sure they are visible on page load) then use the pageLoad function in javascript to reposition the elements lower down the page as required. Jquery lets you do this all really quite easily with the addClass() and removeClass() functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!