flash插入页面后在IE下stageWidth为0的bug
用SWFObject,将swf文件嵌入网页后,在IE浏览器中首次浏览正常,刷新后,stageWidth就为0了,swf中基于stageWidth定位的元素,就会错乱。
转自(ljhzzyx 2009-09-24 14:44:20)
首先区分一下stage的stageWidth和width属性。stage.stageWidth是flash player的宽度,stage.width是指stage里content的宽度,如果这个舞台(stage)里什么内容都没有,stage.width就是0。
现在的需求是在运行期获得舞台的高宽,以期编码实现将组件添加到舞台中央等这样的效果。但是我得到的stageWidth 和 stageHeight 都为0。
对于某个问题,老外的解释总是很详尽:http://hubflanger.com/stage-resize-and-the-stagewidth-and-stageheight-properties/
Turns out that when the stage is initialized, it's stageWidth and stageHeight properties are 0 until a Stage RESIZE event is triggered. This event is dispatched when the scaleMode property of the Stage object is set to StageScaleMode.NO_SCALE and the SWF file is resized ie. when the stage is rendered by the Flash Player. So if you need to add a display object onto the stage and its positioning is dependent on the stageWidth or stageHeight properties at runtime, it’s best handled by a listener that is subscribed to the Stage RESIZE event.
在IE中SWF文件的stageWidth 和 stageHeight 被初始化为0,再延迟一段时间后会更新成正确的数值。在SWF文件更新stageWidth 和 stageHeight属性时,会触发stage对象的resize事件。因此, 可以给stage添加resize事件处理器,将取得stageWidth 和 stageHeight值及后续工作放在resize处理函数里做,一旦stageWidth 和 stageHeight值大于0,则将此resize监听器取消掉。
Interestingly, despite universal claim that the Flash Player behaves exactly the same on all browsers, this problem only appears in a couple of browser/plugin configurations, namely FireFox/OSX and IE/Win. And strangely, on Safari and Firefox/Win, the RESIZE event is not even dispatched on page load, and neither does the Flash Player register the stageWidth and stageHeight properties as bein
相关文档:
这个箭头的小图案。
这个只是用于创作的小工具图形,这次增加了箭头,圆环,菱形,鱼儿等一些有趣的图案。
使用圆环的创作:
齿轮图案:
创作
使用菱形的创作
新增鱼儿:图案
Demo 在这里:
有兴趣进行创作的时候使用。
这些类库仅仅用于实验的时候进行创作。丰富一些As本身一些图案。 ......
本文来自http://blog.csdn.net/hellogv/ ,引用必须注明出处!
FLASH型的MSP430单片机都带有信息存储器SegmengA及SegmentB,SegmengA及SegmentB各有128字,SegmentB的地址是:0x01000h到0x107F,SegmentA的地址是:0x01080h到0x010FFh。程序被写入MSP430之后,程序通过SegmengA及SegmentB就可以保 ......
Flash中的XML对象也有方法可以将XML数据向服务器发送。即send和sendAndLoad。send方法向某个 URL 传递 XML 对象,返回的信息都被发送到另外一个浏览器窗口;sendAndLoad 方法向某个 URL 发送一个 XML 对象。返回的信息都放在一个XML对象中。
在某种程度上, XML的send方法和sendAndLoad方法类似于loadVars对象的send方法和 ......
1.打开
http://labs.adobe.com/downloads/flashplayer10_64bit.html
下载 Flash Player 10 for 64-bit Linux
2.解压后复制到/usr/lib64/mozilla/plugins
mv libflashplayer.so /usr/lib64/mozilla/plugins/libflashplayer.so
3.重启firefox,可以修改flash默认字体
vi /etc/fonts/conf.d/49-sansserif ......
flashbuilder中可以建立flex工程与actionscript工程.
flex工程内可以使用mxml是完成设计工作.
actionscript工程建立时默认只有:
playerglobal.swc
flex.swc
utilities.sec
playerglobal.swc
这几个类库.没有framework.swc,就无法使用Button等控件了.
解决方案是 actionscript工程中加入framework.swc.
路径是 x:/A ......