Animation frame

  • Hey all, I'm rly idiot because I can't create simple event ><

    There's .capx file with my problem: ge.tt/6vClebw/v/0

    What I want to achieve is that when any user click on button, when sound is playing button frame on that time is number 1, but when it stop, it come back to frame 0

  • It is the way you name your tag that goes wrong.

    Try this out:

    <img src="https://dl.dropboxusercontent.com/u/2560922/mobiledev/forum/stopSoundOnTag.png" border="0" />

    The problem is that your event Audio -> on sprite.sound ended

    In the Touched event you have touched a sprite, so it will know what sprite.sound to pick. But in the ended event. Which sprite.sound value should it pick?

  • cvp

    Your solution is good for one button, but what, when each button will have other sound, and they are pressed on the same time?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your solution is good for one button, but what, when each button will have other sound, and they are pressed on the same time?

    The events should work with any number of buttons/sounds. I'd place different buttons as different animations to that single object.

  • vee41

    Event unfortanely don't work so good. When I press one button and sound is playing and then press other button, where song is shorter, both turn to sprite 0, not only that one which end but also that one which is still playing.

    If I understand you right with: ". I'd place different buttons as different animations to that single object."

    I've one sprite object with diffrent animation frames for all buttons like there: ge.tt/6vClebw/v/0

  • My bad, I stand corrected. :)

    Here is fixed version: animation frame change when sound ends

    Not the prettiest of solutions but works.

  • vee41

    It still isn't change :(

    When few sounds are playing they should be frame 1, when one of them end that one change frame to 0 rest of them if they're still playing stay on frame 1

    I tryied do loop for each,but I got js errors

  • The .capx I posted works for me, when you click on button it changes the frame to 1 while sound is playing. Sprites frame changes to 0 when it is not playing a sound effect. You can have as many buttons/sounds as you need. Wasn't that the goal or did I miss something? :)

    Edit: As always, don't bother running anything HTML5 related in Internet Explorer as it won't work as intended.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)