How to Use the setstyle () function in flex to implement showeffect and hideeffect

Source: Internet
Author: User

 

  1. <? XML
    Version = "1.0"
    Encoding = "UTF-8"?>
  2. <Mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml"
  3. Layout = "vertical"
  4. Verticalalign = "Middle"
  5. Backgroundcolor = "white"
  6. Creationcomplete = "Init ();">
  7. <Mx: SCRIPT>
  8. <! [CDATA [
  9. Import MX. effects. Easing .*;
  10. Private function Init (): void {
  11. IMG. setstyle ("showeffect", rotate );
  12. IMG. setstyle ("hideeffect", fade );
  13. }
  14. ]>
  15. </MX: SCRIPT>
  16. <Mx: fade id = "Fade"
    />
  17. <Mx: Rotate id = "Rotate"
  18. Anglefrom = "-180"
  19. Angleto = "0"
  20. Easingfunction = "elastic. easeinout"
  21. Duration = "2000"/>
  22. <Mx: applicationcontrolbar dock = "true">
  23. <Mx: Form stylename = "plain">
  24. <Mx: formitem label = "visible:">
  25. <Mx: togglebuttonbar id = "togglebuttonbar"
  26. Itemclick = "IMG. Visible = event. item. Data;">
  27. <Mx: dataprovider>
  28. <Mx: array>
  29. <Mx: Object Label = "show"
    Data = "true"
    />
  30. <Mx: Object Label = "hide"
    Data = "false"
    />
  31. </MX: array>
  32. </MX: dataprovider>
  33. </MX: togglebuttonbar>
  34. </MX: formitem>
  35. </MX: Form>
  36. </MX: applicationcontrolbar>
  37. <Mx: Image id = "IMG"
  38. Source = "@ embed ('Assets/flashplayer_icon.jpg ')"
  39. Width = "100"
  40. Height = "100" type = "parmname" text = "parmname"/>
  41. </MX: Application>

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.