PDA

View Full Version : setSource not working with SOLO


balzacq
09-30-2005, 10:40 AM
I'm trying to load mp3 sound files at runtime from my SOLO-deployed application (dynamically choosing the mp3s based on other variables), and setSource isn't working, no matter how I structure the source string ("http://[blah]", "http:[blah]", "file:[blah]").

I've also put a crossdomain.xml file in the root directory of the virtual host I'm deploying to (copied from other crossdomain files we use for our other Shockwave and Flash applets).

I'm not getting any error messages in the debug window; the mp3s just aren't playing.

Is there something I have to put in the other setSource parameters to make this work, or do I have to figure out a Plan B?


Here's my code, stripped down. The purpose is to display text to a child, who can have the text read to them by clicking on it.


<class name="quizSoundText" extends="text" resize="true" fontsize="18" fontstyle="bold" clickable="true">
<method event="onclick">
this.setAttribute('fgcolor',0xff0000);
this.voiceover.play();
</method>

<view name="voiceover" visible="false" play="false">
<method event="onplay">
debug.write("playing: "+this.resource);
</method>
<method event="onlastframe">
parent.setAttribute('fgcolor',0x4ED8ED);
this.setAttribute('play',false);
</method>
</view>
</class>

<state name="question" apply="true">

<method event="onapply">
var s = "http://[myvirtualhost]/[filename].mp3";
questionText.voiceover.setSource(s);
</method>

<quizSoundText id="questionText" fontsize="24" fontstyle="bold" fgcolor="0xffcc66"/>

</state>

Shelby
09-30-2005, 11:03 AM
There is a bug in the current versions that prevent mp3's from being loaded at runtime. At least, I assume it's a bug.

If you search the forums, there are a few threads on this issue.

d~l
09-30-2005, 11:05 AM
Note that the syntax in latest versions of openlaszlo is case sensitive

so debug.write does not work

but Debug.write does work.