This content has been marked as final. Show 10 replies
How about DisplayObjectContainer.getObjectsUnderPoint() ? Haven't tried it,
but looks promising.
Good idea, but this project (and it is part of a large project) is well underway with AS2. I will file that in the back of my head for the future. :)
Basically I'm making some little kid games. I want to check if they are repeatedly clicking on some disabled movieclip. If they do it some arbitrary number of times I want to bring up a dialog/coach who tells them that the button is disabled.
Here is what I've come up with. This is only the test part, there is also a part that counts up the number of trues I get and if it goes over a certain limit starts the coach sequence. If you have any feedback, please let me know. Thanks.
That looks reasonable for what you need to do. I think I would have
approached it in the much same way.
BTW, you don't need that break statement after the return.
Roth, you could go use the really old MovieClip._droptarget property on a tiny _alpha'ed out movieclip you start dragging around on mouse down, use a onMouseMove handler mixed with an updateAfterEvent on it and that'll keep the resolution up.
Then all you need to do is eval the value of _droptarget on mouse up and disable that.
I'm sure it'll be faster than enumerating through all the objects on Stage, although of course it has its limitations, especially if you're after all the objects stacked on each other.
Anyways, hope that helped
Thanks for the inputs.
dr_ross I thought of the _droptarget, but there are other things I might be dragging and I think that would complicate things. There aren't that many things on the stage and these are not high speed games so I think it makes sense.
hey buddy, you could use a on(rollover) action. on the section for the movie clips you want to have that action on, add the code below and it will automatically trace the name of the movie.
trace("you just scrolled over the moviecip: "+this.name)
try that and let me know what you think! (if that is what you were asking)
Thanks for the suggestion, but that is not quite what I'm trying to do.
I have buttons (acutally movieclips) that are disabled that I want to check if a little kid is just clicking it over and over.
Since they are disabled an onRollOver (I prefer to use that kind of notation) won't work.
I'm not sure if it would be any more elegant, but could you fake that the movieClip was disabled instead of actually setting its .enabled property to false? Something like this maybe...
willrose – thanks for that idea. I will think about it. But there can be several different types of buttons and I have to come up with a solution that other developers can easily work into their existing files.
I'll give it a thought.
and thanks everybody.
wait a sec rothrock... by you saying... you want to come up with something that other developers can use... so would you prefer or think it would be best if you created a component that did that action for you and allows for a .... i guess an array or 2d array would work best for storing the data... i am sorry my input was not correct, i think creating a component would work best... what do you think about that... if that is the case i will be happy to help with that unless i misunderstood the question.