+1
start/stop audio
Was unable to stop audio from playing. Loading 124 seconds long mp3 file from "oninit" action to play continuously and then want to stop it using button click:
But it never stops. What's wrong?
<main>
<image name="sound" alias="SOUND" source="images/mute.png" xpos="100" ypos="100" onclickup="stop-music"/>
</main>
<actions>
<action name="initialize" oninit="yes">
<play action="music1" />
<action>
<action name="music1">
<sound action="play" source="sound/s1_music" type="mp3" />
<play action="music2" delay="125" />
</action>
<action name="music2">
<sound action="play" source="sound/s1_music" type="mp3" />
<play action="music1" delay="125" />
</action>
<action name="stop-music">
<sound action="stop" source="sound/s1_music" type="mp3" />
</action>
</actions>
But it never stops. What's wrong?
Service d'assistance aux clients par UserEcho
<wire>
<main>
<image name="sound" alias="SOUND" source="button.back.png" xpos="100" ypos="100" onclickup="stop-music"/>
</main>
<actions>
<action name="init" oninit="yes">
<play action="clip" _action="play" _source="baseball1" _type="m4a" />
</action>
<action name="clip">
<sound action="_action" source="_source" type="_type"/>
<play action="clip" _action="_action" _source="baseball1" _type="m4a" delay="3" />
</action>
<action name="clip-stop">
<sound action="_action" source="_source" type="_type"/>
</action>
<action name="stop-music">
<play action="clip" _action="stop" _source="baseball1" _type="m4a" />
<alert message="STOP"/>
</action>
</actions>
</wire>
It works now for one WIRE file. But when I'm trying to close subwire and start music in main wire, fusebox crushes. I think it can't find "start-music" action when returning from subwire. Here is the code:
from main.wire:
<main>
<image name="subwire" alias="SUB" source="images/click.png" xpos="100" ypos="100" onclickup="SCENE1"/>
<include name="scene" alias="SCENE" width="100%" height="100%" background="#000000" alpha="0"></include>
</main>
<actions>
<action name="initialize" oninit="yes">
<play action="start-music" />
<action>
<action name="music">
<sound action="_action" source="_source" type="_type" />
<play action="music" _action="_action" _source="_source" _type="_type" delay="125" />
</action>
<action name="stop-music">
<play action="music" _action="stop" _source="sound/s1_music" _type="mp3" />
</action>
<action name="start-music">
<play action="music" _action="start" _source="sound/s1_music" _type="mp3" />
</action>
<action name="SCENE1">
<play action="stop-music" />
<load file="scene1.wire" wirename="scene1" target="SCENE" />
<alpha value="1" time=".5" target="SCENE" />
</action>
<action name="CLOSE-SCENE1">
<sync>
<unload delay=".1" />
<alpha value="0" time=".5" />
</sync>
</action>
</actions>
for subwiere scene1.wire:
<main>
<image name="mainwire" alias="MAIN" source="images/click.png" xpos="100" ypos="100" onclickup="MAINWIRE"/>
</main>
<actions>
<action name="MAINWIRE">
<play action="CLOSE-SCENE1" superwire="yes" target="../.." />
</action>
</actions>
if I put "play action="start-music" " somewhere in CLOSE-SCENE1 or MAINWIRE actions, fusebox crushes when executing it.
<action name="MAINWIRE">
<play action="START-MUSIC" superwire="yes" target="../.." />
<play action="CLOSE-SCENE1" superwire="yes" target="../.." />
</action>
<action name="MAINWIRE">
<play action="start-music" target="../.."/>
<play action="CLOSE" target="../.." />
</action>
That's strange. I'm using "superwire" parameters in my other multiwire app and it works.