Macromedia flex 2 Manuel
Writing an effect for a transition
241
Flex uses the following rules to determine the start and end values of effect properties when
you use the effect in a transition:
you use the effect in a transition:
1.
If the effect defines the values of any properties, it uses the properties in the transition, as
the following example shows:
the following example shows:
<mx:Transition fromState="*" toState="*">
<mx:Sequence id="t1" targets="{[p1,p2,p3]}">
<mx:Blur duration="100"
blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0"/>
<mx:Parallel>
<mx:Move duration="400"/>
<mx:Resize duration="400"/>
<mx:Resize duration="400"/>
</mx:Parallel>
<mx:Blur duration="100"
blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0"/>
</mx:Sequence>
</mx:Transition>
In this example, the two Blur filters define the properties of the effect.
2.
If the effect does not define the start values of the effect, the effect determines the values
from the
from the
EffectInstance.propertyChanges
property passed to the effect instance. Flex
sets the
propertyChanges
property by using information from the current settings of the
component, as defined by the current view state. For more information on the
propertyChanges
property, see
In the example in step 1, notice that the Move and Resize effects do not define start values.
Therefore, Flex determines the start values from the current size and position of the effect
targets in the current view state, and passes that information to each effect instance by
using the
Therefore, Flex determines the start values from the current size and position of the effect
targets in the current view state, and passes that information to each effect instance by
using the
propertyChanges
property.
3.
If the effect does not define the end values of the effect, the effect determines the values
from the
from the
Effectinstance.propertyChanges
property passed to the effect instance. Flex
sets the
propertyChanges
property by using information about the component, as defined
by the destination view state. For more information on the
propertyChanges
property,
see
.
In the example in rule 1, Flex determines the end values of the Move and Resize effects
from the size and position of the effect targets in the destination view state. In some cases,
the destination view state defines those values. If the destination view state does not define
the values, Flex determines them from the setting of the base view state, and passes that
information to each effect instance by using the
from the size and position of the effect targets in the destination view state. In some cases,
the destination view state defines those values. If the destination view state does not define
the values, Flex determines them from the setting of the base view state, and passes that
information to each effect instance by using the
propertyChanges
property.
4.
If there are no explicit values, and Flex cannot determine values from the current or
destination view states, the effect uses its default property values.
destination view states, the effect uses its default property values.