using a button in webplayer interface to choose between different background music
25 January 2017 16:00
hello everybody
so i create a scene with just a cube and a speaker in the project manager
i export it
i use a index.html with iframe
<iframe allowfullscreen src="webplayer.html?load=mybutton.json" width="800" height="500"></iframe>
i create a new button in the webplayer.html and in the webplayer.css
i create a code with a
sound_change_button.addEventListener("mousedown", button_changesound_click, false);
function button_changesound_click(e) {console.log("clicclic");}
ok it works until here
i place in my script
var m_scs = b4w.require("scenes");// console.log(m_scs);
var m_sfx = b4w.require("sfx");
but when i do
var spk = m_sfx.get_object_by_name("Speaker");
or
var spk = b4w.module.sfx.get_object_by_name("Speaker");
i get in my firefox consol
TypeError: m_sfx.get_object_by_name is not a function
or
TypeError: h is not a function
well there is something i do wrong but that?
so i create a scene with just a cube and a speaker in the project manager
i export it
i use a index.html with iframe
<iframe allowfullscreen src="webplayer.html?load=mybutton.json" width="800" height="500"></iframe>
i create a new button in the webplayer.html and in the webplayer.css
i create a code with a
sound_change_button.addEventListener("mousedown", button_changesound_click, false);
function button_changesound_click(e) {console.log("clicclic");}
ok it works until here
i place in my script
var m_scs = b4w.require("scenes");// console.log(m_scs);
var m_sfx = b4w.require("sfx");
but when i do
var spk = m_sfx.get_object_by_name("Speaker");
or
var spk = b4w.module.sfx.get_object_by_name("Speaker");
i get in my firefox consol
TypeError: m_sfx.get_object_by_name is not a function
or
TypeError: h is not a function
well there is something i do wrong but that?