having a hidden swf
Is there a way to have a hidden swf ( flex application ) on a page and still have it be reachable from javascript and d开发者_如何学编程ebuggable from flash builder? I have need to use flash to manipulate js but it needs to be reachable from js to be started.
I don't know if you have some other meaning in mind when you say "hidden" (if so, please explain) but if you simply mean an invisible element on the page, then sure. Just set the width and height tiny in the embed tags, and don't put any graphics in the swf.
User ExternalInterface to communicate back and forth between JavaScript an a swf embedded on the page.
as below:
<div style="position:absolute;top:100px;left:0;width:1px;height:1px;z-index:1">
<embed pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1" height="1" flashvars="local=true&&refererdomain=yinyuetai.com" bgcolor="#FF0000" allowfullscreen="true" allowscriptaccess="always" wmode="window" id="" name="" src="flashlocalstorage.swf?rev">
</div>
the embed(in IE is:object) set: width:1px;height:1px
, and the parent element set: position:absolute;top:;left:;
.
It isn't complete disappear, but in common condition no one can find it.
精彩评论