scripted animation advice

Malte Brill malte.brill at t-online.de
Wed Jun 30 04:17:28 EDT 2004


Hi Nicolas,

I´ve set up a small test stack:

Call this first from somewhere you need it:

on init
  put 8 into elements
  repeat with i=1 to elements
    create grc ("part"&i)
    set the style of grc ("part"&i) to oval
    set the height of grc ("part"&i) to 100
    set the width of grc ("part"&i) to 100
    set the loc of grc ("part"&i) to the loc of this card
    set the arcangle of grc ("part"&i) to 360/elements
    put 360/elements*i-1 into thestartAngle
    set the startangle of grc ("part"&i) to theStartangle
  end repeat
end init


button:

global flag

on mouseUp
  if flag is empty then put -1 into flag
  put flag*-1 into flag
  spinTheWheel
end mouseUp

on spinTheWheel
  repeat with i=1 to 8
    put the startangle of grc ("part"&i) into newangle
    put newangle-5 into newangle
    if newangle<1 then put newangle+360 into newangle
    set the startangle of grc ("part"&i) to newangle
  end repeat
  if flag=1 then send spinTheWheel to me in 20 milliseconds
end spinTheWheel


Hope that helps,

Malte



More information about the use-livecode mailing list