How do I

Get help using Construct 2

Post » Fri Jun 17, 2016 4:53 pm

how to stop audio of construct2 game running inside an iframe by click of close button of iframe

My game is running inside iframe with audio playing but if I close iframe audio keeps playing in background. How to close audio when iframe is closed by click of button on iframe?
Subway Surfer Game Template: http://bit.ly/subwaysurfertemplate
B
60
S
23
G
1
Posts: 102
Reputation: 5,660

Post » Sat Jun 18, 2016 6:06 am

Are you talking about an iframe INSIDE of your project (using the html elements pack plugin) or is this an iframe running from the html page on a website with your project inside of it?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Tue Jun 21, 2016 11:06 am

SoldjahBoy wrote:Are you talking about an iframe INSIDE of your project (using the html elements pack plugin) or is this an iframe running from the html page on a website with your project inside of it?

~Sol

Hi Friend,

I have hosted game on some other webpage but that webpage is holding construct 2 game in inside iFrame. Now I have to place a close button on that iframe which closes game when clicked on close button(please note that browser won't be even closed only game will be closed). Here issue is if any audio is playing continiously in game and user click on close button of iframe , it closes iframe window but audio keeps playing in background . how to pause that audio on closing iframe.
Subway Surfer Game Template: http://bit.ly/subwaysurfertemplate
B
60
S
23
G
1
Posts: 102
Reputation: 5,660

Post » Wed Jun 22, 2016 3:33 am

Yeah, I have no idea what would be causing that or what the solution would be... maybe you need to have some code in the website itself to either change the URL of the iframe when it's closed to something that has no sound (like google.com) or some other method for muting the sound on the page (some javascript maybe?)

Does this problem happen in all browsers? Maybe it's a browser specific issue?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Tue Jun 28, 2016 11:34 am

SoldjahBoy wrote:Yeah, I have no idea what would be causing that or what the solution would be... maybe you need to have some code in the website itself to either change the URL of the iframe when it's closed to something that has no sound (like google.com) or some other method for muting the sound on the page (some javascript maybe?)

Does this problem happen in all browsers? Maybe it's a browser specific issue?

~Sol

Yes this is the issue with all website
Subway Surfer Game Template: http://bit.ly/subwaysurfertemplate
B
60
S
23
G
1
Posts: 102
Reputation: 5,660

Post » Tue Jun 28, 2016 8:17 pm

Wich site is it running ? I cant visualize it. Is it a close button from the site itself ? Is that 'thing' always on the same place (mouse wise) ? Can i see this site ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jun 29, 2016 6:06 am

99Instances2Go wrote:Wich site is it running ? I cant visualize it. Is it a close button from the site itself ? Is that 'thing' always on the same place (mouse wise) ? Can i see this site ?

Hi Friend,

You are right. close button is from site. This site has an iframe holding construct game inside it. How to close the audio inside construct 2 game when I tap on close button of site? Currently that work has been removed from the site where I was working. But hope u understood my requirement. plz help me
Subway Surfer Game Template: http://bit.ly/subwaysurfertemplate
B
60
S
23
G
1
Posts: 102
Reputation: 5,660

Post » Wed Jun 29, 2016 8:32 am

Can't you stop the audio based on where the mouse is ? (corner). I know you can't do this based on touch.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jun 30, 2016 4:46 am

99Instances2Go wrote:Can't you stop the audio based on where the mouse is ? (corner). I know you can't do this based on touch.


This code has to work on mobile only. Also I am not able to understand construct 2 code to control audio through external javascript. Can u help me in controling video/audio component using external js functions/commands for construct 2 games. I will be very greatful to you.
Subway Surfer Game Template: http://bit.ly/subwaysurfertemplate
B
60
S
23
G
1
Posts: 102
Reputation: 5,660

Post » Thu Jun 30, 2016 9:50 am

Well i am not a specialist at all, and certainly not in js codes. But i dont think that will help you. At the moment you close the iFrame, the inserted construct code is gone. I think. And you cant change the page that is embedding your code.

Did you try the conditions in the browser plugin ? No luck ?
On resized
Page is visible
On suspended
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 22 guests