Hello all,
What i did here was making a frame and inside the frame i had alot of square images. Then i made a frame2 just like frame1 and only renamed all the images inside with an extra x at the end. I give all images the same background and let this code run first:
Code:
for(num=1;num<=20;num++)
{
eval("PICTURE"+num+"=set_image")
}
ConvertScale();
Convert();
alignX();
alignY();
Frame1.Show()
checkDesign="ok"
Frame2.Show();
xConvertScale();
xConvert();
xalignX();
xalignY();
menutoggleo=1;
Frame2.Hide();
this will do all the functions for frame 1 and then the same functions ( with an x infront ) for frame 2. But somehow i always end up with all the backgrounds of frame 1 to be upside down, while those of frame 2 remain normal. Any solutions? Thank you alot!
Code:
function ConvertScale()
{
var setX = String.format('2.2',Width/1000)
var setY = String.format('2.2',Height/1000)
var getY = 688-(setY*100)//768 is the measure Y from Frame1
while (operator <=20)
{
for (num=1 ; num<=15 ; num++) {
var findImage = Frame1.FindChild("Image"+operator+"_"+num)
findImage.SetScale(-setX,-setY)
//berekening van de grootte van de image
var tempber = 199*setX/2
//einde berekening
//findImage.SetPositionX(setX*100)
//ff testje
findImage.SetPositionX(tempber+JOINT)
//einde testje
findImage.SetPositionY(getY)
}
operator +=1
}
operator = 1
}
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// convert Width and Height into a scalable conversion ONLY X1 etc and Y1 etc
function Convert()
{
for (num=1 ; num<=20 ; num++)
{
var setX = eval("X1_"+num+ "=200*(String.format('2.2',Width/1000))")
var setY = eval("Y" +num+ "=200*(String.format('2.2',Height/1000))")
var checkX = setX *5
var checkY = setY *5
var nameX = String.right(checkX,1)
var nameY = String.right(checkY,1)
if (nameX == 0)
{
eval("X1_"+num+"=Number(setX)+Number(1)")
}
if (nameY == 0)
{
eval("Y"+num+"=Number(setY)+Number(1)")
}
}
}
////////////////////////
//////////////////////////////////////////////////////
var startX = 0
function alignX()
{
var getX = eval ("X1_1")
var AA = getX / 2
var placePosX = getX + Number(JOINT)
while (operator <= 20)
{
var tempall = 0
for (num=1 ; num<=15 ; num++)
{
if(num!=1)
{
tempall = (tempall + 2*(199*Width/1000/2))
}
else
{
tempall = (tempall + (199*Width/1000/2))
}
startX +=placePosX
var findImage = Frame1.FindChild("Image"+operator+"_"+num)
//findImage.SetPositionX(startX-AA)
findImage.SetPositionX(tempall+num*JOINT)
}
operator += 1
startX = 0
}
operator = 1
startX = 0
}
//////////////////////////////////////////////////////////////////////
///////////////////////////////////////
var startY = 0
function alignY()
{
operator = 2
var placePosY = Y1 + Number(JOINT)
while (operator <= 20)
{
startY += Number(placePosY)
for (num=1 ; num<=15 ; num++)
{
var findImage = Frame1.FindChild("Image"+operator+"_"+num)
findImage.MoveY(-startY)
}
operator += 1
}
operator = 1
startY = 0
}
//////////////////////////////////////////////////////////////////////
function Colour()
{
var sel_style = new Object();
sel_style.backgroundcolour = set_colour
var obj = eval("Data1");
obj.SetSelection(0, -1);
obj.SetSelectionStyle(sel_style);
}
////////////////////////////////////////////////////////////////////////////////////
function decor()
{
Debug.trace("\n uhm ->" + arrayNr)
Debug.trace("\n enne ->" + decorX[arrayNr] + " & " + decorY[arrayNr] + "\n")
var SST1 = Number(eval("decorX["+arrayNr+"]"))
var SST2 = Number(eval("decorY["+arrayNr+"]"))
if (imageNum !="" && Edit2 == "Decor")
{
var setX = String.format('2.2',SST1/1000)
var setY = String.format('2.2',SST2/1000)
var cloneA = eval("Image_dec"+imageNum).CloneObject()
cloneA.Show()
eval(cloneA).SetScale(-setX,-setY)
var pos = eval(name).GetPosition()
xPos = pos.x
yPos = pos.y
eval(cloneA).SetPosition(xPos,yPos)
}
if (Edit2 == "Decor" && imageNum =="")
{
Error = ws9
GotoPage("Page_error")
}
if (Edit2 != "Decor" )
{
Error = ws10
GotoPage("Page_error")
}
}
////////////////////
//////////////////////////////////////////////////
function xConvertScale()
{
var setX = String.format('2.2',Width/1000)
var setY = String.format('2.2',Height/1000)
var getY = 688-(setY*100)
var operator=1
while (operator <=20)
{
for (var num=1 ; num<=15 ; num++)
{
eval("Image"+operator+"_"+num+"x").SetScale(setX,setY)
var tempber = 199*setX/2
eval("Image"+operator+"_"+num+"x").SetPositionX(tempber+JOINT)
eval("Image"+operator+"_"+num+"x").SetPositionY(getY)
}
operator +=1
}
operator = 1
}
function xConvert()
{
for (num=1 ; num<=20 ; num++)
{
var setX = eval("X1_"+num+ "=200*(String.format('2.2',Width/1000))")
var setY = eval("Y" +num+ "=200*(String.format('2.2',Height/1000))")
var checkX = setX *5
var checkY = setY *5
var nameX = String.right(checkX,1)
var nameY = String.right(checkY,1)
if (nameX == 0)
{
eval("X1_"+num+"=Number(setX)+Number(1)")
}
if (nameY == 0)
{
eval("Y"+num+"=Number(setY)+Number(1)")
}
}
}
function xalignX()
{
var getX = eval ("X1_1")
var AA = getX / 2
var placePosX = getX + Number(JOINT)
while (operator <= 20)
{
var tempall = 0
for (num=1 ; num<=15 ; num++)
{
if(num!=1)
{
tempall = (tempall + 2*(199*Width/1000/2))
}
else
{
tempall = (tempall + (199*Width/1000/2))
}
startX +=placePosX
//var findImage = Frame2.FindChild("Image"+operator+"_"+num+"x")
eval("Image"+operator+"_"+num+"x").SetPositionX(tempall+num*JOINT)
}
operator += 1
startX = 0
}
operator = 1
startX = 0
}
function xalignY()
{
operator = 2
var placePosY = Y1 + Number(JOINT)
while (operator <= 20)
{
startY += Number(placePosY)
for (num=1 ; num<=15 ; num++)
{
//var findImage = Frame2.FindChild("Image"+operator+"_"+num+"x")
eval("Image"+operator+"_"+num+"x").MoveY(-startY)
}
operator += 1
}
operator = 1
startY = 0
}