[squeakland] [Q] How to delay an execution of a command tile
in a script
Karl Ramberg
karlramberg at gmail.com
Wed Nov 18 11:53:04 EST 2009
On 2009-11-18 16:01, p.a.dreyfuss at excite.com wrote:
>
> Hi,
> Very nice this project, all done in a morph that could be given to
> kids as a tool.
> it should be published on showcase.
> I have replaced the first demo by a solution for repeating sounds, it
> is not pure Etoys, it uses a script written in smalltalk for getting
> the length of the sound which is put in a variable.
>
> The rest uses what is done for delay. The timing is changed to ten
> ticks by second and the length is in tenth of second.
>
> The script delay, is called at the end of the script
> executeAction,initiating new cycle of delay and making executeAction
> recursive.The sound will repeat infinitely, each time the delay
> expires. To stop it, just pause the delay script.
> To start, just execute executeAction .
>
> I'm working at a different way, adding a duration tile to sound
> category but this wants more thinking.
>
>
> Sorry for the strange name of the project, it is due to Sugar, It was
> 'delayWithSound.' :-)
>
> Regards
>
Have you looked at the SoundPlayer>>waitUntilDonePlaying: method.
Maybe that could be added to Player so repeated sounds would wait until
the previous sample is done.
Karl
>
>
> -----Original Message-----
> From: "Ricardo Moran" [richi.moran at gmail.com]
> Date: 11/17/2009 08:49 PM
> To: "Young-Jin Lee" <youngjin.michael at gmail.com>
> CC: squeakland at squeakland.org
> Subject: Re: [squeakland] [Q] How to delay an execution of a command
> tile in a
> script
>
> Ive made this simple project with a "delay object". You can duplicate
> it and change the execute action script to perform anything you want.
> Then you simply run the "startDelay:" script with the duration as a
> parameter.I hope you find it useful. I dont know if there is an easier
> way, though.
>
>
> Cheers
>
>
> On Tue, Nov 17, 2009 at 8:19 PM, Young-Jin Lee
> <youngjin.michael at gmail.com> wrote:
> Hello,
>
> I am looking for a way to delay a certain action for a certain period
> of time. For instance, I have a book and want to flip the page when
> the mouse cursor is touch another Sketch. But, I want to delay the
> page flipping for a certain period of time instead of doing it right
> away because I want, for instance, to show a Text widget after the
> mouse cursor touched another Sketch, but before flipping the book
> page. Without delaying the flipping of a book page, I cannot even read
> the text in the Text Widget.
>
>
> Related to this, I am wondering if I can play a short sound clip
> repeated in a script that is being executed repeatedly. I want to play
> a certain sound repeated while a sketch is roaming around the World.
> If I put the "play sound" tile in the script that will make the Sketch
> roam the World, I got echoes because the "play sound" is invoked
> before the previous execution of the previous call to "play sound"
> ends as I invoke this roaming script repeatedly (by clicking on its
> clock icon on the scriptor).
>
>
> Is there a way to resolve these problems?
>
>
> Thanks in advance.
>
>
> Young-Jin Lee
>
> _______________________________________________
> squeakland mailing list
> squeakland at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/squeakland
>
>
>
>
>
> ------------------------------------------------------------------------
> Earn a Degree in Dental Assisting. Find Schools and Apply today!
> <http://tagline.excite.com/c?cp=J3xPWQy-KvdBCiXpAf0X4AAAKZRsWBNfypAEDSkjl6-6t56fAAQAAAAFAAAAADMzMz4AAANSAAAAAAAAAAAAAAAAABNllkAQ1ZQ=>
>
> Dental Assistant Degree
> <http://tagline.excite.com/c?cp=J3xPWQy-KvdBCiXpAf0X4AAAKZRsWBNfypAEDSkjl6-6t56fAAQAAAAFAAAAADMzMz4AAANSAAAAAAAAAAAAAAAAABNllkAQ1ZQ=>
>
> AllAlliedHealthSchools.com
> <http://tagline.excite.com/c?cp=J3xPWQy-KvdBCiXpAf0X4AAAKZRsWBNfypAEDSkjl6-6t56fAAQAAAAFAAAAADMzMz4AAANSAAAAAAAAAAAAAAAAABNllkAQ1ZQ=>
>
>
>
> _______________________________________________
> squeakland mailing list
> squeakland at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/squeakland
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakland.org/pipermail/squeakland/attachments/20091118/0fa01cb7/attachment.html
More information about the squeakland
mailing list