This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Flash Site Design > August 2005 > invisible movieclips with X and Y dimensions
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
invisible movieclips with X and Y dimensions
|
|
| macron 2005-08-26, 7:23 pm |
| is it possible to make a movie clip that is invisible that has height and
width? (i know you can make a movie clip 'invisible' if it is the same color
as the stage, but what if you want to put a movie clip on top of a photographic
image?) the reason i need a movie clip with dimensions is so i can use its X
and Y to center jpgs loaded into it.
cheers,
macron
| |
| David Stiller 2005-08-26, 7:23 pm |
| macron,
> is it possible to make a movie clip that is invisible that
> has height and width?
Yes. Every movie clip is an instance of the MovieClip class. Check
out the "MovieClip class" entry of the ActionScript Language Reference to
see what methods (things they can do), properties (characteristics they
have), and events (things they react to) are available to all movie clips.
Among them is the _visible property (either true or false). Even when
set to false, the movie clip's _x, _y, _width, _height, and other properties
continue to retain their data.
David
stiller (at) quip (dot) net
Tackling the ActionScript Language Reference
http://www.quip.net/tutorials/
| |
| macron 2005-08-26, 7:23 pm |
| hi david -
thanks for getting back to me. if the properties of a holder movie clip are set at _visible=0, when you load images into it will they be visible?
thanks,
macron
| |
| David Stiller 2005-08-26, 7:23 pm |
| > You'll need to address the container clip's properties
> *after* its contents load.
To answer your question, though, yes, an invisible movie clip hides the
contents it loads. :)
David
stiller (at) quip (dot) net
"Luck is the residue of good design."
| |
| David Stiller 2005-08-26, 7:23 pm |
| macron,
> if the properties of a holder movie clip are set at _visible=0, when
> you load images into it will they be visible?
When you load anything into a clip, be that an external SWF or JPG, the
container clip's properties are "reset" when the loaded content finishes
loading. You'll need to address the container clip's properties *after* its
contents load.
You can compare the value of the container clip's getBytesLoaded()
method against the value of its getBytesTotal() method to determine when
loading is complete. There's also the MovieClipLoader class, if you're
comfortable publishing as a Flash 7 SWF.
David
stiller (at) quip (dot) net
"Luck is the residue of good design."
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|