A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Simple Question about animation

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    4
    I am trying to figure out a simple way to change the size of a box on my movie to a larger size when a user rolls the mouse over it. I would like to scale it a percentage of it's original size when the mouse is pressed. Does anyone have any suggestions? I am pretty new to Flash, so this is probably really simple. I am using Flash 5.

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Posts
    147
    its simple if u know actionscripting , but a bit difficult otherwise ...

    I will try to give you a brief explanation ...

    1) Make a MC (movie Clip) of the Box .
    2) Make an empty button , means make a button and only in its "HIT" frame put a keyframe and draw a rectangle the size of the box .

    3) Make another MC and in its 1st layer place the Box mc and from the instance panel name the box MC as "box" (without quotes) .

    4) make another layer in this same Mc and place the empty button over the box mc (align it properly ..)

    5) Right-click the button and choose "Action"

    6) then enter the following script :

    on(mouseOver) {
    setProperty("box",_xscale)=(getProperty("box",_xsc ale))+10 ;
    setProperty("box",_yscale)=(getProperty("box",_ysc ale))+10 ;
    //above you can change 10 to anything you want
    }
    on(mouseOut) {
    setProperty("box",_xscale)=(getProperty("box",_xsc ale))-10 ;
    setProperty("box",_yscale)=(getProperty("box",_ysc ale))-10 ;
    }



    7) your done !!! now plcae the new mc hence created anywhere u want to use ...


    Libran



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center