Resizing invisible buttons?

I’m loading jpegs dynamically and have an invisible button over top to cycle through them, but I can’t seem to get the “hit” part of the button to resize. Here’s my code:

var myMCL = new MovieClipLoader();

myMCL.loadClip(“images/db/body/”+imgLoad.imgLocal,"_root.holder1.chapter1.holder2.combo1.imgHolder");

myMCL.onLoadInit = function(targetMC) {
[indent]imgHit._x = targetMC._x;
imgHit._y = targetMC._y;
imgHit._width = targetMC._width;
imgHit._height = targetMC._height;
[/indent] }
where “imgHit” is the instance of my button;
the image loads no problems and a few other bits of code I have (resizing and centering) work fine… but I can’t get the button resized… any tips?

cheers

anyone???

If that’s not working, you could try putting the button AS in it’s own event handler:

imgHit.onEnterFrame = function() {
     this._x = someMC._x;
     this._y = someMC._y;
     this._width = someMC._width;
     this._height = someMC._height;
}

thanks for the reply… it’s weird because the resize now works with an invisible element in the “up” frame of the button… but then only once… after the first click, button dissapears… ???

I have a problem that’s bugging me too that’s a bit like this…
First of all, I’ve loaded some images onto the stage using attachMovie and I now want to add actionscript to them. The images and the widths and heights were loaded from XML…


	for (i=_root.currentImage; i < _root.currentImage+6; i++) {
		if (i < _root.totalImages) {
			_root.attachMovie("pictureClip","image"+i,i);
			_root["image"+i].pictureFrame.loadMovie(_root.imagesFilename*+".jpg");
			_root["image"+i]._x = xpos;
			_root["image"+i]._y = ypos;
			xpos += 160;
			if (xpos > 160) {
				xpos = 0;
				ypos += 110;
			}
			thisImageName = _root.imagesFilename*+".jpg";
			thisImageWidth = Number(_root.imagesWidth*);
			thisImageWidth += 20;
			thisImageHeight = Number(_root.imagesHeight*);
			thisImageHeight += 30;
			**_root["image"+i].onRelease = function() {
				getURL ("JavaScript:openWin('"+thisImageName+"','"+thisImageWidth+"','"+thisImageHeight+"')");
			}**		} else {
			_root.nextButton._visible = false;
		}
	}

Now it loads up all the images properly and puts actionscript on them but the problem is, the values for the image height and width are applied to ALL of the buttons (so the last image overwrites all the previous ones!). Can anyone help with how I can prevent this?

Many thanks,
David Fox

Could you post your FLA 3rd?