We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, here is my program which contains 2 sounds and 2 videos, each one connected to one key. I think everything is almost rightly coded but some error message appear at the end, and my last line" void movieEvent(Movie movie) {" is highlighted.. I dont understand, thanks for your helpp
/** Affiche tactile interactive - * Quand on appuie sur une touche, cela lance une image, une vidéo, une annim, un son, etc... / /// librairies import processing.sound.; import processing.video.*;
// variables globales SoundFile son; // un son Movie vid; // une vidéo
// bouton son actif ? boolean son_actif = false; float tempsDebutSon = 0; // temps du début de la musique a été joué
// bouton son actif1 ? boolean son_actif1 = false; float tempsDebutSon1 = 0; // temps du début de la musique a été joué
// bouton video active ? boolean video_active = false;
// bouton video active1 ? boolean video_active1 = false;
void setup() { //size(); noStroke(); background(0); fullScreen ();
// chargement du son son = new SoundFile(this, "NORMAL.mp3"); //println(son.duration());
// chargement du son1 son1 = new SoundFile(this, "MODIF.mp3"); //println(son.duration());
//// chargement de la video vid = new Movie(this, "videos/VID1.mp4");
//// chargement de la video1 vid1 = new Movie(this, "videos/VID2.mp4");
}
void draw() {
// gestion du son : voir dans keypressed()
// gestion de la vidéo ////////////////////////////////////////
if (video_active){
image(vid, 0, 0, width, height);
}
if (video_active1){
image(vid, 0, 0, width, height);
}
}
void keyPressed() { if (key == CODED) { if (keyCode == RIGHT) { // son if (son_actif==false){ // le son ne joue pas son.play(); // lancer le son son_actif = true; // bouton son_actif on
if (key == CODED) { if (keyCode == RIGHT) { // son1 if (son_actif1==false){ // le son ne joue pas son.play(); // lancer le son son_actif1 = true; // bouton son_actif on } } if (keyCode == UP) { // video // chargement de la video vid = new Movie(this, "videos/VID1.mp4"); // lancement de la video en boucle vid.loop(); // bouton actif video_active = true; //arreter les autres animations video_active1 = false; } if (keyCode == LEFT) { // video1 // chargement de la video1 vid = new Movie(this, "videos/VID2.mp4"); // lancement de la video en boucle vid.loop(); // bouton actif video_active1 = true; //arreter les autres aninmations video_active = false; } } }
void movieEvent(Movie movie) { m.read(); }
Answers
edit post, highlight code, press ctrl-o to format.
this is probably a missing bracket. use ctrl-t in the editor to indent your code nicely and help you see the problem.
Sorry I'm novice aha.. They also saying me that :
In the image in line 11(!) the ; at the end of the line is missing
that picture of the code doesn't match the posted code...
Thanks for you're answers, @chrisir I corrected what u said but it'still doesn't work..
And Here is all the code
[images of code deleted]
Please not pictures of your code. Copy and paste your code directly in the forum. Read the forum FAQ to learn how to format the code properly in the forum.
Kf
in addition: what doesn‘t work...?
Okk, sorry I'm a french noob aha
Then, at the end an error message : unexpected token : void And the line 121 is highlighted
8-|
Check your }
Hit ctrl-t first
You must have one more } after line 84 for example
where does keyPressed() finish?
the fact the the last method isn't alligned to the far left is the hint here