Home > Adobe/Flash/Flex, downloads > Flosc AS3 Classes

Flosc AS3 Classes

March 2nd, 2007

Flosc (Flash Open Sound Control) is a project by Ben Chun that looks like it’s been around for a while but I’d never heard of until I had call to use it in FWiidom.

In fact I’d never heard of Open Sound Control either, but apparently it’s intended as something akin to clunky old MIDI, but over TCP. Flosc is a little Java server that sits and intercepts OSC packets and turns them into Flash XML packets. The classes in the zip below will allow you to connect easily to the Flosc sever and send and receive events and data to any connected OSC device.

I was using these classes for two way communication between Flash and Glove Pie (and thus the Wiimote) and it all worked fine. In theory you should be able to control any OSC device, including some pretty cool sound kit such as MaxMSP or Traktor.

>> Download Flosc AS3 Classes <<
This zip just contains the new AS3 classes, you’ll still need to get the main Flosc files.

oldskool73 Adobe/Flash/Flex, downloads

  1. March 2nd, 2007 at 19:51 | #1

    Wow. Excellent. I was using FLOSC to communicate with a MakeController and I was a little bummed out that it was still in AS3. Thanks for the work!

  2. June 16th, 2007 at 16:41 | #2

    Awsome download, ive been looking for something to do this for ages. Thanks a lot

  3. June 27th, 2007 at 07:42 | #3

    Nice works.
    I test these classes. then “parseXml” function cant parse “int” type data.
    –if (type==”i”){….}

  4. July 27th, 2007 at 22:56 | #4

    I’ve been one of the peeps using your AS3 classes with the Make Controller. I just wanted to let you know that I’ve been writing a series of articles that use those classes – so thank you for coding them up. I have also found a bug when using them with the Make Controller. Check out http://phy5ics.com/blog/2007/07/26/getting-started-with-as3-and-the-make-controller-part-2-let-the-hacking-begin/ for details and let me know if there is anything I can contribute.

  5. Andrei Thomaz
    January 16th, 2008 at 18:33 | #5

    hello,

    I’m afraid I’ve found a bug in your code. The AS3 reference (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/) says that XMLSocket.connect() returns void, but, on line 40 of OSCConnection.as, you evaluate the value returned by connect(). If I’ve understood well, you should catch the errors thrown by connect(), but not evaluate its result.

    I’ve found this problem because I was always getting an ON_CONNECT_ERROR event, despite the connect being properly established. Ignoring this error worked for me, but I don’t think this is the best procedure.

    Anyway, thanks for your code. And I’m also surprised that Flash CS3 generates no error or warning for line 40.

    best regards,
    andrei

  6. January 16th, 2008 at 20:58 | #6

    Hey Andrei,
    I’ve not updated these for a while, you may want to take a look at John’s site, a few guys there were fixing up a whole pile of my stupid bugs :)

    http://phy5ics.com/blog/2007/08/20/as3-make-controller-important-update-aka-not-part-5/

  7. April 1st, 2008 at 04:16 | #7

    I found a bug in the Send OSC Packet. FLOSC expects the arguments to be in this order: TYPE then VALUE – so you have to replace your code with this:

    for (var i:Number=0; i

  8. aymeric
    September 5th, 2008 at 14:13 | #8

    I can’t make the java gateway work on Windows Vista. Typing java Gateway 7000 3000 in the DOS prompt gives me an error :

    D:\LIVE\Woui\FLOSC\flosc-0.3.1\flosc-0.3.1>java Gateway 7000 3000
    Exception in thread “main” java.lang.NoClassDefFoundError: Gateway
    Caused by: java.lang.ClassNotFoundException: Gateway
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)

    I have tested it on Windows XP and it works !
    Would you have any idea on how to make this work on Vista ?
    thanks for any suggestion.

  9. Jelani
    October 12th, 2008 at 20:36 | #9

    Thank you thank you thank you for this! I have been banging my head against a wall for a couple weeks trying to get max/msp to talk to flash through flosc and all the tools, tutorials, examples I found were for as2 and I couldn’t get as3 to see & process the osc packets. I wrote a test file in as3 using your OSC classes and it works! cheers

  10. September 6th, 2009 at 03:26 | #10

    FYI – the FWiidom as3 code doesn’t work with integer data type.

    modified OSCConnection.as line 113 to include:

    if (type==”i” ) {
    data.push(Number(child.attributes.VALUE));
    }

  1. February 1st, 2009 at 20:21 | #1