1.21 gigawatts
1.21 gigawatts

Reputation: 17880

Is there a Flex 4 Pause effect?

Is there a Flex 4 Spark version of the Pause effect?

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/effects/Pause.html

In a Sequence this effect pauses for a specific duration of time before going to the next effect. It also can pause until a specific event is dispatched on a target.

@Shaun,
I see. What threw me off was the mx.effects package it's part of and this comment in the TweenEffect class which Pause extends.

/**
* TweenEffect is the superclass for the animated effects in Flex 3. As of Flex 4, the
* Spark effects extend the spark.effects.Animate class instead of TweenEffect.
*/
[Alternative(replacement="spark.effects.Animate", since="4.0")]

Thank you!

Upvotes: 1

Views: 471

Answers (1)

shaunhusain
shaunhusain

Reputation: 19748

It says here although it's not advised (likely due to the changes in the architecture to separate the layout and scroll bar etc.)

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf5fdc3-7fff.html

I would guess a Pause effect would work fine... actually tried it out it shows up in Spark in the 4.5 SDK

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        title="HomeView">

    <fx:Script>
        <![CDATA[
            protected function button1_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                bc.visible=true;
            }

            protected function button2_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                bc.visible=false;
            }

        ]]>
    </fx:Script>

    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
        <s:Sequence id="sq">
            <s:Rotate angleBy="45"  autoCenterTransform="true"/>
            <s:Pause duration="1000"/>
            <s:Rotate angleBy="45" autoCenterTransform="true"/>
        </s:Sequence>
    </fx:Declarations>
    <s:layout>
        <s:VerticalLayout/>
    </s:layout>
    <s:BorderContainer id="bc" width="100" height="100" backgroundColor="blue" visible="false" showEffect="sq"/>
    <s:Button click="button1_clickHandler(event)" label="show"/>
    <s:Button click="button2_clickHandler(event)" label="hide"/>
</s:View>

Note this is a mobile application hence the s:View.

Upvotes: 3

Related Questions