0
votes

Can anyone tell me how can we create a wobbling effect using flex 3? I need something like the effect which is show in ubuntu when we see an alert or move a folder.

Thank you.

1
Mind expanding on that? What do you mean by 'wobbling'? Have you tried anything before just asking this question? Any code? Where/When is the effect suppose to run? - J_A_X
@J_A_X I believe he's looking for something similar to the wiggling animation icons get when you tap and hold on them on in iPhone. - Jason Towne

1 Answers

0
votes

Not sure if there is anything specifically built in Flex to handle the "wobble" effect specifically, but you can combine the Flex Move and bounce effects to create a kind of "wobble":

<?xml version="1.0"?>

<fx:Declarations>
    <s:Bounce id="bounceEasing"/>
    <s:Elastic id="elasticEasing"/>
    <s:Move id="moveRight" 
        target="{myImage}"
        xBy="500"
        duration="2000"
        easer="{elasticEasing}"/>
    <s:Move id="moveLeft" 
        target="{myImage}"
        xBy="-500"
        duration="2000"
        easer="{bounceEasing}"/>
</fx:Declarations>

<s:Image id="myImage" 
    source="@Embed(source='assets/logo.jpg')"/>
<s:Button label="Move Right"
     x="0" y="100" 
    click="moveRight.end();moveRight.play();"/>
<s:Button label="Move Left" 
     x="0" y="125"
    click="moveLeft.end();moveLeft.play();"/>

Customize the code above to make smaller movements and link the left and right moves, and you have a wobble. You might also decide to add an event listener for the MouseEvent.ROLL_OVER to play the wobble effect when the mouse rolls over the component.