开发者

anyone know how do i add a iframe inside the flash?

anyone know how do i add a iframe inside the flash?

the html is

<iframe width="100%" height="768" frameborder="no" scrolling="no" sr开发者_JAVA百科c="http://www.yoursite.com"> </iframe>


Short answer

Not possible unfortunately, figure out another way of doing what you want because the hacks aren't worth the trouble.

Slightly longer answer

There is a hack that involves creating an iframe in the HTML DOM and through the use of ExternalInterface within flash you manipulate the iframe. The iframe would have to go on top of the flash, which can be done by setting the embedded flash movie's wmode to opaque and then manipulating it's z-index. While on the surface this may seem like a decent enough technique, it comes with a whole slew of subsequent issues.

For instance, since the flash movie is underneith the iframe, you can't put anything on top of the iframe, like a dialog box or anything like that. Partial occlusion of the iframe is therefore not possible. Also, the performance of the flash movie is likely to suffer since it no longer has it's own window to render in but must be composited by the browser. I've heard figures like ~25% decrease in performance, but I've yet to see actual measurements and proper tests so please take that with a grain of salt.

There is another possibility which solves the partial occlusion issue, but is sure to create problems down the road. What you can do is set the wmode of the flash to transparent and have the iframe shown underneith the flash movie. Again, you'll have to manipulate it with JavaScript through ExternalInterface. This means you can partially occlude the iframe but you need to take care to actually make the flash movie transparent where it needs to be and furthermore, the flash movie needs to act as a proxy for any events that the iframe would have gotten previously, because it won't get any of those when occluded by flash. Thus, any clicks, key presses or such must be relayed to the iframe which is sure to cause a world of hurt.

I know it sucks and I wish that at least the HTML capabilities of AIR (ie, webkit) would find its way into flash but currently this is the best we've got and it ain't pretty.


No. It's not possible to put a browser frame inside Flash. You get some rich text capabilities, but far from a full HTML renderer.

You could have Flash communicate up to JavaScript in the embedding document and tell it to add the iframe to the HTML document, then position it on top of the Flash so that it looked like it was part of it. But that's about it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