Hi Karl, Thanks for the help, The attached project is an empty project, just with a new tile in the sound category, playSoundUntilDone. If there are many ticking scripts, each sound is played at turn.
Accept saving changes when saving you project if asked for.(depending choices for saving).
Start with this project and rename it before saving, if you are using the new tile. Regards
-----Original Message----- From: "Karl Ramberg" [karlramberg@gmail.com] Date: 11/18/2009 12:00 PM To: "p.a.dreyfuss@excite.com" p.a.dreyfuss@excite.com CC: squeakland@squeakland.org Subject: Re: [squeakland] [Q] How to delay an execution of a command tile in a script
On 2009-11-18 16:01, p.a.dreyfuss@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@gmail.com] Date: 11/17/2009 08:49 PM To: "Young-Jin Lee" youngjin.michael@gmail.com CC: squeakland@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@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@squeakland.org http://lists.squeakland.org/mailman/listinfo/squeakland
Earn a Degree in Dental Assisting. Find Schools and Apply today! Dental Assistant Degree AllAlliedHealthSchools.com
_______________________________________________ squeakland mailing list squeakland@squeakland.orghttp://lists.squeakland.org/mailman/listinfo/squeakland
------------------------------------------------------------ Earn your MBA from Regis University, 100% online. Free info packs! Regis University MBA http://tagline.excite.com/c?cp=JCCA-z5scs2tMuSMXKTZUwAAKZT0djZnOxTFQCGmncBva...
squeakland@lists.squeakfoundation.org