Is there a way to have a button only active if a certain
condition is met?
For example I have 2 buttons each plays a sound when you
press them. However I dont want them to be active all the time. I
want one to be active when a movieClip is located at a certain
location and the other to be active when the clip is in another
Can this be done at all? Any tips, hints, snippets or
otherwise useful info?
There are a few different ways you can achieve this. If the
user is dragging the movieclips to the specified locations, then
you could call a function from the movieclip.onRelease that detects
if the movieclip is in the right place, and if so, enable the
button (myButton_btn.enabled = true), otherwise set the button's
enabled property to false.
If you need to detect the movieclip while it is animating,
you could use an onEnterframe function to constantly detect the
position of the movieclip, and then enable your button if it's in
the right place.