Archive for the ‘gadgets’ Category

Bcastr 4.0 Beta - flash image silde show 图片轮换播放 (开源 Open Source)

Posted on March 19th, 2008 in gadgets | No Comments »


This movie requires Flash Player 9


更多实例

更新

2008-06-09
  • 使用as3.0重写,效率有所提高
  • 增加了几种变换方式
  • 新参数和bcastr3.x不同,xml格式采用rss2.0的格式,可以直接读取rss中的图片(不能跨域)
  • 可以通过xml对播放器设置
  • 等多参数可以设置

下载

插入代码

直接写入参数
<object type=“application/x-shockwave-flash” data=“bcastr4.swf?xml=
                        <data>

                                <channel>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image1.jpg</image>
                                                <title>Bell Tower,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image2.jpg</image>
                                                <title>Greater Wild Goose Pagoda,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image3.jpg</image>
                                                <title>Terra Cotta Warriors,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image4.jpg</image>
                                                <title>The Forest of Steles ,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image5.jpg</image>
                                                <title>The Qian Tomb,Xi’an,China</title>
                                        </item>
                                </channel>
                        </data>
                "  width="650" height="500">
                <param name=”movie” value=”bcastr4.swf?xml=
                        <data>

                                <channel>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image1.jpg</image>
                                                <title>Bell Tower,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image2.jpg</image>
                                                <title>Greater Wild Goose Pagoda,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image3.jpg</image>
                                                <title>Terra Cotta Warriors,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image4.jpg</image>
                                                <title>The Forest of Steles ,Xi’an,China</title>
                                        </item>
                                        <item>
                                                <link>http://www.ruochi.com</link>
                                                <image>images/image5.jpg</image>
                                                <title>The Qian Tomb,Xi’an,China</title>
                                        </item>
                                </channel>
                        </data>" />
        </object>
使用xml传递参数
<object id=“bcastr4″ data=“bcastr4.swf?xml=http://bcastr.ruochi.com/v4/bcastr.xml” type=“application/x-shockwave-flash” width=“240″ height=“180″>
        <param name=“movie” value=“bcastr4.swf?xml=http://bcastr.ruochi.com/v4/bcastr.xml” />
</object>

参数说明

xml的可以设置的全部参数,以及默认的数值

<data>
        <channel>
                <item>
                        <link>http://www.ruochi.com</link>
                        <image>images/image1.jpg</image>
                        <title>Bell Tower,Xi’an,China</title>
                </item>
                <item>
                        <link>http://www.ruochi.com</link>
                        <image>images/image2.jpg</image>
                        <title>Greater Wild Goose Pagoda,Xi’an,China</title>
                </item>
                <item>
                        <link>http://www.ruochi.com</link>
                        <image>images/image3.jpg</image>
                        <title>Terra Cotta Warriors,Xi’an,China</title>
                </item>
                <item>
                        <link>http://www.ruochi.com</link>
                        <image>images/image4.jpg</image>
                        <title>The Forest of Steles ,Xi’an,China</title>
                </item>
                <item>
                        <link>http://www.ruochi.com</link>
                        <image>images/image5.jpg</image>
                        <title>The Qian Tomb,Xi’an,China</title>
                </item>
        </channel>
        <config>       
                <roundCorner>0</roundCorner>
                <autoPlayTime>8</autoPlayTime>
                <isHeightQuality>false</isHeightQuality>
                <blendMode>normal</blendMode>
                <transDuration>1</transDuration>
                <windowOpen>_self</windowOpen>
                <btnSetMargin>auto 5 5 auto</btnSetMargin>
                <btnDistance>20</btnDistance>
                <titleBgColor>0xff6600</titleBgColor>

                <titleBgAlpha>.75</titleBgAlpha>
                <titleMoveDuration>1</titleMoveDuration>
                <btnAlpha>.7</btnAlpha>  
                <btnDefaultColor>0xB3433</btnDefaultColor>
                <btnHoverColor>0xff9900</btnHoverColor>
                <btnFocusColor>0xff6600</btnFocusColor>
                <changImageMode>click</changImageMode>
                <isShowBtn>true</isShowBtn>
                <isShowTitle>true</isShowTitle>
                <scaleMode>noBorder</scaleMode>
                <transform>blur</transform>
                <isShowAbout>true</isShowAbout>
        </config>
</data>

以下用”.”描述xml树结构并说明参数作用

影片信息

channel.item

图片信息,可以设置多张图片

channel.itme.image

图片地址参数,此参数是唯一必须要有的参数,其他参数都有默认参数

channel.itme.link

对应图片的连接

channel.itme.tilte

对应图片的标题

设置

config.roundCorner

图片的圆角

config.autoPlayTime

