resdesign's Forum Posts

  • This is not a Chrome issue only since the same happens in FF and Edge. But putting the music files in the sound folder does correct the not looping issue.

  • Problem Description

    music does not loop when exported to HTML5

    Attach a Capx

    http://mjpagedesign.com/download/testMusic.capx​

    Description of Capx

    I just made a test file with only one button and a play looping action

    Steps to Reproduce Bug

    • music loops in preview
    • music does not loop when plubished as HTML5
    • tried FF
    • tried Chrome

    Observed Result

    music loops in preview

    music does not loop when plubished as HTML5

    tried FF

    tried Chrome

    Expected Result

    Music should loop.

    Affected Browsers

    • Chrome: (YES) in preview - chrome does not play on local
    • FireFox: (YES)
    • Internet Explorer: (not tested)

    Operating System and Service Pack

    Windows 10 for dev

    testing on Mac and Windows 10

    Construct 2 Version ID

    Release 239 (64 bit) Built 15;57;55 Oct 25 2016

  • OK. So I think it must be a bug because I made several test files and the same thing happens. So I will post in the bug section.

  • So I turned off everything except the intro button. Still the music stops even though it is set to looping. It just does not make sense.

  • I could PM you a link to the file if you want to look at it.

  • I mean exported a HTML5 and playing the html file either locally or from a server.

  • BWT when I run in debug mode it shows the looping.

  • I did import a wav format and yes it stops after playing once but just when published. I also change music file to see if that would make a difference but it is the same. Also I checked with other comp I made with same code and they loop so I am not sure what I am doing wrong here. There has to be something but the fact that it does not stop in preview and only when published is strange.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have an intro screen with a button and when the button is pressed, the music starts:

    Touch - introButton - play music looping -10 "bgMusic"

    It loops fine in preview but when in browser it does not loop.

    Any idea? Could this be a bug? Should I have system every tick check if music is silent and then start it - which seems crazy tough.

    I have no code to stop it anywhere beside a music button which toggles the sound but I am not touching it during testing to make sure.

    The code for music button is:

    Touch on touched musicBtn audio set toggle silent

    if audio is silent musicBtn set opacity 50

    system else musicBtn ser opacity 100

  • In the example below in Edge Animate*, a different image is loaded according to what button is clicked. How could I implement that in C2?

    * Edge Animate uses a slightly modified javaScript where sym is the stage symbol. The individual button elements are all children of the div.

    I do not seem to find a way to address a series of buttons in this way.

    var buttons = sym.$("buttons").children();     
    
    $.each(buttons,function(i){
    	$(this).on("click", function(){ 
    			// do something when one of the button is clicked	
    			sym.$("images").css({"opacity":0.00});
    			sym.$("images").animate({"opacity":1.00},700).attr('src',"images/image" + i + ".png");				
    	});	
    })[/code:28umjxwf]
  • Thank you guys. After reviewing the samples lunarray provided at the beginning of the post, I saw that this was possible. I used 2 LiteTween one for position and one for opacity.

  • I am wondering if you can add 2 liteTween behaviors. I would like to have a position tween and an opacity tween. Is that posible? I tried to add both in the code windows with only one behavior but it did not work. Then I tried to add 2 liteTween which technically should work but then none of the properties work.

  • I am wondering if there is a way to create a function that will do something for different elements.

    Here is what I mean:

    I have several droppables (drag1 to drag6) that I want to go to a certain position when they are dropped. They first overlap an image (either one of d1 to d6) and then they are placed under the proper image.

    Right now it works but I basically have to repeat for each draggable:

    if drag1 is overlapping d1 then set drag1 position to d1.X and 202
    if drag1 is overlapping d2 then set drag1 position to d2.X and 202
    if drag1 is overlapping d3 then set drag1 position to d3.X and 202
    if drag1 is overlapping d4 then set drag1 position to d4.X and 335
    if drag1 is overlapping d5 then set drag1 position to d5.X and 335
    if drag1 is overlapping d6 then set drag1 position to d6.X and 335
    [/code:j876r2cs]
    
    Then I have to do this for drag2 to drag6.
    
    This seems so redundant.
  • 99Instances2Go - I used the following:

    if score = 6, set score to 7 
    if score = 7 slide in good [/code:2x9t1a0v]
    and it works.
    
    FYI, for the 'not so good slide' I added a new variable called 'done' and add 1 to it when any drop is done. At the end if check both score and done.
    [code:2x9t1a0v]if score < 6 and done = 6, then slide in 'not so good'.[/code:2x9t1a0v]
    
    [b]Thanks for your help.  I wish there was a way to mark your answer as correct.[/b]
  • Thanks for your input. I will try these and let you know probably tomorrow.