下载地址:http://blog.5d.cn/user45/hero82748274/upload/2008-12/Weather.rar
无聊弄了一个rss阅读。代码很简单 功能还是单一,希望可以努力完善这个程序
功能
目前支持的功能:窗口拖动
关闭,缩小
自定义图标
连接其他rss阅读
目前支持单标签功能
- <?xml version="1.0" encoding="utf-8"?>
- <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
- applicationComplete="init()"
- showFlexChrome="false"
- alwaysInFront="true"
- width="500"
- height="500">
- <mx:Style source="View.css"/>
- <mx:Script>
- <![CDATA[
- import mx.controls.Alert;
- import flash.net.SharedObject;
- [Bindable]
- private var myurl:String;
- private function init():void
- {
- myurl=myinput.text="http://www.people.com.cn/rss/politics.xml";
- hp.send();
- mypanel.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
- }
- //链接方法
- public function LinkTOURL():void
- {
- try{
- navigateToURL(new URLRequest(dg.selectedItem.link));
- }
- catch(e:Error)
- {
- Alert.show("发生错误了");
- }
- }
- private function ChangeAddress():void
- {
- myurl=myinput.text;
- hp.send();
- }
- private function onMouseDown(e:MouseEvent):void
- {
- if(mouseY>27 && mouseY<57)
- {
- this.stage.nativeWindow.startMove();
- }
- }
- private function closewnd():void
- {
- this.stage.nativeWindow.close();
- }
- private function minwnd():void
- {
- this.stage.nativeWindow.minimize();
- }
- ]]>
- </mx:Script>
- <mx:HTTPService id="hp" url="{myurl}"
- useProxy="false"/>
- <mx:Panel cornerRadius="7" backgroundImage="@Embed('pic.png')" id="mypanel" title="Rss Reader" layout="absolute" horizontalCenter="0" verticalCenter="-13" width="443" height="421">
- <mx:DataGrid id="dg" x="0" y="0" width="423" height="309" dataProvider="{hp.lastResult.rss.channel.item}" >
- <mx:columns>
- <mx:DataGridColumn headerText="title" dataField="title" width="390" />
- <mx:DataGridColumn width="53">
- <mx:itemRenderer >
- <mx:Component>
- <mx:VBox>
- <mx:LinkButton label="Look" click="this.parentDocument.LinkTOURL()"/>
- </mx:VBox>
- </mx:Component>
- </mx:itemRenderer>
- </mx:DataGridColumn>
- </mx:columns>
- </mx:DataGrid>
- <mx:Button x="313" y="325.65" label="Link" width="59" height="27.933334" click="ChangeAddress()"/>
- <mx:TextInput id="myinput" x="43" y="328.65" width="262"/>
- <mx:Label x="10" y="330.65" text="Rss"/>
- <mx:Button upSkin="@Embed('w.png')" id="btn_close" x="387" y="317" label="X" width="24" height="24" click="closewnd()" styleName="mybutton"/>
- <mx:Button x="387" y="347" width="24" click="minwnd()" height="24" styleName="mybutton2"/>
- </mx:Panel>
- </mx:WindowedApplication>
注意:制作图标的时候,改变配置文件Secornd-app.xml 里面的icon 这样发布的时候就可以自定义图标
- <icon>
- <image16x16>tub2.png</image16x16>
- <image32x32>tub.png</image32x32>
- <image48x48>tub3.png</image48x48>
- <image128x128>tub4.png</image128x128>
- </icon>