MC Image Holder Help Please Read
Hi Everyone.
Ok I have a movie clip called mc
inside that movieclip i have a new movieclip called open
and so on.
its not to deep but its deep enough.
_root.mc.open.top.img_cover
Ok this is connected using xml and mysql for inserting database information and to pull the information back to the client.
How ever I have a big problem that I haven't been able to solve and I wasted the whole day looking for the solution.
Actionscript Code:
_root.domainname ="http://www.somewebsite.com/";
function loadXML(loaded)
{
if (loaded)
{
Avatarsetsize = new Array();
_root.myusername = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.myfirstname = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
_root.mylastname = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
_root.myemail = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;
_root.myavatar = this.firstChild.childNodes[0].childNodes[4].firstChild.nodeValue;
_root.mywebsite = this.firstChild.childNodes[0].childNodes[5].firstChild.nodeValue;
_root.myage = this.firstChild.childNodes[0].childNodes[6].firstChild.nodeValue;
_root.mygenderfemale = this.firstChild.childNodes[0].childNodes[7].firstChild.nodeValue;
Avatarsetsize.push(_root.myavatar);
username_txt.text = _root.myusername;
firstname_txt.text = _root.myfirstname;
lastname_txt.text = _root.mylastname;
email_txt.text = _root.myemail;
loadMovie(Avatarsetsize, _root.mc.open.top.img_cover);
website_txt.text = _root.mywebsite;
age_txt.text = _root.myage;
var male = _root.mygendermale;
_root.mc.alert.text = male;
var female = _root.mygenderfemale;
_root.mc.alert.text = female;
if (male == "1")
{
male_txt.text = "Yes!";
}
else
{
male_txt.text = "No!";
}
if (female == "1")
{
female_txt.text = "Yes!";
}
else
{
female_txt.text = "No!";
}
}
else
{
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(_root.domainname +'flash/getprofile.php?username='+ _root.mc_loaded.uname.text);
This right here is my problem.
loadMovie(Avatarsetsize, _root.mc.open.top.img_cover);
Say the image that is stored in the database is 1024 px by 800 px
I need to make sure the the image holder shows the full image inside the movie clip _root.mc.open.top.img_cover
I can do this with xscale yscale but say the image size changes say the image is not 1024 px by 800 px
say its 1280 px by 1024 or smaller the image holder will not show the image inside the movieclip that is only 200 px by 200 px as a full image its way to big or to small
I thought about if statements but there are so many random pixal image sizes that it would be pointless to do it that way.
How can i have a movie clip size 200 px by 200 px load any image size inside that window perfect no matter the size?