# Moving a title\_mc

**URL:** <https://forum.kirupa.com/t/moving-a-title-mc/220245>\
**Category:** flash\
**Created:** [March 24, 2007, 2:03am UTC](https://forum.kirupa.com/t/moving-a-title-mc/220245 "2007-03-24T02:03:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xlot](https://avatars.discourse-cdn.com/v4/letter/x/edb3f5/32.png) [@xlot](https://forum.kirupa.com/u/xlot)\
**Post date:** [March 24, 2007, 2:03am UTC](https://forum.kirupa.com/t/moving-a-title-mc/220245/1 "2007-03-24T02:03:41Z")

</div>

Hello Guys and girls,  
Thanks for the extremely useful information you have all contributed, I am fairly new to flash and even moreso to AS. I am working with V3 gallery - I have a container box that sizes to the photo. I currently have the text below the photo and it moves according to the size of the image, I would like to place a title above the image which also adjusts to the size of the image,… the code is as shown below and the MC that I would like above the image is testbox Thanks for any help!  
Mark\\

var tnNr;  
spacing = 10;  
container.\_alpha = 0;  
var curLength;  
MovieClip.prototype.loadPic = function(pic, id) {  
info.test.htmlText = “”  
info.desc\_txt.text =""  
testbox.test.text =""  
info.client.text =""  
info.date.text = “”  
info.technology.text = “”  
this.\_alpha = 0;  
this.loadMovie(pic);  
temp = this.\_parent.createEmptyMovieClip(“temp2”, 998);  
temp.onEnterFrame = function() {  
var t = container.getBytesTotal(), l = container.getBytesLoaded();  
if (Math.round(l/t) == 1 && container.\_width != 0 && container.\_height != 0) {  
var w = container.\_width+spacing, h = container.\_height+spacing;  
border.resizeMe(w, h, id);  
delete this.onEnterFrame;  
}  
};  
};  
MovieClip.prototype.resizeMe = function(w, h, id) {  
var speed = 3;  
container.\_alpha = 0;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1 && Math.abs(this.\_height-h)\<1) {  
this.\_width = w;  
this.\_height = h;  
container.\_x = this.\_x-this.\_width/2+spacing/2;  
container.\_y = this.\_y-this.\_height/2+spacing/2;  
info.\_y = Math.round(this.\_y+this.\_height/2+spacing/2);  
testbox.\_y = Math.round(this.\_y+this.\_height/2+spacing/2);  
container.\_alpha += 5;  
if (container.\_alpha\>90) {  
web\_url = uArray[Number(id)]  
web\_title = “Buy Now”;  
web\_txt.html = true;  
info.test.htmlText = “\<a href=”"+web\_url+""\>"+web\_title+"\</a\>";  
testbox.test.text = xArray[Number(id)]  
info.desc\_txt.text = iArray[Number(id)]  
info.client.text = cArray[Number(id)]  
info.date.text = dArray[Number(id)]  
info.technology.text = itArray[Number(id)]  
container.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};