图片切换时间,默认值是8,单位秒

config.isHeightQuality

图片缩小是否采用高质量的方法,默认值false

config.normal

图片的混合模式

config.transDuration

图片在切换过程中的时间,默认值1,单位秒

config.windowOpen

图片连接的打开方式,默认值”_blank”,在新窗口打开,也可以使用”_self”,使用本窗口打开

config.btnSetMargin

按钮的位置,文字的位置,用了css的margin概念,默认值”auto 5 5 auto”,四个数值代表 上 右 下 左 相对于播放器的距离,四个数值用空格分开,不需具体数值用”auto”填写 ,比如左上对齐并都有10像素的距离可以写 “10 auto auto 10″, 右下角对齐是”auto 10 10 auto”

config.btnDistance

每个按钮的距离,默认值20

config.titleBgColor

标题背景的颜色,默认0xff6600

config.titleTextColor

标题文字的颜色,默认0xffffff

config.titleBgAlpha

标题背景的透明度,默认0.75

config.titleFont

标题文字的字体,默认值”微软雅黑”

config.titleMoveDuration

标题背景动画的时间,默认值1,单位秒

config.btnAlpha

按钮的透明度,默认值0.7

config.btnTextColor

按钮文字的颜色,默认值0xffffff

config.btnDefaultColor

按钮的默认颜色,默认值0×1B3433

config.btnHoverColor

按钮的默认颜色,默认值0xff9900

config.btnFocusColor

按钮当前颜色,默认值0xff6600

config.changImageMode

切换图片的方法,默认值”click”,点击切换图片,还可以使用”hover”,鼠标悬停就切换图片

config.isShowBtn

是否显示按钮,默认值”true”

config.isShowTitle

是否显示标题,默认值”true”

config.scaleMode

图片放缩模式: 默认值是”noBorder”
“showAll”: 可以看到全部图片,保持比例,可能上下或者左右
“exactFil”: 放缩图片到舞台的尺寸,可能比例失调
“noScale”: 图片的原始尺寸,无放缩
“noBorder”: 图片充满播放器,保持比例,可能会被裁剪

config.transform

图片放缩模式: 默认值是”alpha”
“alpha”: 透明度淡入淡出
“blur”: 模糊淡入淡出
“left”: 左方图片滚动
“right”: 右方图片滚动
“top”: 上方图片滚动
“bottom”: 下方图片滚动
“breathe”: 有一点点地放缩的淡入淡出
“breatheBlur”: 有一点点地放缩的模糊淡入淡出,本页的例子就是这个

config.isShowAbout

是否显示关于信息,默认值”true”

意见和反馈

Vcastr 3.0 - flash video(flv) player (开源 Open Source)

Posted on March 19th, 2008 in gadgets | 1 Comment »

This movie requires Flash Player 9

特点

  • 使用as3.0重新写了播放器
  • 播放器大小缩小,在20+k左右
  • 可以通过xml对播放器设置
  • 可以播放多个影片,并且有影片列表
  • 可以设置循环播放,自动播放,是否直接开始下载,控制栏的颜色和模式
  • 控制栏可以适应超小的尺寸
  • 可以使用插件扩充播放器的功能
  • 可以用插件设置logo及连接
  • 可以用插件来用javascript控制播放器
  • 可以用插件来用设定播放器开始或者结束的图片或者flash(swf) beta

更新历史

下载

插入代码

直接写入参数
<object type=“application/x-shockwave-flash” data=“vcastr3.swf” width=“650″ height=“500″ id=“vcastr3″>
        <param name=“movie” value=“vcastr3.swf”/>
        <param name=“allowFullScreen” value=“true” />
        <param name=“FlashVars” value=“xml=
                <vcastr>

                        <channel>
                                <item>
                                        <source>http://vcastr.ruochi.com/video/happy_feet.flv</source>
                                        <duration></duration>
                                        <title></title>
                                </item>
                        </channel>
                        <config>
                        </config>
                        <plugIns>
                        </plugIns>
                </vcastr>"/>
</object>

