패키지 | spark.effects |
클래스 | public class CrossFade |
상속 | CrossFade AnimateTransitionShader Animate Effect EventDispatcher Object |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | Flash Player 10, AIR 1.5 |
The CrossFade effect uses Pixel Bender, which is not supported for AIR mobile applications. |
The CrossFade effect performs a bitmap transition effect by running a crossfade between the first and second bitmaps. The crossfade blends the two bitmaps over the duration of the animation.
At any point in the animation, where the
elapsed and eased fraction of the animation is f
and the pixel
values in the first and second bitmaps are v1
and v2
,
the resulting pixel value v
for any pixel in the image is:
v = v1 * (1 - f) + v2 * f
The bitmap effect is run by a pixel-shader program
that is loaded by the effect.
You can specify a different crossfade behavior by specifying
a pixel-shader program to the shaderByteCode
property.
That pixel-shader program must meet the requirements defined in the
AnimateTransitionShader effect.
기본 MXML 속성motionPaths
기타 예제
Spark pixel-shader effects
Using a pixel-shader effect in a transition
Applying a pixel-shader effect
Creating a custom pixel shader
Using a pixel-shader effect in a transition
Applying a pixel-shader effect
Creating a custom pixel shader
관련 API 요소
공용 속성
보호 속성
공용 메서드
메서드 | 정의 주체 | ||
---|---|---|---|
Constructor. | CrossFade | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
Captures the current values of the relevant properties
on the effect's targets and saves them as end values. | Effect | ||
Captures the current values of the relevant properties
of an additional set of targets
Flex uses this function when a data change
effect is run.
| Effect | ||
Captures the current values of the relevant properties
on the effect's targets. | Effect | ||
Creates a single effect instance and initializes it. | Effect | ||
Takes an Array of target objects and invokes the
createInstance() method on each target. | Effect | ||
Removes event listeners from an instance
and removes it from the list of instances. | Effect | ||
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | ||
Interrupts an effect that is currently playing,
and jumps immediately to the end of the effect. | Effect | ||
Returns an Array of Strings, where each String is the name
of a property changed by this effect. | Effect | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
Pauses the effect until you call the resume() method. | Effect | ||
Begins playing the effect. | Effect | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | ||
Resumes the effect after it has been paused
by a call to the pause() method. | Effect | ||
Plays the effect in reverse, if the effect is currently playing,
starting from the current position of the effect. | Effect | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
Stops the effect, leaving the effect targets in their current state. | Effect | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
보호 메서드
생성자 세부 정보
CrossFade | () | 생성자 |
예제 예제 사용 방법
CrossFadeExample.mxml
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"> <s:states> <s:State name="default"/> <s:State name="flipped"/> </s:states> <s:transitions> <s:Transition id="t1" autoReverse="true"> <s:CrossFade target="{holder}" duration="1000" /> </s:Transition> </s:transitions> <s:Panel title="CrossFade Example" width="75%" height="75%" horizontalCenter="0" verticalCenter="0"> <s:HGroup width="100%" height="100%" top="5" left="5" right="5"> <s:Group id="holder"> <s:BitmapImage source="@Embed('assets/back2.png')" visible="true" visible.flipped="false"/> <s:BitmapImage source="@Embed('assets/c2.png')" visible="false" visible.flipped="true"/> </s:Group> <!-- Directions --> <s:VGroup id="detailsBox" width="50%" left="0"> <s:Label width="99%" color="blue" text="CrossFade fades from bitmapFrom to the bitmapTo image. This example cross-fades between two bitmapGraphics in a group via a state transition. Click the 'Play CrossFade' button to see the effect."/> </s:VGroup> </s:HGroup> <s:Rect left="0" right="0" bottom="0" height="30"> <s:fill> <s:LinearGradient rotation="90"> <s:GradientEntry color="0xE2E2E2" /> <s:GradientEntry color="0xD9D9D9" /> </s:LinearGradient> </s:fill> </s:Rect> <s:Button id="playButton" left="5" bottom="5" label="Play CrossFade" click="currentState = (currentState == 'flipped') ? 'default' : 'flipped';"/> </s:Panel> </s:Application>
Tue Jun 12 2018, 03:17 PM Z