I've been making a simple RPG battle system so I could use some parts of the code in a serious RPG after, but when I was making a certain part (more details below) of the code I've run on a problem with the code that I can't figure out the solution. Basically, when I go from the frame managing the battle to the frame where I'm adding the battle options, the second button that I put there disapears, It doesn't need to have a code refering to it or even an instance name.
Since I couldn't find any leads on google or on the McLeodGaming search (I used key words related with "Object on stage disapears") and couldn't find the souce of the problem on my code, I decided to make a copy of the file and "trim" the code so I could reproduce the problem with as few code as possible. It turned out like this:
Layer 1, Frame 1: A blank keyframe with a code to find the stage center.
Layer 2, Frame 1: Another blank keyframe with a variable defined for adding an object from the library later.
Layer 2, Frame 2: Blank keyframe without code (I tryed to trim the code without change the frames, so I left this one without the code, but didn't deleted it)
Layer 2, Frame 3: Key frame with an "Enter" button called EnterButton on it and coding to go to the main frame.
Layer 2, Frame 4 (Called "StartFr"): Keyframe with a "Test Battle" button called TestBattle and a blank button. Since the blank button is the second button that I put on stage, it is the one who disapears. Alse, there is a code to go to the battle frame.
Layer 2, Frame 4 (Called "BattleFr"): Key frame with a dynamic text field called BatText. Since I wanted to have a well established battle before adding graphics and sounds, I just gone with text based battle until then, but it turned out that when I delete this text field, the second button stays there, so I think the answer lies there. Also there is an important part of the code.
The comment on line 12 translates to "Causes error. Why?" and it was a note to myself that I decided not to erase from the trimmed file. Also, as happened with the textfield, if you delete this line, the button stays there.
BatSel: Last, but not least, the movieclip Called BatSel on library, exported for actionscript on frame 1, with class name BatSel and base class flash.display.MovieClip. Inside it there are 4 buttons, one of them named BButton4 and the frame one (the only) of the movie clip has an script to go back to the main frame.
I'll also leave the trimmed file attached here, if some one want to give a look, which I nicknamed "Debugger". If you need me to explain anything else, just tell me. If someone could at least give a lead of what is going on I would be grateful.