Spark Wipe Effect in Flex4


 

Spark Wipe Effect in Flex4

The Wipe class defines a bar wipe effect. The before and after state of the component must be visible.

The Wipe class defines a bar wipe effect. The before and after state of the component must be visible.

Spark Wipe Effect in Flex4:

The Wipe class defines a bar wipe effect. The before and after state of the component must be visible. This effect inherits the MaskEffect. The tag of Wipe Effect is <s:Wipe>. The syntax of Wipe effect is following:

<s:Wipe
id=""
duration=""
direction="left|right|up|down"
bitmapFrom=""
bitmapTo=""
target=""
/>

In this example you can see how we can use Wipe Effect in your application.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600">

<fx:Declarations>

<s:Wipe id="wLeft"

duration="1000"

direction="left"

bitmapFrom="{image1Bitmap.bitmapData}"

bitmapTo="{image2Bitmap.bitmapData}"

repeatCount="0"

repeatBehavior="reverse"

target="{roseindia}"/>

</fx:Declarations>

<fx:Script>

<![CDATA[

import mx.core.BitmapAsset;

[Embed(source='file:/C:/work/bikrant/image/bridge.png')]

[Bindable]

public var Image1:Class;

[Bindable]

public var image1Bitmap:BitmapAsset = new Image1();

[Embed(source='file:/C:/work/bikrant/image/yellowglobe.png')]

[Bindable]

public var Image2:Class;

[Bindable]

public var image2Bitmap:BitmapAsset = new Image2();

]]>

0

</fx:Script>

<s:Panel title="Spark Wipe Effect Example"

width="433"

1

height="296"

chromeColor="#000000"

color="#CCCCCC">

2

<mx:ApplicationControlBar

width="432"

horizontalAlign="center">

3

<s:Button id="btn"

label="Wipe Effect"

click="{wLeft.end();wLeft.play();}"/>

4

<s:Button id="btn1"

label="Stop Effect"

click="{wLeft.stop();}"/>

5

</mx:ApplicationControlBar>

<s:Label text="Click on Buttons for showing the effect"

fontFamily="verdana"

6

color="#000000"

x="93" y="41"/>

<s:Label text="Wipe Left"

7

fontFamily="verdana"

color="#000000"

x="179" y="64"

8

height="13"/>

<mx:Image id="roseindia"

source="{Image1}"

9

x="141" y="101" cacheAsBitmap="true"/>

</s:Panel>

</s:Application>

0

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Ads