# Help with basic AS please - dynamic image proportions

**URL:** <https://forum.kirupa.com/t/help-with-basic-as-please-dynamic-image-proportions/137075>\
**Category:** Uncategorized\
**Created:** [February 11, 2005, 1:23am UTC](https://forum.kirupa.com/t/help-with-basic-as-please-dynamic-image-proportions/137075 "2005-02-11T01:23:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stormboy](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@stormboy](https://forum.kirupa.com/u/stormboy)\
**Post date:** [February 11, 2005, 1:23am UTC](https://forum.kirupa.com/t/help-with-basic-as-please-dynamic-image-proportions/137075/1 "2005-02-11T01:23:38Z")

</div>

I am having trouble with a script that was purchased for a clients site, it draws thumbnails within a scroller component. I need the images to be aligned x and y axis differently based on whether they are portrait (29px H) or landscape (122px H). I have tried if and else statements to no avail :confused;

What currently sets layout of thumbs:

curMC.\_x=myCol\*(curMC.\_width+50);  
curMC.\_y=myRow\*(curMC.\_height+80);

Start of code  
//////////////////////

function createClip(i){  
skin = “0”;  
var attachWhat:String = (useThumbnails==“true”) ? “skin”+skin+"\_thumbnail" : “skin”+skin+"\_galItem";  
thumbLoader.content.attachMovie(attachWhat,“gal”+i,i);  
var curMC:MovieClip = thumbLoader.content[“gal”+i];  
curMC.\_alpha=0;  
if(useThumbnails==“true”){  
var imageStuff:Array = String(myArray\*[0]).split("/");  
var myThumb:String = curGalDir+"/thumbs/"+(imageStuff[imageStuff.length - 1]);  
curMC.image\_mc.loadMovie(myThumb);  
var tmpMC:MovieClip = curMC.\_parent.createEmptyMovieClip(“tmp”+i, i+10000);  
tmpMC.onEnterFrame=function(){  
if((curMC.image\_mc.getBytesLoaded()==curMC.image\_mc.getBytesTotal())&&curMC.image\_mc.getBytesTotal()\>50){  
curMC.image\_mc.\_x-=(curMC.image\_mc.\_width/2);  
curMC.image\_mc.\_y-=(curMC.image\_mc.\_height/2);  
delete this.onEnterFrame;  
}  
}  
}  
curMC.current\_mc.\_alpha=0;  
curMC.i = i;  
animateIn(curMC, 100, “\_alpha”, 30);  
curMC.myImage=myArray\*[0];  
curMC.i=i;  
curMC.\_x=myCol\*(curMC.\_width+50);  
curMC.\_y=myRow\*(curMC.\_height+80);  
var colMax:Number = (useThumbnails==“true”) ? columns\_thumbs : columns\_no\_thumbs ;  
if(myCol==colMax)myRow++;  
myCol=(myCol\<colMax)? myCol+1 : 0;  
curMC.onRollOver=function() {  
if(galEnabled!=0)animateIn(this.btn1\_mc, 15, “frame”, 15);  
}  
curMC.onRollOut=function() {  
if(galEnabled!=0)animateOut(this.btn1\_mc, 0, “frame”, 15);  
}  
curMC.onRelease=function(){  
if(galEnabled!=0){  
picClick=1;  
if(currentMC!=this){  
animateOut(currentMC.current\_mc, 0, “\_alpha”, 30);  
currentMC=this;  
animateIn(currentMC.current\_mc, 100, “\_alpha”, 30);  
}  
whichPic = this.i;  
setFrame();  
this.photoSelected1\_mc.\_visible = true;  
animateIn(this.photoSelected1\_mc, 100, “\_alpha”, 15);  
}  
}  
if(i==myLength-1){  
galleryCombo.enabled=true;  
setFrame();  
var galleryWait\_int=setInterval(checkWait, 500);  
}  
thumbLoader.size();  
clearInterval(gallery[“myInt”+i]);  
}
