RosettaCodeData/Task/Active-object/Lingo/active-object-2.lingo

20 lines
359 B
Plaintext

global gIntegrator
-- entry point
on startMovie
gIntegrator = script("Integrator").new("sin(PI * t)")
timeout().new("timer", 2000, #step1)
end
on step1 (_, timer)
gIntegrator.input("0.0")
timer.timeoutHandler = #step2
timer.period = 500
end
on step2 (_, timer)
gIntegrator.stop()
put gIntegrator.output()
timer.forget()
end