-1

I am not an action script developer nor flash designer, i just want to have a small animation with a balloon, I want to make three buttons, and fixed balloon like shape that will get inflated and deflated on button click events. On one click the balloon get half inflated, on another button click get full inflated and on last button click gets deflated position. Please help me.

Thanks In advance

Rohan
  • 1
  • 1
  • 2

1 Answers1

0

First, you should make an ellipse shape MovieClip like Balloon. and refer a following skeleton-code. Clicking on the stage, this code toggles the balloon inflation to deflation versa.

and here is source code link: Ballon_Sample

import flash.events.MouseEvent;
import flash.events.Event;

var isToggle:Boolean;
var ballonState:String = "default";
stage.addEventListener(MouseEvent.CLICK, onClick);
stage.addEventListener(Event.ENTER_FRAME, onEnter);
function onClick(e:MouseEvent):void
{
    if(!isToggle)
    {
        ballonState = "inflate";
    }
    else
    {
        ballonState = "defalte";
    }

    isToggle = !isToggle;
}

function onEnter(e:Event):void
{
    if(ballonState == "inflate")
    {
        //mc_ballon is Ellipse Shape MovieClip like Ballon Shape.
        mc_ballon.scaleX += 0.01;
        mc_ballon.scaleY += 0.01;
    }
    else if(ballonState == "defalte")
    {
        mc_ballon.scaleX -= 0.01;
        mc_ballon.scaleY -= 0.01;
    }
}
bitmapdata.com
  • 9,572
  • 5
  • 35
  • 43