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
   Integration
(Moderators: fry, REAS)
   Integrating P55 with Flash and/or Director
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Integrating P55 with Flash and/or Director  (Read 890 times)
Exint
Guest
Email
Integrating P55 with Flash and/or Director
« on: Feb 6th, 2004, 9:50pm »

Hello,
 
Do you guys know of ways to integrate processing with Flash or Director. I was thinking of using P55 along with a webcam, I just need to find a way to send the coordinates of a hand (for example) to Flash or Director without having to much of a lag.
 
Thanks in advance
 
ian

WWW
Re: Integrating P55 with Flash and/or Director
« Reply #1 on: Feb 9th, 2004, 5:25am »

i would just make a multiuser server in java - here's an example to start out with:  
 
http://stage.itp.nyu.edu/danclass/dspace/FILES/ChatServer/
 
make a socket connection from processing to the server, likewise with flash - then just bounce the points from processing across the server to flash. socket connections are pretty easy with both processing and flash and the configuration would definitely be fast enough for a stream of coordinate points.
« Last Edit: Feb 9th, 2004, 5:26am by ian »  
michael05

WWW
Re: Integrating P55 with Flash and/or Director
« Reply #2 on: Feb 9th, 2004, 12:05pm »

i had a similar problem with director. the multiuser functions are really strange. i did not manage to communicate with a cocoa application via udp.
 
so i just used the clipboard. and it worked for transmitting text.
 
in director its very easy. in java / processing its a bit more tricky. but this code could help:
 
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.DataFlavor;
 
public class clipboardTest extends BApplet
{
  Transferable clipData;
  Clipboard clipboard;
   
  void setup()
  {
    size(640,480);
    clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipData = clipboard.getContents(null);
  }
   
  void loop()
  {
    boolean hasTransferableText = (clipData != null) && clipData.isDataFlavorSupported(DataFlavor.stringFlavor);
    if(hasTransferableText)
    {
 try
 {
   String hu = (String)clipData.getTransferData(DataFlavor.stringFlavor);
   println (hu);
 }
 catch (Exception e)
 {
   println(e);
 }
    }
  }
}
 
 
 
if you get a network conection between your apllication use it instead of the clipboard.
 

°°°°°°°°°°°°°°°°°°°°
http://www.m05.de
Exint
Guest
Email
Re: Integrating P55 with Flash and/or Director
« Reply #3 on: Feb 10th, 2004, 7:01pm »

So basically I'll just have to use sockets in some way.
 
I was thinking of letting P55 write an XML file and let Flash or Director read the file, but I'm affraid this will cause some lag.
 
ian

WWW
Re: Integrating P55 with Flash and/or Director
« Reply #4 on: Feb 10th, 2004, 11:39pm »

i'd go for the sockets - it's surprisingly straightforward with both flash and p5 - there is a catch with flash that you need to end each send command with a carriage return - can't remember which character, but i could send you some sample code if you end up using flash - shoot me an email: ian (at) nobodaddy.org if you want it.
 
Ale_k

WWW
Re: Integrating P55 with Flash and/or Director
« Reply #5 on: May 26th, 2004, 9:03pm »

Hi,
I don't know if this is what you need ( and I didn't test it) but this xtras looks interesting:
http://www.integrationnewmedia.com/products/mokaxtra/
 
Alessandro
 
 
Pages: 1 

« Previous topic | Next topic »