Help with Showing/Hiding movieclips

  • NetSpinner
  • Born
  • Born
  • NetSpinner
  • Posts: 4
  • Loc: Upstate NY

Post 3+ Months Ago

I work with a bunch of engineers, and if anyone is familiar with working with people like that then you already know that when they have an idea for how something should look/function/etc...that it becomes the ONLY way for it to do so.

Along those lines, I'm working on a project that illustrates the nomenclature of a gear mesh. Two boring gears sitting on the stage with a handful of buttons you can click on to highlight that particular area of the gear/pinion and a quaint looking text box pops up that describes the function of that part (and more boring formulae for engineers). Everything works easy enough by using basic gotoAndplay lines.

Halfway through the project, I'm informed that they'd like to leave the highlighted area up until you deselect the button. So basically the button starts out gray...is clicked, and the highlighted area fades into existence while the button turns gold. Then they can select another item from the list (in case the terms are inter-related). The most current selection will have that gold colored button while any of the items still 'on' will have a purple button.

Nice color scheme, eh? Did I mention I work for mechanical engineers? :roll: The also told me it should be as easy as hide/show layer, right? Yeah...I wish.

So I guess I'm looking for advice on the best way to handle those purple buttons and their attached highlighted area. Keep in mind I'm not the greatest at ActionScipting, so bear with me on this...

I can't really use alpha levels because then the gray buttons are blocked by the invisible ones and their actions won't work. And I've had a hell of a time trying to find good examples of _visable properties and how to really set them up correctly.

If anyone pity's me enough to attempt a response at this mess, it'd be greatly appreciated.

Edit: typos
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Sulfin
  • Graduate
  • Graduate
  • User avatar
  • Posts: 129
  • Loc: canada

Post 3+ Months Ago

First of all, it's _visible, not _visable.
If you wan't to hide something without it still being there, you can use the _x property.

Code: [ Select ]
onClipEvent(load){
_x+=10000
//or
_x=-10000
}
  1. onClipEvent(load){
  2. _x+=10000
  3. //or
  4. _x=-10000
  5. }

This will move it out of the stage, so you can't click on it or anything.
  • NetSpinner
  • Born
  • Born
  • NetSpinner
  • Posts: 4
  • Loc: Upstate NY

Post 3+ Months Ago

Sulfin- Thanks! Shyeah, sorry about the _visible spelling...I'd been spelling it right in the file, but like I mentioned, they still blocked the buttons below it.

I never even thought about moving the clips off the stage like that...I did mention I'm still rather new to this all, right? Anyhow, I appreciate the advice. Thanks again, and a word of warning: I may be back here if I have any more issues!
  • Sulfin
  • Graduate
  • Graduate
  • User avatar
  • Posts: 129
  • Loc: canada

Post 3+ Months Ago

If you need more help, send me a PM and I'll see what I can do. I'm not a pro, but my tactics usually work. 8)
  • Sulfin
  • Graduate
  • Graduate
  • User avatar
  • Posts: 129
  • Loc: canada

Post 3+ Months Ago

You can make a variable called "before_x" and "before_y"
Code: [ Select ]
onClipEvent (load) {
  before_x = _x;
  before_y = _y;
  from_enabled_frame = 2; //state the starting frame where the button will appear
  to_enabled_frame = 4; //state the ending frame where the button will disapear after
}
onClipEvent (enterFrame) {
  if (_root._currentframe >= from_enabled_frame && _root._currentframe <= to_enabled_frame) {
    _x = before_x;
    _y = before_y;
  } else {
    _x = -10000;
    _y = -10000;
  }
}
  1. onClipEvent (load) {
  2.   before_x = _x;
  3.   before_y = _y;
  4.   from_enabled_frame = 2; //state the starting frame where the button will appear
  5.   to_enabled_frame = 4; //state the ending frame where the button will disapear after
  6. }
  7. onClipEvent (enterFrame) {
  8.   if (_root._currentframe >= from_enabled_frame && _root._currentframe <= to_enabled_frame) {
  9.     _x = before_x;
  10.     _y = before_y;
  11.   } else {
  12.     _x = -10000;
  13.     _y = -10000;
  14.   }
  15. }

It works on my computer!
  • NetSpinner
  • Born
  • Born
  • NetSpinner
  • Posts: 4
  • Loc: Upstate NY

Post 3+ Months Ago

Sulfin, once again, you ARE my hero. I haven't plugged it all in yet, but it looks like that's exactly what I want!

Thank you soooooo much!
  • Sulfin
  • Graduate
  • Graduate
  • User avatar
  • Posts: 129
  • Loc: canada

Post 3+ Months Ago

I'm pretty sure there's a "disable" actions script for buttons, but I never looked into it myself, so I don't know how it works. It probably does the same thing, but shorter and without moving the clip away from the stage.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 7 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.