“Example”目录存档

Silverlight2.0功能展示Demo源码

2009年02月26日,星期四

下载地址 – http://down.chinaz.com/soft/24991.htm

1、Silverlight(3) – 2.0控件之Border, Button, Calendar, Canvas, CheckBox, ComboBox
2、Silverlight(4) – 2.0控件之DataGrid, DatePicker, Grid, GridSplitter, HyperlinkButton, Image
3、Silverlight(5) – 2.0控件之ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton
4、Silverlight(6) – 2.0控件之ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton
5、Silverlight(7) – 2.0图形之Ellipse, Line, Path, Polygon, Polyline, Rectangle
6、Silverlight(8) – 2.0图形之基类System.Windows.Shapes.Shape
7、Silverlight(9) – 2.0画笔之SolidColorBrush, ImageBrush, VideoBrush, LinearGradientBrush, RadialGradientBrush
8、Silverlight(10) – 2.0其它之Transform详解,以及UIElement和FrameworkElement的常用属性
9、Silverlight(11) – 2.0动画之ColorAnimation, DoubleAnimation, PointAnimation, 内插关键帧动画
10、Silverlight(12) – 2.0外观之样式, 模板, 视觉状态和视觉状态管理器
11、Silverlight(13) – 2.0交互之鼠标事件和键盘事件
12、Silverlight(14) – 2.0交互之InkPresenter(涂鸦板)
13、Silverlight(15) – 2.0数据之一次绑定, 单向绑定, 双向绑定, INotifyPropertyChanged, 数据转换, 数据验证
14、Silverlight(16) – 2.0数据之独立存储(Isolated Storage)
15、Silverlight(17) – 2.0数据之详解DataGrid, 详解ListBox
16、Silverlight(18) – 2.0视频之详解MediaElement, 开发一个简易版的全功能播放器
17、Silverlight(19) – 2.0通信之调用REST服务,处理JSON格式, XML格式, RSS/ATOM格式的数据
18、Silverlight(20) – 2.0通信之WebClient, 以字符串的形式上传/下载数据, 以流的方式上传/下载数据
19、Silverlight(21) – 2.0通信之WebRequest和WebResponse, 对指定的URI发出请求以及接收响应
20、Silverlight(22) – 2.0通信之调用WCF服务, 对传输信息做加密
21、Silverlight(23) – 2.0通信之调用WCF的双向通信(Duplex Service)
22、Silverlight(24) – 2.0通信之Socket, 开发一个多人聊天室
23、Silverlight(25) – 2.0线程之Thread, Timer, BackgroundWorker, ThreadPool
24、Silverlight(26) – 2.0线程之Lock, Interlocked, EventWaitHandle, Monitor, ThreadStaticAttribute
25、Silverlight(27) – 2.0网页之可脚本化, 与DOM的交互, 与JavaScript的交互

All in One – Cairngorm Store Example (ColdFusion, AMFPHP, AMFPHP 1.9, and WebServices)

2007年08月29日,星期三

I have updated the Cairngorm Store multiple backend example. Along with the updated source code I have deploy a live running example. The 4 backends it supports now is ColdFusion Remoting AMF3, AMFPHP AMF0 using the RemoteObjectAMF0 class, AMFPHP 1.9 AMF3, and ColdFusion WebServices.

See it live here!

Get the source here!

To change the backend of the Cairngorm Store example just select the backend you want from ComboBox and then click on the Refresh Data button. I had to do write some exception code to convert the returned XML data into the ArrayCollection to conform all the backend but besides that it was really easy to integrate all of them into the Services.mxml.

PS: I just installed a new license on the ColdFusion server with a new Apache web server configuration so let me know if there are any issues.

Flex/AS3 and FMS getting id3 info from mp3’s

2007年08月29日,星期三

There was a question on the FlashMedia mailing list about how to get id3 info from a NetStream with AS3 code. It is actually just like AS2 with some quirks to watch out for. The first is the supported ID3 tags:

About supported versions of ID3 tags

Flash Media Server supports playback of ID3 text tags in UTF-8, UTF-16, and ISO-8859-1 formats and supports ID3 versions 1.0, 2.3, and 2.4. Only tags that contain text data are supported, such as song title, artist name, comments, and year recorded.

I had a mp3 with ID3 v2.2 tags that did not work until I put in a v1.0 ID3 tag.

The next is the NetStream is not dynamic in AS3 and you use the client property to handle method calls from the server. There will be a onPlayerStatus and onId3 method call the server makes on the NetStream object.

Here is the running example and source code is available through the right click.

Flex 2 Namespacing Methods and Properties Example

2007年08月29日,星期三

I came across the Namespace class while looking up some information about ActionScript 3.0’s E4X and XML. I didn’t know, will lets say, I didn’t make the connection between the Namespace class and using it with methods and properties of components. This example is very basic and is not meant to be a good use of namespaces. It shows how to use it for methods and properties.

In the example there is one method name and one property name to change a button from being rounded or square looking and being filled with red or blue colors.

Live Example Here

You can right click on the swf to view the source.

Cairngorm Store Example Updated to Cairngorm 2.1

2007年08月29日,星期三

I went ahead and updated the Cairngorm Store example to Cairngorm 2.1. You can find the original example code download on http://www.cairngormdocs.org/.

Get the updated code here.

Here is my short list of changes:

  1. Changed com.adobe.cairngorm.business.Responder to mx.rpc.IResponder
  2. Changed com.adobe.cairngorm.commands.Command to com.adobe.cairngorm.commands.ICommand
  3. Changed com.adobe.cairngorm.vo.ValueObject to com.adobe.cairngorm.vo.IValueObject
  4. Deleted result and fault handlers on RemoteObjects components in the Services.mxml file.
  5. Used Call.addResponder( responder ) instead of resultHandler and faultHandler
  6. Changed onResult/onFault to result/fault
  7. Changed getService to getRemoteObject

Along with this update I have been updating the RemoteObjectAMF0 and got it working with the Cairngorm Store example. I’ll package the changes and PHP example up as a separate download, get more details in a future post.

Keynote Apollo Examples

2007年08月29日,星期三

I have been interested in the Apollo project since was announced. Today at the keynote session I saw for the first time what they mean when they SWF, HTML, DHTML and PDF will worknciely togather. One example they showed demonstrated drag and drop events between Flex and Google maps (DHTML) mini-app all wrapped in Apollo. Apollo is bigger and quite different then my original opinion of comparing it with Zinc by mdm.

Flex 2 and Red 5 Chat Live Example

2007年08月29日,星期三

I did not put a working example of the Basic Chat example using Flex 2 and Red 5 up on my server early. I needed to install Red 5 to be able to put it up. I wasn’t sure when I was going to be able to get to it so I posted the code first. I had some free time this morning and decided to give the Red 5 server install a try. It was not terrible bad, and I’ll try and write up my install experience later. But for now the working online basic chat example can be found at:

http://renaun.com/flex2/red5/BasicChat.html

You can view the source by right clicking on the application.

I had some issues with the Red 5 server running even when I logged off the server. I think i have it worked out with a nohup for now. I will need to figure out how to install red5 with a proper start and stop script. If any one knows send me an email…

I have made some minor updates to the live examples, default button and auto scroll position.