hello,
i wrote a programm that displays images randomly. after a mouseclick another pair will be shown. on my maschine it runs without any problems.
exported it and uploaded the applet to a webspace to test, the programm did not function anymore.
the java concole says:
file image "0.jpg" is missing or inaccessible, make sure the URL ...
i placed the images into the same directory the applet is.
here is the code:
Quote:
int bilderanzahl = 22;
int textanzahl = 9;
int markergroesse=50;
int bildx = 250;
int bildy = 188;
int textzeile = 35;
PImage[] bilder = new PImage[bilderanzahl];
PFont schrift;
boolean start = true;
void setup() {
size(bildx*2,bildy+textzeile);
strokeWeight(3);
noFill();
smooth();
for(int i=0; i<bilderanzahl; i++){
String bildnummer= i + ".jpg";
bilder[i] = loadImage(bildnummer);
}
}
void draw(){
if (start == true){
marker();
}
start = false;
}
void mousePressed(){
marker();
}
void marker(){
background(20);
bildwahl();
textwahl();
stroke(255,0,0,150);
float ellipsex1 = random(markergroesse/2,(width/2-markergroesse/2));
float ellipsey1 = random(markergroesse/2,((height-textzeile)-markergroesse/2));
float ellipsex2 = random(width/2+markergroesse/2,(width-markergroesse/2));
float ellipsey2 = random(markergroesse/2,((height-textzeile)-markergroesse/2));
ellipse(ellipsex1,ellipsey1,markergroesse,markergroesse);
ellipse(ellipsex2,ellipsey2,markergroesse,markergroesse);
}
void bildwahl(){
image(bilder[round(random(0,bilderanzahl-1))],0,0);
image(bilder[round(random(0,bilderanzahl-1))],width/2,0);
}
void textwahl(){
schrift = loadFont("Silkscreen-21.vlw");
textFont(schrift, 21);
fill(245);
String randomtext;
String[] texte = new String[textanzahl];
texte[0] = "transformieren"; //kontext
texte[1] = "zusammen denken"; // material
texte[2] = "analogie";
texte[3] = "differenz";
texte[4] = "prinzip";
texte[5] = "semantik";
texte[6] = "funktion";
texte[7] = "form";
texte[8] = "farbe";
randomtext = texte [round(random(0,textanzahl-1))];
textAlign(CENTER);
text(randomtext, width/2, height-10);
noFill();
}
do you know whats wrong?
cheers,
slex
(edited the subject)