A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How do you link shapes and buttons together?

  1. #1
    Junior Member
    Join Date
    Dec 2005
    Posts
    9

    How do you link shapes and buttons together?

    Hello,

    I'm trying to link a shape and a button together like in the Menu Slider example at http://www.flashpulse.com/koolsource/ under scripts. The Actual Flash is at http://www.flashpulse.com/koolsource...enuslider.html.

    Also, do you all know if there are any other mouse over states other than color fill? Is there any blinking or flash or gradual fill on a mouse over state for example?

    Also, does anybody know of a complete tutorial that explains the basics behind making a simple Flash Menu?

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    my entire site is based on this code.

    Basically it's a matter of keeping track of the variables

    In the movie(shape must be a MC) to move you put code like
    Code:
    onClipEvent(load){
    _root.posx=5;
    }
    
    onClipEvent(enterFrame){
     this._x-=(this._x-_root.posx)/5;
    }
    what that does is every frame it reduces by the difference in the clip's X position less the variable until it's zero difference. The /5 sets the speed that this happens. A little trial and error is needed to find the need posx value to put the clip where you need it.

    Then each button just sets the posx value, since the clip is always adjusting the x position by the difference it will move as soon as that variable changes. In my case I put the posx as a varible in the root movie so it's always referenced as _root.posx in the buttons and the child movie.


    As for over states you can do anything you want in the over state, that example (button I think is included with KM) just happens to change the fill, but you could but an entire movie clip in there instead if you want, this was made much easier in the current version.

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