The first version of RSS reader is complete.

Source: Internet
Author: User

: 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.

  1. <? XML version = "1.0" encoding = "UTF-8"?>
  2. <Mx: Export wedapplication xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "absolute"
  3. Applicationcomplete = "Init ()"
  4. Showflexchrome = "false"
  5. Alwaysinfront = "true"
  6. Width = "500"
  7. Height = "500">
  8. <Mx: style source = "view.css"/>
  9. <Mx: SCRIPT>
  10. <! [CDATA [
  11. Import MX. Controls. Alert;
  12. Import flash.net. Export dobject;
  13. [Bindable]
  14. Private var myurl: string;
  15. Private function Init (): void
  16. {
  17. Myurl = myinput. Text = "http://www.people.com.cn/rss/politics.xml ";
  18. HP. Send ();
  19. Mypanel. addeventlistener (mouseevent. mouse_down, onmousedown );
  20. }
  21. // Link Method
  22. Public Function linktourl (): void
  23. {
  24. Try {
  25. NavigatetoURL (New URLRequest (DG. selecteditem. Link ));
  26. }
  27. Catch (E: Error)
  28. {
  29. Alert. Show ("error occurred ");
  30. }
  31. }
  32. Private function changeaddress (): void
  33. {
  34. Myurl = myinput. text;
  35. HP. Send ();
  36. }
  37. Private function onmousedown (E: mouseevent): void
  38. {
  39. If (Mousey> 27 & Mousey <57)
  40. {
  41. This. Stage. nativewindow. startmove ();
  42. }
  43. }
  44. Private function closewnd (): void
  45. {
  46. This. Stage. nativewindow. Close ();
  47. }
  48. Private function minwnd (): void
  49. {
  50. This. Stage. nativewindow. Minimize ();
  51. }
  52. ]>
  53. </MX: SCRIPT>
  54. <Mx: httpservice id = "HP" url = "{myurl }"
  55. Useproxy = "false"/>
  56. <Mx: Panel cornerradius = "7" backgroundimage = "@embed('pic.png ') "id =" mypanel "Title =" RSS reader "layout =" absolute "horizontalcenter =" 0 "verticalcenter ="-13 "width =" 443 "Height =" 421 ">
  57. <Mx: DataGrid id = "DG" x = "0" Y = "0" width = "423" Height = "309" dataprovider = "{HP. lastresult. RSS. channel. item} ">
  58. <Mx: columns>
  59. <Mx: datagridcolumn headertext = "title" datafield = "title" width = "390"/>
  60. <Mx: datagridcolumn width = "53">
  61. <Mx: itemrenderer>
  62. <Mx: component>
  63. <Mx: vbox>
  64. <Mx: linkbutton label = "look" Click = "This. parentdocument. linktourl ()"/>
  65. </MX: vbox>
  66. </MX: component>
  67. </MX: itemrenderer>
  68. </MX: datagridcolumn>
  69. </MX: columns>
  70. </MX: DataGrid>
  71. <Mx: button x = "313" Y = "325.65" label = "Link" width = "59" Height = "27.933334" Click = "changeaddress ()"/>
  72. <Mx: textinput id = "myinput" x = "43" Y = "328.65" width = "262"/>
  73. <Mx: Label x = "10" Y = "330.65" text = "RSS"/>
  74. <Mx: button upskin = "@embed('{png ') "id =" btn_close "x =" 387 "Y =" 317 "label =" X "width =" 24 "Height =" 24 "Click =" closewnd () "stylename =" mybutton "/>
  75. <Mx: button x = "387" Y = "347" width = "24" Click = "minwnd ()" Height = "24" stylename = "mybutton2"/>
  76. </MX: Panel>
  77. </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

  1. <Icon>
  2. <Image16x16> tub2.png </image16x16>
  3. <Image32x32> tub.png </image32x32>
  4. <Image48x48> tub3.png </image48x48>
  5. <Image128x128> tub4.png </image128x128>
  6. </Icon>

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.