FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   param() doesn't change value
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: param() doesn't change value  (Read 619 times)
Koenie

170825270170825270koeniedesign WWW Email
param() doesn't change value
« on: Jun 29th, 2004, 1:35pm »

I've been doing some experiments with the param() function in Processing and the <param> tag in the HTML document and I found out something strange. I've made some JavaScript in the HTML document that changes the value of a param tag in the HTML document dynamically. I've double-checked the value really changes in the HTML document, however in Processing the value remains the same as the starting value of the parameter. I've been using both param() and getParameter(), but the value always remains the same as the starting value, even if it's dynamically changed in the HTML document.
 
Anybody know how to fix this or know any other way of getting JavaScript data into Processing?
 
Koenie
 

http://koeniedesign.com
justo


Re: param() doesn't change value
« Reply #1 on: Jun 29th, 2004, 5:25pm »

is it possible that somehow, when the applet is cached by the browser, it somehow locks in the parameters? it shouldnt, but it could do that on your platform...clear the cache and see what happens.
 
keep in mind that *none* of the interaction with the browser (ranging from <param> tags and javascript interaction to the start() and stop() methods) is guaranteed by sun to work...its up to the browser/OS makers and the java plugin on that platform. make sure everything fails gracefully.
 
JohnG

WWW
Re: param() doesn't change value
« Reply #2 on: Jun 30th, 2004, 10:39am »

Here's an example of an applet that does change with some JavaScript values.. It's not my code, or processing, but the sources are provided, so you should be able to root around and infd what you need if no one already knows.
 
http://ourworld.compuserve.com/homepages/jozart/symicon.html
 
narain


Re: param() doesn't change value
« Reply #3 on: Jul 2nd, 2004, 5:51pm »

params were never meant to be changed dynamically... Java applets came along when nobody had ever dreamt of Javascript, and a HTML page was as dynamic as, well, a paper page. I think params just serve as initial arguments for the applet, and won't change during run-time.
Instead, you have to get JS to talk to Java directly, using the DOM. (I think that's what JohnG's example is doing.) This JavaWorld article will show you what you're looking for.
 
justo


Re: param() doesn't change value
« Reply #4 on: Jul 2nd, 2004, 7:18pm »

ohhhh, i thought you meant when the page is rendered, a different value appeared in the param tag (via php maybe? obviously i'm a careful reader)...but you were talking about an applet in a dynamic html page....so yeah, what they said.
 
Pages: 1 

« Previous topic | Next topic »