如果你需要符合w3c的标准,可以用”{”"}”替换xml中的”<"">“,例子

使用xml传递参数
<object type=“application/x-shockwave-flash” data=“vcastr3.swf” width=“650″ height=“500″ id=“vcastr3″>
        <param name=“movie” value=“vcastr3.swf”/>
        <param name=“allowFullScreen” value=“true” />
        <param name=“FlashVars” value=“xml=vcastr.xml” />
</object>

参数说明

xml的可以设置的全部参数,以及默认的数值

<vcastr>
        <channel>
                <item>
                        <source>http://vcastr.ruochi.com/video/happy_feet.flv</source>
                        <duration></duration>
                        <title></title>
                </item>
                <item>
                        <source>http://vcastr.ruochi.com/video/happy_feet.flv</source>
                        <duration></duration>
                        <title></title>
                </item>
                <item>
                        <source>http://vcastr.ruochi.com/video/happy_feet.flv</source>
                        <duration></duration>
                        <title></title>
                </item>
        </channel>
        <config>
                <bufferTime>4</bufferTime>
                <contralPanelAlpha>0.75</contralPanelAlpha>
                <controlPanelBgColor>0xff6600</controlPanelBgColor>
                <controlPanelBtnColor>0xffffff</controlPanelBtnColor>
                <contralPanelBtnGlowColro>0xffff00</contralPanelBtnGlowColro>
                <controlPanelMode>float</controlPanelMode>
                <defautVolume>0.8</defautVolume>
                <isAutoPlay>true</isAutoPlay>
                <isLoadBegin>true</isLoadBegin>
                <isShowAbout>true</isShowAbout>
                <scaleMode>showAll</scaleMode>
        </config>
        <plugIns>
                <logoPlugIn>
                        <url>LogoPlugIn.swf</url>
                        <logoText>Ruochi.com</logoText>
                        <logoTextAlpha>0.75</logoTextAlpha>
                        <logoTextFontSize>24</logoTextFontSize>   
                        <logoTextColor>0xffffff</logoTextColor>
                        <textMargin>10 auto auto 10</textMargin>
                        <logoClipUrl>http://www.ruochigroup.com/images/logo.png</logoClipUrl>
                        <logoClipAlpha>1</logoClipAlpha>
                        <clipMargin>10 10 auto auto</clipMargin>
                </logoPlugIn>
                <beginEndImagePlugIn>
                        <url>beginEndImagePlugIn.swf</url>
                        <source>beginSwfTest.swf</source>
                        <type>begin</type>
                        <scaleType>exactFit</scaleType>
                </beginEndImagePlugIn>
                <javaScriptPlugIn>
                        <url>javaScriptPlugIn.swf</url>
                </javaScriptPlugIn>
        </plugIns>
</vcastr>

以下用”.”描述xml树结构并说明参数作用

影片信息

channel.item

影片信息,可以设置多个影片

channel.itme.source

flv影片地址参数,此参数是唯一必须要有的参数,其他参数都可以不要,播放器有默认参数

channel.itme.duration

对应影片的总时间, 单位是秒,由于有些影片在制作过程中时间信息丢失,可以通过这里来设置

channel.itme.tilte

对应影片的标题

channel.itme.link

对应影片点击后的链接

播放器设置

config.bufferTime

在缓存区影片的时间,单位是秒

config.contralPanelAlpha

控制栏的透明度,在 0 — 1 之间

config.controlPanelBgColor

控制栏背景的颜色

config.controlPanelBtnColor

控制按钮的颜色

config.contralPanelBtnGlowColro

控制按钮光晕的颜色

config.defautVolume

默认的声音大小,最大为1,最小为0

config.controlPanelMode

控制栏的显示模式,
“float”: 默认的浮动模式,鼠标移除播放器就会隐藏掉
“normal”: 正常模式,任何时候都在影片的下部浮动显示
“bottom”: 下部模式,不浮动在影片之上,而是显示在影片下方
“none”: 不显示播放器控制栏

config.isAutoPlay

是否影片自动开始播放,默认是true

config.isLoadBegin

是否一开始就读取影片,默认是true

config.isRepeat

是否循环播放影片,默然是false

config.isShowAbout

是否显示关于信息

config.scaleMode

影片放缩模式:
“showAll”: 可以看到全部影片,保持比例,可能上下或者左右
“exactFil”: 放缩影片到播放器的尺寸,可能比例失调
“noScale”: 影片的原始尺寸,无放缩
“noBorder”: 影片充满播放器,保持比例,可能会被裁剪

插件设置

plugIns 中每一个子节点代表一个插件,可以设置多个插件

plugIns.logoPlugIn,显示logo插件的参数设置

plugIns.logoPlugIn.url

插件的地址,可以使用绝对地址,也可以使用相对地址,绝对地址需要http://开始

plugIns.logoPlugIn.logoText

logo文字,注意之可以使用英文和英文标点,不支持中文,如果想放中文,就把中文做成文字png透明图片,用plugIns.logoPlugIn.logoClipUrl参数设置

plugIns.logoPlugIn.logoTextAlpha

文字的透明度

plugIns.logoPlugIn.logoTextLink

文字的连接

plugIns.logoPlugIn.logoTextFontSize

文字字体的大小

plugIns.logoPlugIn.logoTextColor

文字的颜色

plugIns.logoPlugIn.textMargin

文字的位置,用了css的margin概念,四个数值代表 上 右 下 左 相对于播放器的距离,四个数值用空格分开,不需具体数值用”auto”填写 ,比如左上对齐并都有10像素的距离可以写 “10 auto auto 10″, 右下角对齐是”auto 10 10 auto”

plugIns.logoPlugIn.logoClipUrl

图片logo的url,可以使用绝对地址,也可以使用相对地址,绝对地址需要http://开始

plugIns.logoPlugIn.logoClipAlpha

图片logo的透明度

plugIns.logoPlugIn.logoClipLink

图片logo的连接

plugIns.logoPlugIn.clipMargin

图片logo的位置,用了css的margin概念,四个数值代表 上 右 下 左 相对于播放器的距离,四个数值用空格分开,不需具体数值用”auto”填写 ,比如左上对齐并都有10像素的距离可以写 “10 auto auto 10″, 右下角对齐是”auto 10 10 auto”

plugIns.javaScriptPlugIn,javaScript控制插件的参数设置

plugIns.javaScriptPlugIn.url

插件的地址,可以使用绝对地址,也可以使用相对地址,绝对地址需要http://开始

javaScript插件

使用方法参看实例页面
http://vcastr.ruochi.com/v3/vcastr_javaScript_example.html

javaScript可以控制播放器 播放,暂停,停止,快进,快退,下一个,上一个,音量控制,影片跳转到需要的时间
在javaScript可以获得播放器的事件,有四个参数回来,分别是type:事件种类,state:当前状态, phayHeadTime:当前播放时间,loadPersent:下载百分比

事件 type有
stateChange,播放状态变化,播放或者暂停
complete,播放完毕
init,播放器初始化完毕
ready,影片下载了一部分,已经可以开始播放
playheadUpdate,每一秒即发一次
startBuffering,开始缓冲
stopBuffering,缓冲结束

状态 state
playing,播放中
paused,暂停中

beginEndImagePlugIn 影片开始和结尾需要加载外部资源(可以是图片或者swf)的插件

beginEndImagePlugIn.logoPlugIn.url

插件的地址,可以使用相对或者绝对地址,绝对地址需要http://开始

beginEndImagePlugIn.logoPlugIn.source

开始的图片或者swf的地址

beginEndImagePlugIn.logoPlugIn.type

显示方式,有3种显示方法,begin:在开始的显示,end:结尾部分显示,beginEnd:在开始和结尾部分同时显示

beginEndImagePlugIn.logoPlugIn.scaleType

“showAll”: 可以看到全部影片,保持比例,可能上下或者左右
“exactFil”: 放缩影片到播放器的尺寸,可能比例失调
“noScale”: 影片的原始尺寸,无放缩
“noBorder”: 影片充满播放器,保持比例,可能会被裁剪

意见和反馈

Swfoto 2.0 - flash image container (开源 Open Source)

Posted on March 19th, 2008 in gadgets | No Comments »

Swfoto 是一款flash(swf)读取图片的容器,可以用于各种网站网页中(开放源代码)

This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9
This movie requires Flash Player 9

2.0

  • 支持跨域读取图片(由于经过代理,跨域会速度稍慢), 已经取消由于大家都用了一个代理, 会造成用拥挤参考服务器端使用代理实现flash跨域读取数据
  • 可以设定图片圆角
  • 使用As3重新写代码,执行效率更高
  • 使用新的缩小算法,大幅缩小的图片更清晰
  • 可以设定是否淡入
  • 修正了参数中含有多个’&’出现的错误
  • 修改了部分的参数名称

1.0

  • 图片自动防缩大小,保持比例,不变形
  • 图片采用抗锯齿防缩方法,让图片放缩后依然清晰
  • 可以定义图片是否有连接
  • 方便网页布局,插入任何图片

下载

获取插入代码

<object type=“application/x-shockwave-flash” width=“100″ height=“100″ data=“http://www.xxx.com/swfoto2.swf?image=http://swfoto.ruochi.com/images/panda13.jpg&roundCorner=10″>
 <param name=“movie” value=“http://www.xxx.com/swfoto2.swf?image=http://swfoto.ruochi.com/images/panda13.jpg&roundCorner=10″ />
</object>

问题和反馈

参数文档

image

图片地址参数,如果参数中有”&”需要用,请用”^”替换”&”,默认http://swfoto.ruochi.com/images/girl.jpg

link

图片连接参数,不需要则不用设置

windowOpen

打开窗口:打开窗口:’_blank’表示新窗口打开。’_self’表示在当前窗口打开表示新窗口打开。’_self’表示在当前窗口打开,默认值’_blank’

isShowLoader

是否显示下载圆圈

loaderColor

下载圆圈颜色0xffffff

rouncCorner

图片圆角

isFadeIn

是否淡入