[原] flex brightpoint gauge component
在网上看到一个更好的仪表盘控件 http://www.brightpointinc.com/FlexDemos/GaugeSample/srcview/index.html , 官网现在好现已经不能注册用户, 也不能下载最新的版本了。
我所找到有源代码的版本(上面的链接)Demo中没有缓效果, 显得很生硬。但是在代码中却有缓动效果相关代码, 是用mx.effects.sequence加入了5个mx.effects.Rotate来实现的, 但是没有打开. 我将useEffect置为true后,发现这些缓动效果代码有问题。
然后我就动手改造, 删除原有缓动效果代码. 改用一个基本的mx.effects.Rotate Tween, 实际证明也可以达到比较好缓动的效果.
Because I can not get the latest version with needle rotation tween effect. So I add the effect by myself.
Demo如下: 右键可以查看代码(you can view source by clicking mouse right button)
如果你看不到flash, 你就直接到 http://www.smithfox.com/myopensource/brightpoint/GaugeSample.swf
seven comments
I found every tween’s step (in this case, pointer rotation animation tween) will cause the DisplayObject parent’s updateDisplayList, it waste more resource.
After research, I give a solution, you can refer http://www.smithfox.com/?e=56 . I have added some English into the post.
Hi. Great work on the gauge but with flex 4.6 we can’t use import mx.controls.Image… Can you publish the source of GaugeSkins_Skin1.swf?
Thanks
Hi Ricardo,
Please check the url to download the gauge skin fla file: http://www.smithfox.com/images/2011-10/g..
Thanks for making this and blogging it. I needed something like this as a start. I’ve fixed bugs and adapted it for my needs: http://blog.betterthantomorrow.com/2011/..
There’s a demo of it in action here: http://dl.dropbox.com/u/3259215/gauge-de..
Source is on Github, links to the repository is available from both above links.