ForumsProgramming ForumMovieclip selection, surveying (AS2 ONLY PLEASE!)

4 2777
Buttersnack
offline
Buttersnack
332 posts
Peasant

Here is how I asked it to Krin, but he is yet to answer because he is very busy. You might be able to help me quicker.

I need some help in Actionscript 2 and I wondered if you could help me really quick. I just needed to know, how do I make it so that when you click on a movieclip it displays specified text? For example:

I have a movieclip. Let's call it "cop". What I know how to do is show its stats when my mouse is over it, but I want it to either:

1. Continue to show said stats when I move my mouse away, or
2. Show the stats until I click on something else.

These stats would just be shown in a little text box.

If it's not extra work, I would also like to know how to select an area and have it tell me what risks that area may contain. I would click and drag to select an area, and it would tell me something like: "Area x34-x96 & y25-y78; High risk; helicopters, cops, and lasers may be in this area."

If you can help me with any of this, I'd gladly put you in the credits as helping me. Much appreciated, even if you just write me back to say that you can't help. Bye! :3

  • 4 Replies
Buttersnack
offline
Buttersnack
332 posts
Peasant

I figured most of this out, please skip to "If it's not extra work."

Fighterlegend
offline
Fighterlegend
44 posts
Nomad

Cop.onRollOver = function() {
this.gotoAndStop(2);
};
Cop.onRollOut = function() {
this.gotoAndStop(1);
};

That's all you really need to do.

Or just have a movieclip attached to the mouse, and do hitTest functions:

mouseCover.onEnterFrame = function(){
mouseCover.hide();
// If you want the user to have their own mouse cursor.
// if you want the user to have yours, use Mouse.hide();
mouseCover._x = _xmouse;
mouseCover._y = _ymouse;
if(this.hitTest(_root.Cop)){
_root.Cop.gotoAndStop(2);
}else{
_root.Cop.gotoAndStop(2);
}

Fighterlegend
offline
Fighterlegend
44 posts
Nomad

Oh, well I tested that MouseCover script, it doesn't work one bit.

Oh well..

Buttersnack
offline
Buttersnack
332 posts
Peasant

No, I used an array. I don't remember the whole code, but it contained:

on (press) {
_root.word2 = _root.word3[random(1)];
}


in the button. Word3 would be changed to word1, word4, 5, 6, etc, but other than that it was the same. In the main timeline I told it what the text should be. As you can see, it's a random code, but there is only one option and thus is always the same.

I'll upload a preview somewhere to show you.

Showing 1-4 of 4