Its me again, breathing between game development.
I am into a dilemma: I need to use foreground text balloons, but reusing the default ones (which is 'background balloons'), already inside each enemy scene.
For example: _root.Level.goomba.scene1.balloon1, _root.Level.goomba.scene2.balloon2........
But I need it to be in the foreground layer (Level.HUD).
_root.Level.HUD.balloon1, _root.Level.HUD.balloon2....
I am almost there. Let's call _root.Level.goomba.scene1.balloon1 as _obj (as I code inside a function). Tb3m is the balloon1, in the library (identifier).
- Code: Select All Code
_root.Level.HUD.attachMovie("Tb3m", "Tb3m", 10000+_root.balloonAuxAux); //it puts balloon1 (Tb3m) as '_root.Level.HUD.Tb3m'.
//copying properties from the old balloon
_root.Level.HUD.Tb3m._width=_obj._width;
_root.Level.HUD.Tb3m._height=_obj._height;
_root.Level.HUD.Tb3m._xscale=_obj._xscale;
_root.Level.HUD.Tb3m._yscale=_obj._yscale;
_root.Level.HUD.Tb3m._rotation=_obj._rotation;
//Change coordinates, in order for both balloons be in the same coordinate plane.
_obj.point = new flash.geom.Point(0,0);
_obj.localToGlobal(_obj.point);
_root.Level.HUD.globalToLocal (_obj.point);
_root.Level.HUD.Tb3m._x=_obj.x;
_root.Level.HUD.Tb3m._y=_obj.y;
But the balloon is not scaling. I get the current xscale and yscale, but it remains huge. In the picture below, you can notice the older balloon (the tail of it) because I havent removed it just for comparison.
I just want to know how to capture that scaling.
I tried duplicateMovieClip() but it only works by duplicating objects to the same timeline hierarchy. I need different hierarchies.
Just to mention that _root.Level.goomba has the default scale, but _root.Level.goomba.scene1 has a custom scale (I did it manually, shrinking it). The same with _root.Level.goomba.scene1.balloon1 and _root.Level.goomba.scene2.balloon2 (because the default scale for scene1 and balloon are huge).
I need to retain the current balloon1 and balloon2 relative scale, so I can duplicate it with the same position.
Thank you for any help!