If action script

I can’t figure out this problem.
Well, I am not good at action scripts at all. so…

Anyway, I have two buttons. One button has tell target action that opens up the door. Another button has also tell target action that closes the door. Opening the door is fine. But when I click on “close” button, it shows the text underneath the door even though it was not open.

So, when the door is not open and click on the “close” button, I don’t want the text underneath the door to appear.

Do you get it?
I think I need to use “if” action, but I don’t know how to write a sentence.

I made a flash file so that you can take a look.
I really appreciate your help.
Tnank you!

  1. tellTarget is deprecated (fazed out)… the new code goes like this…

CHANGE THIS…

on (release) {
	tellTarget ("door") {
		gotoAndPlay("go");
	}
}

TO THIS

on (release) {
     _root.door.gotoAndPlay("go");
}{/CODE]


2)  I am not quite sure what you mean about the door closing.  Everything seems to work fine for me.  Do you mean you want the text to disappear? and then the block fades out?

Well I fixed it the way I thought you wanted. I figured why not give it a try? If it isn’t the way you want… I can just change it next time you specify.

Thank you for your reply.

I tested the file that you attached, but that was not what I wanted. When you click on close, the text dissapears all of a sudden. I want it to gradually fade out as if we were closing the door.

To explain this again, I attached another movie. In this movie, I createda door. The animation works fine, but here is the problem.

When you click on the close button without clicking on the open button before you click on the close button, the text shows up. The door was close. So it is not supposed to show the text behind the door at all. You know what I mean?

The same thing goes to open. When the door is already opend and you click on open. It looks like the door gets closed and opened again.

So, I want the movie to, "if the door is closed, don’t go to “box_back”. even if we click on close. If the door is already open, don’t go to “box_start” even if we click on open.

I hope you understood what I was trying to say here.
Thank you very much for your help.

I know a much better way than that.

This way is to use movieclips as buttons and disable the other one when you shouldn’t use it (I tried with buttons, but for some reason it didn’t cooperate).

To better explain… the closedoor button is disabled from the start. And when you click the opendoor button, the opendoor button disables and the closedoor button enables. Then when you click the close door button, the closedoor button disables and the opendoor button enables.

So it would be impossible for the viewer to click the same button twice and make it looks weird.

I have attached the file here…

Thank you so much.
That is not what I was looking for, but your resolution solved the problem perfect.
I really appreciate that!

No problem… I Know it wasn’t exactly what you were looking for, but to me I think it is more effective and much easier to do than using an if statement (which in this case would have been lenghty and a pain)

Oh yeah and enabled = false only works in MX. So if you know anyone else that has Flash 5 and wants to do it… they can’t do that, there is a different way to do it in Flash 5 that I am not sure of.