: Http://blog.5d.cn/user45/hero82748274/upload/2008-12/Weather.rar
Bored with an RSS reading. The code is simple, and the function is simple. I hope to improve this program.
Function
Currently supported features: Window dragging
Close and zoom out
Custom icon
Connect to other RSS reading
Currently, the single tag function is supported.
- <? XML version = "1.0" encoding = "UTF-8"?>
- <Mx: Export wedapplication 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. Export dobject;
- [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 );
- }
- // Link Method
- Public Function linktourl (): void
- {
- Try {
- NavigatetoURL (New URLRequest (DG. selecteditem. Link ));
- }
- Catch (E: Error)
- {
- Alert. Show ("error occurred ");
- }
- }
- 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('{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: Using wedapplication>
Note: when creating the icon, change the icon in the configuration file Secornd-app.xml so that you can customize the icon when publishing
- <Icon>
- <Image16x16> tub2.png </image16x16>
- <Image32x32> tub.png </image32x32>
- <Image48x48> tub3.png </image48x48>
- <Image128x128> tub4.png </image128x128>
- </Icon>