Embedded MC, no size change with _parent clip

I’m trying to build a simple photo gallery, that when a user clicks on a button, the frame for the loaded jpeg changes size to fit the new image. I also want to include a title for the image, that stays aligned with the top-right of the frame. My problem is that I have the title within the frame MC and as the frame resizes, so does the title. is there a way of stopping the resize of the title???

Here’s what I have thus far for the frame resize:

var over:Number = 50;
var off:Number = 100;
var aProjectsNumbers:Array = new Array();
//
function mcOnEnterFrame() {
 this._alpha += (this.endAlpha-this._alpha)/10;
 this._xscale += (this.endXscale-this._xscale)/4;
 this._yscale += (this.endYscale-this._yscale)/4;
}
//
this.mcImgHolder.onEnterFrame = mcOnEnterFrame;
this.mcImgHolder.mcTitle.onEnterFrame = mcOnEnterFrame;
//
for (var i:Number = 0; i<5; i++) {
 aProjectsNumbers.push("mcNumber"+i);
 this[aProjectsNumbers*].tNumber.text = i+1;
 this[aProjectsNumbers*].onEnterFrame = mcOnEnterFrame;
 ///
 this[aProjectsNumbers*].onRollOver = function() {
  this.endAlpha = over;
 };
 this[aProjectsNumbers*].onRollOut = function() {
  this.endAlpha = off;
 };
 this[aProjectsNumbers*].onRelease = function() {
  with (this._parent) {
   mcImgHolder.endYscale = Math.random(3)*120;//just testing resize
   mcImgHolder.endXscale = Math.random(3)*120;
   //mcImgHolder.mcTitle._xscale = the same size always;
   //mcImgHolder.mcTitle._yscale = the same size always;
  }
 };
}

so as you can see i don’t have the jpeg loading yet, but as you press a button the frame resizes to a random size for testing.

thnx

Dont put the title inside the frame :wink:

the frame is center aligned so as it grows and shrinks the margins move all over the place. If i take the title out, i’ll need to have it move with the frame…Any ideas?

Ya, just move the title_mc using the x and y properties when the frame resizes.
Word of advice, your not gonna want to use xscale and yscale for the frame either. Your gonna want to use the width and height of the loaded image and then add 5-10 pixles to make the frame a little larger. Look here, study the code :wink: