Reputation: 111
I'm trying to do a cross-fade transition in Flex between two states, both containing a VideoDisplay object. The problem is that the default CrossFade effect takes a bitmap snapshot of both states and blends between the two. This means that the movies appear to be frozen for the time of the transition.
Does anybody know of a solution that uses a PixelBender (GPU-accelerated) method of fading between two movies? My other option is to manually re-order the video objects and change the alpha of the top one, but this uses a lot of CPU (in my case ±300%)...
States:
Transition:
<s:transitions>
<s:Transition >
<s:CrossFade id="crossfader" target="{this}" duration="{fadeTime}" />
</s:Transition>
</s:transitions>
Objects:
<components1:VideoDisplay
id="movie_attract"
width="640" x="0" height="480" y="0"
source="{configuration.movieAttract.source}"
includeIn="attract"
/>
<components1:VideoDisplay
id="movie_engage"
left="0" right="0" top="0" bottom="0"
source="{configuration.movieEngage.source}"
includeIn="engage"
/>
Upvotes: 0
Views: 383
Reputation: 1633
I have found that using the Spark Fade (not CrossFade) works (and performs) better for me.
Replacing your CrossFade line with the following should work.
<s:Fade id="crossfader" targets="{[ movie_attract, movie_engage ]}" duration="{fadeTime}" />
Disclaimer: I have not tested this with VideoDisplays that are currently playing a video. But even with paused videos, the Fade effect performed much better than CrossFade. Fade was smooth and not jerky, unlike CrossFade. I know this is not strictly answering your question, but you may want to try it out.
Upvotes: 1