PDA

View Full Version : layering oddity with Tween class code


rohcahs
01-13-2006, 05:53 AM
In a piece I'm building, all the movieclips are built with AS. The only thing that's in the library is an icon that gets attached via attachMovie() to some of the MCs I'm building with this.createEmptyMovieClip(). There's sort of a little solar system, at least figuratively. One MC is in the middle and others surround it. The surrounding "planets" are connected to the "sun" via lines I'm drawing. I want those lines to be layered beneath the MCs so that the lines aren't visible on top of the aforementioned icons. I want it to look as if the lines begin at the edge of the icons. Otherwise, it looks bad.

It works fine. Until...

...I put in code from the Tween and easing classes. I want to do some easing with some text that's on stage when the user clicks the icons. When an expression such as:

var out:Tween = new Tween(this._parent.nodeDesc, "_x", Elastic.easeOut, 0, 20, 2, true);

is present, the lines I've drawn are layered vastly higher (900000 or thereabouts) and are on top. Layering is done with getNextHighestDepth(). Mind you that I don't even have to call the function where the easing is executed. It's mere presence in the code causes this problem, even before it's called. Commenting it out makes it all work properly again. BTW, the easing works fine, that's not the problem.

Anyone ever seen this before?

astgtciv
01-13-2006, 06:03 AM
Are the lines in their own movieClip, or simply drawn in "this._parent"? Not that that should be happening either way, I don't think, sounds very odd. Then again, I've never used mx.transition.Tween, only the lmc_tween.

rohcahs
01-13-2006, 06:07 AM
The lines are in their own movieClips. What's lmc_tween? I'll have to search for that.

astgtciv
01-13-2006, 06:14 AM
lmc_tween: http://laco.wz.cz/tween/. It's a separate package (meaning it's indepent of those distributed by Macromedia), maintained by Ladislav Zigo.

rohcahs
01-13-2006, 03:29 PM
Thanks for the pointer.

I'd been working in Flash 8 when this problem occurred, though it's a MX 2004 .fla. So I opened it in MX 2004 to see if there was a difference. Same problem, though.

It's sort of an easy fix. I just force the layer of the lines to 1, 2, 3 and 4. But it's still strange to me that the problem exists at all.