loadMovie error


I run into an error when loading a video file I get from an xml file and I can’t figure out how to solve it.

This works:
VideoContainer.loadMovie( videos.getValue(“vid[0]”) );

But when I replace ‘0’ by an int variable, like this:

int whatVideo=btnSelect-1;
VideoContainer.loadMovie( videos.getValue(“vid[whatVideo]”) );

it crashes with this error:
openframeworks terminate called after throwing an instance of ‘Poco::SyntaxException’
what<>: Syntax error

Hopefully someone can tell me what I do wrong.

“whatVideo” is just being used as a string rather as a variable, so it’s literally searching the xml for “vid[whatVideo]”. try this:

VideoContainer.loadMovie( videos.getValue("vid["+ofToString(whatVideo)+"]") );

Hello genekogan, thanks for explaining, it works!