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.
IndexProgramming Questions & HelpIntegration › Transparent Background of Application (wmode)
Page Index Toggle Pages: 1
Transparent Background of Application (wmode?) (Read 647 times)
Transparent Background of Application (wmode?)
Oct 31st, 2007, 11:10am
 
Hello there,

Im pretty new to Processing, but I love it already. I tried to embed a applet in my Website, and wanted to know if it is possible to make the backgrund of this applet transparent, similar to the wmode parameter when embedding flash-content. If you have a look at my <a href=http://www.paulhoepner.de>site</a>

Another possiility would be to pass the color vaiable from javascript to the application, is that possible?

Re: Transparent Background of Application (wmode?)
Reply #1 - Oct 31st, 2007, 12:01pm
 
use param()

http://processing.org/reference/param_.html

F
Re: Transparent Background of Application (wmode?)
Reply #2 - Oct 31st, 2007, 12:28pm
 
Thanks for your quick reply. That solves a lot of questions actually. But, do you know if it is possible to change that parameter with javascript? Because I don´t just want to pass the variable when the page is loaded, but in a ceratin interval.

And maybe you knwo how to convert a String like "#f3f5f9" to an RGB value, too?

Sorry for so many questions, I´m trying my best.


Re: Transparent Background of Application (wmode?)
Reply #3 - Oct 31st, 2007, 1:14pm
 
I got everything working so far, the problem now seems to be, that even if the parameter was changes by javascript, the applet will not apply the changes, though the param is passed within the draw() function. Any Ideas?
Re: Transparent Background of Application (wmode?)
Reply #4 - Oct 31st, 2007, 1:50pm
 
no, params are read only when the applet tag is loaded the first time. they will not be read again later on.

to pass values from js to java (processing) you'd have to make javascript talk to the applet directly (which is not as trivial as it sounds since there are many bugs and browser-problems .. and no good way to test or catch them).

an easier way to get the same effect (changing background color) is to have the applet call javascript instead. appletobject has a somewhat multibrowser-multi-os-callback here (look for callback(), you will need to change some code in there to call your specific js-function).

F
Re: Transparent Background of Application (wmode?)
Reply #5 - Oct 31st, 2007, 2:33pm
 
Thanks. I tried hard, but I don´t get how that callback() works. Maybe a little to complicated for me as a beginner.

What I would need was something like that:

int myJAVAvar=10;

setVarFunction(myJAVAvar,myJSvar){
//something that makes myJAVAvar = myJSvar
}
I guess that callback() is something similar, but I just don´t get it.

Thanks a lot anyway. This forum seems to really be helpful!  
Page Index Toggle Pages: 1