how can I play audio in this sequence? I have preloaded the audio already.
-
post code, not screenshots.
-
have you tried running the code you posted? What happens? Errors?
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)
);
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.
’
It’s another issue.
It seems your sprite variable is not initialized.
yup, so, OP:
-
post code
-
thanks for posting the error…now we have a clearer path.