is anything wrong my code?
in
Core Library Questions
•
4 months ago
Hi there ^_^
i have something wrong my project
the error message is -> could not load movie file Special1.mov
but the file is exist same folder -_-
how can i fix it....?plz help me....
import processing.video.*;
Movie myMovie;
int elapsedFrames = 5;
ArrayList points = new ArrayList();
boolean drawing = true;
import ddf.minim.*;
AudioPlayer player;
Minim minim;//audio context
void setup() {
smooth();
size(800, 800);
noCursor();
myMovie = new Movie(this, "Special1.mov");
myMovie.loop();
background(255);
minim = new Minim(this);
player = minim.loadFile("he.mp3", 2048);
player.loop();
}
void draw() {
if (drawing == true) {
PVector pos = new PVector();
pos.x = mouseX;
pos.y = mouseY;
PVector vel = new PVector();
vel.x = (0);
vel.y = (0);
Point punt = new Point(pos, vel, 250);
points.add(punt);
fill(50, 100, 250);
ellipse(mouseX, mouseY, 1, 1);
}
for (int i = 0; i < points.size(); i++) {
Point localPoint = (Point) points.get(i);
if (localPoint.isDead == true) {
points.remove(i);
}
localPoint.update();
localPoint.draw();
}
elapsedFrames++;
image(myMovie,0,600);
}
void keyPressed() {
if (key == '1') {
for (int i = 0; i < points.size(); i++) {
Point localPoint = (Point) points.get(i);
localPoint.isDead = true;
}
noStroke();
fill(255);
rect(0, 0, width, height);
}
}
void mousePressed() {
drawing = true;
}
void mouseReleased() {
drawing = true;
}
void stop()
{
player.close();
minim.stop();
super.stop();
}
class Point {
PVector pos, vel, noiseVec;
float noiseFloat, lifeTime, age;
boolean isDead;
public Point(PVector _pos, PVector _vel, float _lifeTime) {
pos = _pos;
vel = _vel;
lifeTime = _lifeTime;
age = 0;
isDead = false;
noiseVec = new PVector();
}
void update() {
noiseFloat = noise(pos.x * 0.0025, pos.y * 0.0025, elapsedFrames * 0.001);
noiseVec.x = cos(((noiseFloat -0.3) * TWO_PI) * 10);
noiseVec.y = sin(((noiseFloat - 0.3) * TWO_PI) * 10);
vel.add(noiseVec);
vel.div(2);
pos.add(vel);
if (1.0-(age/lifeTime) == 0) {
isDead = true;
}
if (pos.x < 0 || pos.x > width || pos.y < 0 || pos.y > height) {
isDead = true;
}
age++;
}
void draw() {
fill(0);
noStroke();
ellipse(pos.x, pos.y, 1-(age/lifeTime), 1-(age/lifeTime));
}
};
1