I'm doing a scrip to resize all controls inside a group based on a slider. However, I'm getting an "Chunk: source is not a container" error and don't understand why.
(I'll highlight the error bellow)
Maybe someone can help me?
here's my script:
script on SLIDER
Code: Select all
On scrollbarDrag
put the thumbPosition of me into field "zoomValue"
put the thumbPosition of scrollbar "zoomSlider" / 100 into zfactor
ResizeGroupContentByFactor (group "game_content_area", zfactor) -- ## Error occurs in this line ###
end scrollbarDrag
Code: Select all
-- resize play area components
Function ResizeGroupContentByFactor cGroup, zFactor
lock screen
put GetGroupElements(group cGroup) into eArray
put the number of lines of (the keys of eArray) into nrElems
repeat with i = 1 to nrElems
put the MesDim of control eArray[i] into tDim
put round(item 1 of tDim * zFactor) into tW2
put round(item 2 of tDim * zFactor) into tH2
set the width of control eArray[i] to tW2
set the height of control eArray[i] to tH2
end repeat
end ResizeGroupContentByFactor
-- Get all Elementos of a Group
Function GetGroupElements cGroup
put 1 into i
put the number of controls of group cGroup into nrElems
put empty into tArray
repeat for (nrElems) times
put the name of control i of group cGroup into line i of tArray
add 1 to i
end repeat
return tArray
end GetGroupElements
- Miguel