How do I play audio in a sequence

How do I play audio in a sequence
0

#1

how can I play audio in this sequence? I have preloaded the audio already.

sequence%20help


#2
  1. post code, not screenshots.

  2. have you tried running the code you posted? What happens? Errors?


#3

Use lambda with CallFunc.

And you already have them, just put your sound code into lambda:

auto autoHideCallback = [this]()
{
    // add your code here
    hide();
};

Sequence* seq = Sequence::create(
    MoveTo::create(1.f, pos),
    DelayTime::create(8.f), // wait 8 sec
    CallFunc::create(autoHideCallback)
);

#4

when I go into the scene in which this code runs in, I am told that 'Unhandled exception thrown: read access violation.
this->my sprite-> was 0xDDDDDDDD.


#5

It’s another issue.
It seems your sprite variable is not initialized.


#6

yup, so, OP:

  1. post code

  2. thanks for posting the error…now we have a clearer path.