The vector shape appears in the scene above the dynamic text box

The topic pretty much explains it all. I start in a frame with one of the MovieClips with only a bitmap covering the entire stage.

Then, when the user presses the button, it goes to the second frame and the vector shape is on stage, covering part of the image. At the same time, through the code, I am placing an input text field on the stage.

The problem is that the dynamically created textbox appears below the shape of the vector (which was drawn on the stage)! This seems to be a problem that is new to ActionScript 3, as I did not have this problem with Flash CS3 and ActionScript 2.

I tried to put the textbox on different layers but to no avail. How can I get the textbox above the vector shape?

0


source to share


4 answers


I've already tried this. It's ridiculous things like this that prevent me from porting my frameworks to AS 3.

I decided that the problem somehow lies in the fact that Flash displays what is on the stage. When called some_mc.play();

, new objects are introduced into the scene - while programmatically placing other objects in the scene - objects that were manually placed in the scene will always appear directly on top of any programmatically created objects. It may not be every experience, but this is what I see.



My solution: call some_mc.play();

, wait 10ms and then place other objects on the scene.

0


source


Place the vector shape inside the movie clip. Then call:



setChildIndex(myTextField, numChildren - 1);

      

0


source


You can try adding a vector shape via code and then adding a textbox.

var vectorShape:Sprite = new Sprite();  
addChild(vectorShape);

var textField:TextField = new textField();  
addChild(textField);

      

This would put the vector shape below the text box.

0


source


It looks like your problem comes from the design vector and the runtime textarea appearing in the same frame, so it is a timing issue when they appear and when you can move them.

The easiest way to avoid this problem is. One way would be to create an empty clip (on stage, at design time) to hold the text box, overlay it anywhere, and create text inside it at runtime. Another solution would be to create either a vector or a textbox (or both) at frame 1, but keep it / invisible until needed.

0


source







All Articles