Bonsoir problème,
not sure what might cause this rectangle, but here some general hints:
1. ... in 2 millisecs
Means you fire 500 "Moveball" commands per second, noone will notice a 500 FPS animation!
And I'm not really sure that Livecode will handle this sufficiently for more than a couple of "balls"
2. I hope you have an "emergency" button that will stop these pending messages if neccessary!
3. Some syntax problems:
...
## set the location of graphic graphicObject to (the item 1 location of graphic graphicObject + 1), (the item 2 location of graphic graphicObject)
...
You can use abbreviations for most LC object type and property names!
...
set the loc of grc graphicObject to (item 1 OF THE location of grc graphicObject + 1), (item 2 OF THE loc of grc graphicObject)
...
Maybe just modifying the loc itself will be a little faster.
Since we only modify the first item, we do not need to query this property a second time!
...
put the loc of grc graphicObject into tLoc
add 1 to item 1 of tLoc
set the loc of grc graphicObject to tLoc
...
4. Setting the neccessary properties directly in "the templategraphic" might even add a little more speed.
Code: Select all
command Fire
set the style of the templategraphic to "oval"
set the width of the templategraphic to 28
set the height of the templategraphic to 12
set the opaque of the templategraphic to true
set the backgroundColor of the templategraphic "ball" to "red"
set the name of the templategraphic to "ball"
--set the loc of the templategraphic to ...
## All preparations successfull, now we can:
create graphic
##send "MoveBall" && "ball"
## No need to send a command if it is in the same script or script hierarchy!
## Just execute it:
MoveBall "ball"
## Always good style:
reset the templategraphic
end Fire
5. Sorry, no quick and brilliant idea for your numbering and animation problem.
You will need to give all your graphics different names, since LC cannot differ objects with the same name!
In that case it will the address the object with this name in the lowest layer!
Best
Klaus