We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
java.lang.NullPointerException (Read 744 times)
java.lang.NullPointerException
Mar 17th, 2007, 7:34pm
 
Hi there!

Someone knows a way to read a filename on the sketch folder and then change it? I'm playing in loop a quicktime movie from the sketch folder, but when I try to create another movie via moviemaker (from a web cam, to overwrite the first one), it says java.lang.NullPointerException (because they have the same name, I presume). Maybe a solution could be, once the webcam file has been created, to change its name and then read the file from processing.

Any suggestions?
Re: java.lang.NullPointerException
Reply #1 - Mar 17th, 2007, 9:54pm
 
When ever exporting a file I use this few lines to get an unique filename based on date and time.

Code:

Date now = new java.util.Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy MM dd HH:mm:ss");
String filename = formatter.format(now)+".mov";
Re: java.lang.NullPointerException
Reply #2 - Mar 18th, 2007, 9:47pm
 
Great piece of code! But the question remains: I did a little program to create a movie with current HH_mm_ss, but how recall the produced movie back in processing? Updating the values of the filename of the imported movie? Reading the filenames from the sketch folder?...

I´m new on processing and feel a bit confused about the way to proceed.

Thanks in advance.
Page Index Toggle Pages: 1