Animated Buttons Step 2?

  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

Code: [ Select ]
onClipEvent (enterFrame) {
this.onRelease = function(){
//    put whatever action you want applied to the button here
//    for instance:
     _root.gotoAndPlay("action");}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
  1. onClipEvent (enterFrame) {
  2. this.onRelease = function(){
  3. //    put whatever action you want applied to the button here
  4. //    for instance:
  5.      _root.gotoAndPlay("action");}
  6. if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
  7. this.nextFrame();
  8. } else {
  9. this.prevFrame();
  10. }
  11. }


Using this code given by "roarmeow" I have managed to make a cool navigation panel w/ a flyout menu...

Now, the problem is that on the mouse over, the "hit area" is only over (oh, yeah, the buttons are text) the text will the action play. So, they won't work if the mouse is between the letters.

How do I correct this?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • yuriythebest
  • Banned
  • Banned
  • User avatar
  • Posts: 143
  • Loc: Ukraine

Post 3+ Months Ago

Ahh, a classic problem. What you must do is enter the button movie clip, create another layer, move it UNDER the text, and on that layer draw a box the same color as the background. Easy as c@ke!
  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

Great! I can't believe I didn't think of that!
Now the next, and final prob...
I have a flyout menu above a movie clip using the above code. (The flyout menu uses that code too)
When you move the mouse off of the menu (or the sub-menu)to the lower "button" (that is the movie clip) it gets "stuck" and sort-of spazes out... The sub menu goes in and out speraticly. How can I correct this?
  • uknightuss
  • Graduate
  • Graduate
  • uknightuss
  • Posts: 196
  • Loc: Los Angeles

Post 3+ Months Ago

I wen't through this whole problem when I was making my small logo to go on sites that I've worked on.

In the code that I used for my project the actionscript basically made it so that "onRollover" the movie would go to the next frame and play, and on rollout it would play "prevFrame". So what I did to fix it is basically remove the part of the actionscript from the button that says "rollout - prevFrame" and ON THE STAGE made a button as an invisible hit area that filled the stage outside the menu/panels and made it so that when that gets "rollover" "prevFrame" is then activated.

(By doing this, taking the "prevFrame" part out of the actionscript, you basically make it so that you can have more buttons on your expanding menu and be able to rollover them without the menu collapsing. You give the "prevFrame" action to the large invisible hit area that goes outside of your menu area. So once the menu flies out, you can have all kinds of sub stuff going on, and the menu won't collapse until you truly rollout/ rollover the external invisible hit area..) I hope I'm not repeating myself a lot.. Please check out my logo, I believe it is exactly what you're talking about..

I hope that made sense.. You can see my logo that I'm talking about if you go to This Siteand look at the bottom left side for the "RK". Don't forget to scroll over the little orange squares to see the "sub menu's"..

EDIT: The "hit area" for "prevFrame" is only located on the specific frame in your timeline where your expanding menu is fully expanded. On "prevFrame" you basically leave blank keyframes.. The reason is so that your page does not always have the "hand" mouse cursor over it making it appear as if it is one big button. It only appears once, when the menu is fully expanded, then on rollOver "prevFrame" happens and it dissapears.. Again I say check out my logo! :)
  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

I don't get it.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.