Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invisible MovieClip with visible children

Status
Not open for further replies.

Ziporama

Programmer
Sep 17, 2004
4
US
Is it possible to create an invisible MovieClip that will spawn visible children?
Failing this, is there any way that I can create a MovieClip of a given size with a transparent fill AND a transparent border?

Thanks!
 
No sure I understand what you are trying to do. Why would you need an invisible clip to spawn visible children when you can create a MC anytime? Can you give some more detail?

Wow JT that almost looked like you knew what you were doing!
 
Sure. I want to be able to draw a component dynamically that is resizable at author time, and avoid the scaling that, for instance, extending UIObject would do to it. One kludge that I've considered is to have an invisible MovieClip, and have it createEmptyMovieClip() of the same size that is resizable at author time. It's not at all aesthetically appealing, but I'm at a loss as to how to see the resized component's drawing adjust to the real size
of the resized component.
You see, while the original symbol may have been say, 100x100 px, when the component is resized to 150x150 px, _xscale and _yscale of the resized symbol become 150 each, but a child created by the original at the new size will have an _xscale and _yscale of 100 each.
Hope this explains my quandry.
 
Can't you just set the size of the child when you create it?

Something like:

Code:
myMC.duplicateMovieClip("newMC",this.getNextHighestDepth());
newMC._xscale = myMc._xscale;
newMC_yscale = myMC._yscale;

Have you already tried that?

Wow JT that almost looked like you knew what you were doing!
 
Yes. The problem is that 1) I don't want a visible border or background(createEmptyMovieClip() will give me what I want), and 2), I don't want the calling myClip to be visible at all. I can create vars for the new height and width to do all the calculations for drawing based on (100/_xscale) and (100/_yscale), assuming that the original symbol is 100x100 px)...that is not the problem...the problem is that, when working with the original symbol as a component, everything is scaled as it's resized in live preview mode. In the best of all possible worlds, what I really want is just one MovieClip that can redraw inside of itself as it's resized in live preview mode without scaling.
 
So you want your MC to "stretch" within itself when resized kind of like a html table set to 100% will stretch in a browser window... is that it?

Wow JT that almost looked like you knew what you were doing!
 
Thanks for your time Pixl8r. I found something workable on Joey Lott's person13.com. I just embed another rectangular MovieClip by itself on the first frame of my component's timeline. In my class constructor, I then tell it to make the rectangular box invisible, and set its _width and _height properties to 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top