i have built an "if else" that need to check if a file exist and if it is, to play it, other wise to play a different file.
i use this in a bigger "if else", and i get a weird results, if the "if" statement is correct, no sound will play (other blocks will work) , but if the "else" statement is correct then only the default sound will play (circled in yellow in the picture) , and the other file will not, even when he exist.
Check you file paths here
This sets the path to /ASD/ASD/file so will probably always return false, if the file exists in /ASD/file
i do not understand why it will be /asd/asd/file ?
if i use it with the file without the "exist" procedure (like in the picture)
and even if it true then why the default sound (in the "else" statement) do not work?
How did you set the default file scope in the properties of the screen?
What @TIMAI2 is trying to say is that you have to remove the getASD method from the File.Exists method and use only the file name good.3gp because the file scope is App, which is the ASD
do you mean for this?
like this ?
but then why without the "exist" procedure (like in the picture) it work ?
Yes, this should work.
It should also work with it.
it work with the "else" statement but the "if" do not work (circled in yellow) while the other blocks in this "if" (circled in blue) work.
it work in the companion, when i press "do it" on the "player1.start" but it still do not give any sound when i press the image.
when i disconnected the choose_number procedure, it worked
there is something wrong with "call" after "call"?
It looks like you have problems to play a sound, which is stored in the assets of your app? Is this correct?
What about creating some simple example blocks as simple as possible as test? Then if you get theae running add more complexity...
the sound work if i disconnect the "choose_number" procedure
like in the picture, it only do not work when "call player1.start" is connected to "call choose_number".
What is chooseNumber doing? Show the content of that procedure.....
i suspect that i need to wait until the player finish then run this, maybe a delay, or to know if it finish playing?
You forgot to provide a screenshot of that procedure...
this one ?
well, as you can see yourself, inside that procedure you are setting again the source of Player1 and call Player1.Start again... does this make sense? what do you think?
please show us the Do it results
yes, but i want to put 2 different sounds, one after the other.
so i need to wait for the player1 to finish? if so how to know it finished ?
use the Player.Completed event
but then it will call "choose_number" every time?
i need it only part of the time, sometimes i do not want it to run this procedure.