function newLine(xPos, yPos, x, y, thikness)
line = Shape.new()
line:setLineStyle(thikness, 0x000000, 1)
line:beginPath()
line:moveTo(0,0)
line:lineTo(x, y)
line:endPath()
stage:addChild(line)
line:setPosition(xPos, yPos)
end
--for horizontal line
newLine(0, 255, 480, 0, 1)
--for vertical lines
newLine(150, 256, 0, 5, 2) --line for 0
newLine(190, 256, 0, 3, 2) --line for 0.5
newLine(230, 256, 0, 5, 2) --line for 1
newLine(270, 256, 0, 3, 2) --line for 1.5
newLine(310, 256, 0, 5, 2) --line for 2
newLine(350, 256, 0, 3, 2) --line for 2.5
newLine(390, 256, 0, 5, 2) --line for 3
newLine(430, 256, 0, 3, 2) --line for 3.5
newLine(470, 256, 0, 5, 2) --line for 4
and so on...
Comments
That is why when you remove it from stage, only last one is removed, because line holds reference to the last created Shape object.
you could create lineLayer and add all lines to it, then remove this line layer from Stage like this:
similar king of code i was searching for...
thanks alot =D>
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975