E
E
enchikiben2011-08-13 10:35:28
ActionScript
enchikiben, 2011-08-13 10:35:28

Layering in Flash

Good afternoon, tell me how the layers in the flash are regulated? I create movies dynamically in a cycle , they are all normally created, and to these layers (points) I attach hints that appear on hover, I create them that way, they all work too, but for some reason they are lower by layers than the point itself, how can I raise them up above everything? I tried to change the depth parameter but nothing ...

for ( a = 1; a <= 10; a++ ) {
_root.attachMovie("star", "star"+a, a );

_root["star"+a].onRollOver = function() {
_root.hint_status = true
_root.mytext = "text";
}

}


this.createEmptyMovieClip("hint",100);
hint.createTextField("field",100,0,0,200,20);

var hint_status = false;

hint.field.type = "static";
hint.field.variable = "podskazka"
hint.field.textColor = 0x000000;
hint.field.background = true;
hint.field.backgroundColor = 0xFFFFFF;
hint.field.border = true;
hint.field.autoSize = true;

txtstyle = new TextFormat();
txtstyle.size = 12;
txtstyle.align = "center";
txtstyle.font = "Arial Cyr";

hint.field.setNewTextFormat(txtstyle);
hint._visible = false;

this.onMouseMove = function() {
if (_root.hint_status) {
hint._visible = true;
hint._x = _xmouse;
hint._y = _ymouse-25;
hint.podskazka = _root.mytext;
} else{
hint._visible = false;
}
}



this.createEmptyMovieClip("hint",100);
hint.createTextField("field",100,0,0,200,20);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Plotnikov, 2011-08-13
@fzn7

In AS2, displayables are a tree of items with a top level of _root. You correctly create movies by placing them at _root and depths from 1 to 10, however you create hints inside movies and they are distributed at the depths of their movie parent. Those. _root.mc1.hint10 will always be below _root.mc3.hint1, because mc3 lies higher than mc1. The solution to your problem lies in creating one single hint movie on _root, which will lie above all previously created clips _root.createEmptyMovieClip("hint",10000); And access it this.onMouseMove = function() { _root.hint._visible = true }

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question