课程表

Flex课程

工具箱
速查手册

Flex WipeRight Effect

当前位置:免费教程 » 软件/图像 » Flex

介绍

WipeRight类定义了一个擦除权效果。 组件的前或后状态必须是不可见的。

类声明

以下是 mx.effects.WipeRight 类的声明:

  1. public class WipeRight
  2. extends MaskEffects

公共方法

S.N.方法和描述
1

WipeRight(target:Object = null)

构造函数。

继承的方法

此类继承以下类中的方法:

  • mx.effects.MaskEffect

  • mx.effects.Effect

  • flash.events.EventDispatcher

  • Object

Flex WipeRight效果示例

让我们按照以下步骤通过创建测试应用程序来检查Flex应用程序中WipeRight Effect的使用:

步骤描述
1 Flex - 创建应用程序章节中所述,在包 com.tutorialspoint.client 下创建名为 HelloWorld 的项目。
2修改 HelloWorld.mxml ,如下所述。 保持文件的其余部分不变。
3编译并运行应用程序,以确保业务逻辑按照要求工作。

以下是修改后的mxml文件 src / com.tutorialspoint / HelloWorld.mxml 的内容。

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  3. xmlns:s="library://ns.adobe.com/flex/spark"
  4. xmlns:mx="library://ns.adobe.com/flex/mx"
  5. width="100%" height="100%" minWidth="500" minHeight="500"
  6. >
  7. <fx:Style source="/com/tutorialspoint/client/Style.css"/>
  8. <fx:Script>
  9. <![CDATA[
  10. protected function btnWipeRight_clickHandler
  11. (event:MouseEvent):void {
  12. imageFlex.visible = true;
  13. }
  14. ]]>
  15. </fx:Script>
  16. <fx:Declarations>
  17. <mx:WipeRight id="wipeRight" duration="2000"/>
  18. </fx:Declarations>
  19. <s:BorderContainer width="630" height="480" id="mainContainer"
  20. styleName="container">
  21. <s:VGroup width="100%" height="100%" gap="50"
  22. horizontalAlign="center" verticalAlign="middle">
  23. <s:Label id="lblHeader" text="Effects Demonstration"
  24. fontSize="40" color="0x777777" styleName="heading"/>
  25. <s:Panel id="wipeRightPanel" title="Using WipeRight Effect"
  26. width="500" height="300" includeInLayout="true" visible="true">
  27. <s:layout>
  28. <s:VerticalLayout gap="10" verticalAlign="middle"
  29. horizontalAlign="center"/>
  30. </s:layout>
  31. <mx:Image id="imageFlex" visible="{false}"
  32. source="//www.w3cschool.cn/images/flex-mini.png"
  33. showEffect="{wipeRight}" />
  34. <s:Button id="btnWipeRight" label="Wipe Right"
  35. click="btnWipeRight_clickHandler(event)"/>
  36. </s:Panel>
  37. </s:VGroup>
  38. </s:BorderContainer>
  39. </s:Application>

准备好所有更改后,让我们以正常模式编译和运行应用程序,就像在 Flex - 创建应用程序中一样 章节。 如果一切顺利,您的应用程序,这将产生以下结果:[在线试用]

Flex WipeRight Effect
转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号