Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : empty movie clip _x _y


cabp ms
5/11/2004 9:31:39 PM
Hi again, I'm working in a image gallery with flash and xml, now I can show
the images, thanks Tim for your help, but I got a nother problem, maybe it's
something easy but i don't know how this doesnt work:

var movieNum=0;
for(var p=minFor; p<=maxFor; p++)
{
// create the mc name - works fine -
var holderName="mcHolder"+movieNum;
// create empty movie clip - works fine -
var holderRef=_root.createEmptyMovieClip(holderName, movieNum);
// loads image in each empty movie clip - works fine -
holderRef.loadMovie(_root.hiddenClip.hiddenList.getItemAt(p).file);
// set the _x and _y property - THIS DOESN'T WORK -
holderRef.width=10;
holderRef.height=10;

So, that's my problem I try to set the _x and _y properties but not works,
please help!!!
Jack.
5/11/2004 9:53:37 PM
holderRef._x = 50;
holder.Ref._y = 125;
and correct syntax for the width / height properties
holderRef._width=10;
holderRef._height=10;

for a list of movieclip properties, check the Help
Files for MovieClip (object)
hth

cabp ms
5/13/2004 3:37:17 PM
mandingo
5/14/2004 12:10:00 AM
Ok, take a look at this code and maybe it will help in some way... the code
that Jack. provided is correct in what it is supposed to do...

this.createEmptyMovieClip("myMovieClip",1);
myMovieClip.beginFill(0xFF0099,100);
with(myMovieClip){
moveTo(100,50);
lineTo(100,150);
lineTo(150,150);
lineTo(150,50);
lineTo(100,50);
endFill();
}
myMovieClip._x = 0;
myMovieClip._y = 0;
myMovieClip._width = 200;
myMovieClip._height = 10;

You can see in that code that a moveClip is created dynamically and should
have a size of 50 x 100...

the last two lines change the size to 200 x 10 which is what is displayed.

hope that sheds some light on it all.
cheers,
AddThis Social Bookmark Button