Search code examples
flashactionscript-3actionscriptflash-cs3

Vector Shape on Stage Appears Over Dynamic Textfield


The subject pretty much explains it all. I start on frame one of a MovieClip with just a Bitmap covering the whole stage.

Then when a user clicks a button, it goes to frame two and a vector shape is on the stage covering part of the image. At the same time, through code, I place an input Textfield on the stage.

Problem is, the dynamically created Textfield is appearing UNDER the vector shape (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've tried putting the Textfield on different layers, but to no avail. How do I get the Textfield to appear over the vector shape?


Solution

  • I've already tried that. It's wacky stuff like this that's keeping me from migrating my frameworks to AS 3.

    I have determined that the issue somehow lies in the way that Flash renders what is on the stage. When calling some_mc.play(); introduces new objects to the stage -- while at the same time programmatically placing other objects on the stage -- the objects that were hand-placed on the stage will always render directly on top of any programmatically created objects. This might not be everyone's experience, but that is what I am seeing.

    My solution: call some_mc.play();, wait 10ms and then place other objects on the stage.