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)
   Event Handling in processing
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Event Handling in processing  (Read 479 times)
Andre_Michelle

WWW
Event Handling in processing
« on: Jul 29th, 2004, 2:39am »

hi,
 
 
i need some event handling in my game, i'm currently working on.
 
Something like:
 
logic.addEventListener( 'onCompleteLevel' , SoundSys );
 
Normally I'm working with FlashMX2004. There is an EventDispatcher to work with. Is something similar possible in processing ?
I don't know how to define functions to override...
 
arielm

WWW
Re: Event Handling in processing
« Reply #1 on: Jul 29th, 2004, 3:31am »

not sure it's clear enough (due to lack of time to develop the explainations), but the following could be useful:
 
http://processing.org/discourse/yabb/board_Syntax_action_displa_y_num_1089324616.html
 

Ariel Malka | www.chronotext.org
Andre_Michelle

WWW
Re: Event Handling in processing
« Reply #2 on: Jul 29th, 2004, 9:37am »

i see, is there no solution to trigger an event by object[methodname] ?
 
anyway, i will try this above.
 
arielm

WWW
Re: Event Handling in processing
« Reply #3 on: Jul 29th, 2004, 10:56pm »

on Jul 29th, 2004, 9:37am, Andre_Michelle wrote:
i see, is there no solution to trigger an event by object[methodname]

 
well, yes there's this thing called reflection in java that enables this kind of... bzzz... interruption... alegory on its way...
 
there was that man (it's a long story) who time-traveled from the 18th century right into the middle of the nineties. i met him once, and he wanted to go to the rest-room, so i showed him the way, but then he came back and asked: "er, where is the big water bucket" "for what" i asked him... "for flushing water of course!" "ah, okay..." then i had to explain him that nowadays there's an automatic niagara system in most of the rest-rooms...
 
bad-taste one, sorry i couldn't resist
 
now more seriously: javascript/actionscript are providing some constructs that are very flexible on one side, but totally irrelevant in a java world.
 
myObject["myMethodName"](myParam);
 
is a good example: makes sense in javascript, feasible in java but still: no one feels the need to use that.
 
first, it's terribly overkill in term of performance, and since you need "reflection" in java in order to do that (and since it's much more complicated than in javascript): if you're confident enough with java to handle reflection, then by this time you have enough wisdom anyway to know how to solve the problem without reflection!
 

Ariel Malka | www.chronotext.org
Pages: 1 

« Previous topic | Next topic »