Skip to main content
Participant
August 12, 2010
Question

Disappearing movie clip

  • August 12, 2010
  • 2 replies
  • 487 views

Hello there once again,

I've juat about had it, haha.

Here's the situation. I have a simple drag and drop game which consists of a scale and multiple rocks that you can place on either side of the scale. If you get the rock placed on the correct side the first time, you get ten points, which is reflected in a dynamic text box in the upper right hand corner. If you get it wrong, you get zero poitns even if you get it correct the second time. That all works fine. These rocks are also double-click-able and when you do that it will bring up some information about that rock. You can close that window and then go about your business. That works fine as well.

Well recently I added an instructions button into the mix (just in case you want to see the instructions from the beginning again) and it follows the same sort of logic as opening the window when you double-click on a rock. Only with this, it is just with a click. I get to the window just fine, shows the instructions and everything. Then I close it, that works fine too. Then the really interesting thing is, when I go to place another rock and when it is placed correctly, the score disappears. It just vanishes. This doesn't happen if I'm looking at the info of the rocks and then continue to play the game. It's only after viewing the instructions and closing it out.

A little more specific info:

Click instructions. Window pops up. Score is still visible behind the window.

Close Window. Score is still visible.

Move a rock and place it just somewhere random. Score is still visible.

Place rock on the incorrect side. Score is still visible.

Place rock on the correct side. Score disappears.

I have not "...visible = false;" statements anywhere in my code.

I do have multiple "...visible = true;" statements in my code in a lame attempt at debugging this.

By the way, the "..." that I just used above, I'm meaning the stuff that comes before it. I'm not actually using "...visible = true;" in my code.

I have no idea why this is happening. I have tried everything that I can think of. I even had someone else look at it and he couldn't think of what to do.

Hopefully you guys can help shed some light on this. Any help would be appreciated.

I would attacha file with the necessary folders and what not, but it doesn't look like I can do that through here.

Any ideas?

Thanks for any help!

---EDIT---

It is still adding scores correctly. I did a trace on the text and it stilla adds up the scores correctly. This leads me to believe that it is still there. Just not visible. Hmmmm....

---END EDIT---

Message was edited by: linkian19

This topic has been closed for replies.

2 replies

linkian19Author
Participant
August 13, 2010

The other person I had been working with and I have finally figured out a way to make it work.

Here's the line of code that made it work:

this.scoreText_mc.scoreText.htmlText = "<b>"+score+"</b>";

(Yes it may be silly to have it within a movie clip, that was a testing thing, but it works so I dont' feel like changing it haha)

I have this line of code in every spot where I've changed the score variable. We're not really sure why this works. But it does. So yeah, solved that problem. lol

Thanks for any help given and if you feel like you have something to add, feel free. I'm more than willing to find out more things about AS3.

Inspiring
August 13, 2010

I usually turn on the border for the text box. That way I can see if the box is still there or not.

Is the box too small and at some point the score gets to large to fit into it?

That is about all I can think of--off the top of my head.

linkian19Author
Participant
August 13, 2010

Well, I enabled the border around the text field. The box stays there. The text just disappears. Like, my variable for it has been deleted or taken out, or something. Or like it's being set to nothing. Which is very strange indeed...

Thanks for that idea though. That helped test the problem a little bit more to narrow it down just a little more.

I'll keep playing with it, see if I can get something to happen.

---EDIT: UPDATE---

Another interesting thing. I was just testing playing with some options. I turned on the Selectable option and when I recreated my problem. It looks like the text is still there, but it's either changing color, or alpha value, or something like that. I was able to select the text that was in there and copy and paste it. So it's not being removed. You just can't see it. Another interesting piece of the puzzle.

I don't have any changes to alpha value or color or anything like, so I wonder why it's behaving this way?

Anyway, if anyone else has an idea, it would be appreciated.

---END EDIT---

Message was edited by: linkian19

Inspiring
August 13, 2010

Have you made the textbox really large to be sure that you are seeing all of it?

If you have embedded fonts did you only restrict the characters to numbers? If so, embed Basic Latin (or All) as a test to see what happens. If you get an undefined or IsNaN then you know that you've got some math problems....

How are you keeping the score? Is it some variable and then you are applying that variable to the text property of the textfield? If so, you are casting the variable (which I assume is a Number or an int) to be a string, right? You aren't trying to do something fancy where you pull the score back out of the string and add them together?