0 Favourites

Help with a project

  • Okay, I thought this would be easy enough to figure out, but I am stuck in a silly part. I am trying to make a little player thing, which I want to use to play my games OST. The problem, is that I made it, so that when you click on the play icon, it plays the song and sets a variable called "Playing" to 1, and it also changes the play icon to a stop one. Problem is, things are happening too fast I think, and only one of the blocks happen, whichever is beneath the other one. So if the "play" block is under the the "stop" block, only the play block will happen, and vice-versa. I have tried using, trigger only once, but it is not working... I am clearly missing something.

    Here is the project with capx included.

  • here is my take on it.

    link to .capx

    sprite now has two animations. play and stop. and a Boolean variable "active" that toggles when its events trigger.

    It seemed like before it was doing all the events , so each click was starting the song, and also stopping it in the same tick. I'm also unclear if invisible will keep a sprite from being clicked. I've never tried.

    Others I'm sure will have a more elegant solution but hey I'm still learning    <img src="smileys/smiley1.gif" border="0" align="middle">

  • onzephyr: You provided an already elegant solution enough. Well done.

    Apparently it looked to me that Both sprites were clicked, since if you moved sprite2 away from sprite, the code of VampyricalCurse's capx worked.

    It maybe had to see with the z-order, I'm not sure though.

    Anyway, good job.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I see! I've tried the Boolean option before, but it wasn't working. I thought about animations, but I didn't think it would make a difference. The biggest difference I see, is that you used Sub-Events effectively, which I am not used to at all (I was an MMF2 user), I am gonna have to get around that sometime. =

    This solution is great and I do not think it needs anymore "elegance", it was clean and easy to understand. Superbly done, onzephyr. <img src="smileys/smiley16.gif" border="0" align="middle" />

    Now onto figuring out how to do this with 26+ songs. <img src="smileys/smiley29.gif" border="0" align="middle" />

  • Okay, since this issue has to do with this same project, I will post here.

    All is working well, the project works while in the editor and also after import... problem is, it will not work after uploading it to my server... Not only will the songs not play, but the code itself will not work either. It will work for the play part, but after stopping it, the sprites do not work anymore. O____O

    This is kind of weird, I cannot imagine why this is happenning??

    Here's the link.

  • Your link gives an error 404.

    Also where did you upload your sprites and medias ?

    It has probably something to see with your host, not giving access to the files, or the files sitting in the wrong place (not in the right folder or something), else all should be fine.

    Pay attention, online, "Player" is not the same as "player" (case-sensitive).

  • Your link gives an error 404.

    Also where did you upload your sprites and medias ?

    It has probably something to see with your host, not giving access to the files, or the files sitting in the wrong place (not in the right folder or something), else all should be fine.

    Pay attention, online, "Player" is not the same as "player" (case-sensitive).

    Could be, but this is the process I go through:

    Export app./game.

    Zip the folder, named by C2 itself (I never renamed anything)

    Upload to my Public folder on my server.

    Unzip the contents to its own folder, all names, folders, etc. have been kept, no names have be changed.

    I try the app. and it behaves extremely erratic.

    =\

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
144 24,223
ffman22's avatar
ffman22
Unread hot topic
157 12,704
megatronx's avatar
megatronx
Unread hot topic
0 Favourites
Kiira will help! :D
132 16,625
Kiira's avatar
Kiira