alice-teacher Using an audio file based on a condition

Leonel Morales litomd at gmail.com
Wed Dec 31 12:44:57 EST 2014


Hi,

I have a preliminary version in which I explored different options.
None of them worked other than the nested if, which I tried to avoid
as much as possible.

You can download it here:

http://ingenieriasimple.com/alice/LetArray.a3p

I found no way to put different sound files into an array.

But there is an option... You can insert 5, or as many as needed,
different objects of different classes, into the scene, made them
invisible, build a PlaySound method for each different class, put them
all in an array and call them as needed.

I personally haven't tried this solution as it looks complicated. What
I am trying to do now is to export the same class into different class
files and then edit the files to change the type. No success yet.

As soon  as I have a new version I will let you know.

CC you directly because list moderation these days could be slow :)

All the best for 2015!

Leonel

2014-12-28 23:35 GMT-06:00, Nalini Ujre <nalinir54 at gmail.com>:
> Hello all,
>
> I have a project where the audio needs to be played depending on certain
> conditions. For example, if the "c" key is pressed, it should play a
> certain sound. I want to know if there is a way to store the names of the
> audio files in an array and then use it as required instead of using the if
> conditional statement each time. There are about 15 audio files that are
> required in this project.
>
> I am using Alice 3.1
>
> Thank you
> Nalini
>


More information about the alice-teachers mailing list