Oncomplete questions

  • I guess I'm missing how to use the oncomplete part of the playsound commands as I can not get it to work and yes I'm using the latest beta soundinterface.swf (build 2010-1-05)

    From the doc example:

    playsound2D(id, mp3file, volume*, pan*, loops*, oncomplete*);

    I coded this:

    if(start == 1, playsound2D(bkgmsc,DanceWithMe.mp3,.3,0,1,lightsoff()); );

    <action name="lightsoff">
    ...
    ...
    </action>

    This does NOT work, is the oncomplete a attribute, not part of a function or....? This code is accepted, but the oncomplete action "lightsoff" is NOT run.

    And are looping and oncomplete incompatible or is the soundtrack considered complete at the end of a loop?

    Regards,

    Robert

  • Hi Klaus, hope all is well.

    finally had some time to spend on this and while I've not figured out a real solution I know how to get the oncomplete to work.

    This is all part of the cube face hotspot flipping example. In it I'm flipping 4 sets of cubes via a perhaps a too tight or endless loop, an action that loops by calling itself. The playsound is started from this action. If I comment out the call to itself so there's no loop the oncomplete works.

    Is there a better way to code this so it loops and the oncomplete works? Here's my sample that does not work;

    <action name="autoblend">
    oninterrupt(action(setup); showtext.....);

    .
    .
    .
    if(start == 1, playsound2D(bkgmsc,DanceWithMe.mp3,.3,0,1,lightsoff()); );
    .
    .
    .
    autoblend();
    </action>


    <action name="lightsoff">
    ...
    ...
    </action>

    And one more questions, Is soundtrack looping and oncomplete incompatible or is the soundtrack considered complete at the end of a loop?

    Regards,

    Robert

  • Hi Klaus,

    I've tried paring down an example that would re-create the issue, but no luck. With a simple loop just calling itself, the oncomplete works.

    So, it still does not work in the cube flipping example I sent you when I first found this, but it must be something else in that code thats causing this behavior. And I guess it's not really important as if I do anything more with that I was planning to convert it to multi-frame anyway as that approach is so much more powerful and extended verses limited cube flipping. With multi-frame in the new version I just don't see any reason for the old cube flipping anymore.

    I tried a quick multi-frame test with 16 frames and it's unreal how fast it goes through them with the default timing. The cube flipping example started to "fail" after 8 or so cube sets.

    So, thanks for looking into this again, hope I did not waste too much time.

    Regards,

    Robert

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!