www.webdeveloper.com
Results 1 to 2 of 2

Thread: More Complex Custom Animated Flash Buttons

  1. #1

    More Complex Custom Animated Flash Buttons

    How do you setup buttons in flash that when you put the mouse over the button, it moves (tweens maybe) to the right, and as soon as you take the mouse off it starts going back to the left? but if you leave the mouse over it, it stays out at the right.

    or something like the following:
    http://www.flashbuttons.com/basicFor...Name=DataProbe
    http://www.flashbuttons.com/basicFor...Name=DataProbe

    feel free to email an .fla file to wizcreations@gmail.com
    I know XHTML and CSS, but my knowledge is below basic in any other language.

  2. #2
    Join Date
    May 2004
    Location
    dobson ave.
    Posts
    694
    Hi -
    I think if you made a movie clip symbol of the graphics you want to move, [graphics_mc] then placed an 'invisible' button symbol [has only a hit state, same sz. as graphic] on a layer above it [button_btn] you could place it on stage and try in the main timeline:
    Code:
    graphics_mc.button_btn.onRollOver = function(){
      this.onEnterFrame = function(){
        if (this._x < 540){
          this._x += 4;
        }
      };
    };
    graphics_mc.button_btn.onRollOut = function(){
      this.onEnterFrame = function(){
        if (this._x > 200){
          this._x -= 4;
        }
      };
    };
    //since a button's code applies to what it's in, 'this' refers to graphics_mc, here. 540 is the x location to the right, and 200 is for it's left location, so change as needed...

    Hope that helps to get you started,
    El

    P.S. - An easier way is to make the 'Over' state of a button contain a movie clip that has the tweening that you want.
    F-fox 2.0 :: US :: el design site :: 768 kbps :: WIN

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles