Control DMX with AS3

I try to write a program in AS3 (probably using the Flex SDK) that controls a light theatre DXM Pro USB system. The program must be able to send data to several DMX channels to control the light level, allowing the projects to light either pre-tuned and executed in a particular order.

I saw libraries to work with DXM inr VB and c#, but I'm trying to determine if someone has written an AS3 library to send data to the DXM Pro USB device. I've never used AS3 to communicate directly with a USB device, so I'm a little loss to know where to start. Obviously, this will be a project written for AIR, because it will need access to system devices.

Does anyone know of such a library? If this is not the case, can someone point me in the right direction for reading on communicate with devices USB in AS3?

I didn't have a wrapper, as I wanted to be installed with the installer for Adobe AIR. And I checked Netlab. It worked fine, but I wanted to manage the problem at the level of the code, so I could have more control over it.

I finally solved the problem with Serproxy, which runs in the background and makes USB ports available via 5331-5334 ports (COM 1-4) on localhost. Because the DMX USB Pro emulates a COM port, it was quite easy to connect via Serproxy (insofar that I made sure that the DMX USB Pro was not assigned a port above 4).

I used NativeProcess, that's new in AIR 2.0. I was not familiar with this subject, so I thought I'd share the code here in case others want to use it.

if (NativeProcess.isSupported)
   var file:File = File.applicationDirectory.resolvePath("serproxy.exe");
   var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
   nativeProcessStartupInfo.executable = file;
   nativeProcessStartupInfo.workingDirectory = File.applicationDirectory;
   process = new NativeProcess();
   process.addEventListener(Event.ACTIVATE, handleProcessActivation);
   process.start(nativeProcessStartupInfo);
} else {
   Alert.show("Unable to start Serproxy.");
}

I have connected to the port on localhost using the plug then used a ByteArray to getting the right information to the DMX USB Pro.I was also an event handler to exit the nativeprocess instance when the application closed.

Thanks to all who responded. If someone needs help, namely the correct information to switch to the DMX USB Pro, I'd be happy to share what I know. Their documentation is a little sparse, but a little experimentation allowed me to find the right bytes to send.

Tags: Adobe Animate

Similar Questions

  • Parental and child control with AS3

    Hello

    I am new to AS3 and although I can see some good practices and functionality, I'm constantly stuck and can still do the things I would do if easily with AS2 - I almost it relearn from scratch!. I would still appreciate little help and advice on this...

    I did a class that creates a "sort" menu with data from an XML file, and basically is what he does when he is called to create an emptyMC (a container), add a childMC (a square) and add another child (a text label). When I create the container, I am trying to add a MouseEvent that can act on each instance of container, but all I can get is a MouseEvent on the object that contains all the MCs added. The code follows.

    Can someone enlight me with that issue or explain what I am doing wrong.

    I do not understand the parental dynamics with AS3 and the absence of the use of instance names and parenting dot does not help.

    Thanks in advance.

    Note to Adobe: previous versions of Flash and as a reference Help files were far more useful than in CS4!

    In the timeline:

    Import assets.myDynMenu;

    var theMenu:myDynMenu = new myDynMenu ("menu.xml");
    stage.addChild (theMenu)

    Stop();

    In the class:

    package assets

    {

    import flash.display. *;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    flash.net import. *;

    public class myDynMenu extends Sprite {}

    LOADING EXTERNAL INIT DATA

    public void myDynMenu (theData) {}

    LOADS MENU DATA FROM PREFORMATTED XML
    var loader: URLLoader = new URLLoader();
    var url: URLRequest = new URLRequest (theData);
    loader.addEventListener (Event.COMPLETE, buildTheMenu);
    Loader.Load (URL);
    }

    FULL CHECK LOAD XML MENU DATA - OBJECT BUILDING AND CHILDREN

    public void buildTheMenu(event:Event):void {}

    var xml = new XML (event.target.data);

    for (var i = 0; I < xml.menuData.menuItem.length (); i ++) {}

    ADDS A CONTAINER

    var itemContainer:MovieClip = new MovieClip();
    itemContainer.name = "menu" + i;
    //

    THE NEXT LINE IS NOT DO WHAT I WANTED?
    IN THE FUNCTION BEING CALLED, I NEED TO CONTROL THIS ELEMENT AND ITS CHILDREN

    itemContainer.addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    //

    itemContainer.x = 100 * i;
    itemContainer.y = 0;
    itemContainer.mouseEnabled = true;
    itemContainer.mouseChildren = false;
    addChild (itemContainer);

    ADDS A CHILD OF CONTAINER (a square)

    var itemBase:MovieClip = new MovieClip();
    itemBase.graphics.beginFill (xml.menuData.mConfig.mainItemColor);
    itemBase.graphics.drawRect (0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mConfig.mainIt emH);
    itemBase.graphics.endFill ();
    itemBase.name = "basic" + i;
    itemBase.mouseEnabled = false;
    itemBase.mouseChildren = false;
    itemContainer.addChild (itemBase);

    ADDS a CHILD OTHER to CONTAINER (a text label)

    var theLabel:TextField = new TextField();
    theLabel.x = 5;
    theLabel.y = 5;
    theLabel.selectable = false;
    theLabel.mouseEnabled = false;
    theLabel.border = true;
    theLabel.text = xml.menuData.menuItem [i] .mName;
    itemContainer.addChild (theLabel);

    }

    }

    It IS THE MOUSE ON WHICH I NEED law to EACH itemContainer (AND CHILDREN)
    private void onMouseOver(event:MouseEvent):void {}

    event.stopPropagation ();
    trace ("you're on" + myIdName);
    }


    }

    }

    use:

    package assets

    {

    import flash.display. *;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    flash.net import. *;

    public class myDynMenu extends Sprite {}

    LOADING EXTERNAL INIT DATA

    public void myDynMenu (theData) {}

    LOADS MENU DATA FROM PREFORMATTED XML


    var loader: URLLoader = new URLLoader();
    var url: URLRequest = new URLRequest (theData);
    loader.addEventListener (Event.COMPLETE, buildTheMenu);
    Loader.Load (URL);
    }

    FULL CHECK LOAD XML MENU DATA - OBJECT BUILDING AND CHILDREN

    public void buildTheMenu(event:Event):void {}

    var xml = new XML (event.target.data);

    for (var i = 0; i)

    ADDS A CONTAINER

    var itemContainer:MovieClip = new MovieClip();
    itemContainer.name = "menu" + i;
    //

    THE NEXT LINE IS NOT DO WHAT I WANTED?
    IN THE FUNCTION BEING CALLED, I NEED TO CONTROL THIS ELEMENT AND ITS CHILDREN

    itemContainer.addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    //

    itemContainer.x = 100 * i;
    itemContainer.y = 0;
    itemContainer.mouseEnabled = true;
    itemContainer.mouseChildren = false;
    addChild (itemContainer);

    ADDS A CHILD OF CONTAINER (a square)

    var itemBase:MovieClip = new MovieClip();
    itemBase.graphics.beginFill (xml.menuData.mConfig.mainItemColor);
    itemBase.graphics.drawRect (0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mCon fig.mainItemH);
    itemBase.graphics.endFill ();
    itemBase.name = "basic" + i;
    itemBase.mouseEnabled = false;
    itemBase.mouseChildren = false;
    itemContainer.addChild (itemBase);

    ADDS a CHILD OTHER to CONTAINER (a text label)

    var theLabel:TextField = new TextField();
    theLabel.x = 5;
    theLabel.y = 5;
    theLabel.selectable = false;
    theLabel.mouseEnabled = false;
    theLabel.border = true;
    theLabel.text = xml.menuData.menuItem [i] .mName;
    itemContainer.addChild (theLabel);

    }
      
    }

    It IS THE MOUSE ON WHICH I NEED law to EACH itemContainer (AND CHILDREN)
    private void onMouseOver(event:MouseEvent):void {}

    event.stopPropagation ();
             trace ("you're on" + event.currentTarget.name);
    }

    }

    }

  • Select all the text in the control with AS3

    Does anyone know how to select all the text in a text control (text, textarea, etc.) with AS3?

    Thank you.

    Answered my own question.

    Set the properties selectionBeginIndex and selectionEndIndex of text controls.

    For example, this selects all the text in a text box:
    yourTextArea.selectionBeginIndex = 0;
    yourTextArea.selectionEndIndex = yourTextArea.text.length;

  • How to write Save function based on the drop-down list box selection data in app mxml flex4 with as3

    Hi all

    I'm working on the application web flex4 with as3.

    I have a doubt, I've created a mxml it has two text boxes, except the button and a combo box that is has two option as a percentage and the amount.

    my needs are I gave here.

    need 1: when I choose option amount that two text boxes does not have to be editable.when I select text tat box two percentage option will be editable.

    need 2: when I select the percentage in combox option and two text boxes are empty, and then click the button Save-> I want to display warning msg

    need 3: when I select the option amount combox and the two boxes are emptu click the button Save-> I don't want any warning messages.

    How to validate it and how to write backup for this function.

    This is my sample code:

    list box ID = baseAmtPer

    ID TextBox1 = maxCommAmt.text

    ID = baseAmtPer.text text box

    If (((baseAmtPer.editable!=true) & & (maxCommAmt.editable! = true)) & & ((baseAmtPer.text=="") & &(ma xCommAmt.text=="")) |) (baseAmtPer.text == "") | (maxCommAmt.Text=="")) -> This condition not allowing while I'm selecing amount in combo box. How the TWO TEXT BOX WILL BE EMPTY for this problem

    {

    Alert.Show ("enter in all areas", "Information");

    }

    on the other

    {

    some encodings

    }

    Hello

    Please go through the following Code:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import spark.events.IndexChangeEvent;

    protected function button1_clickHandler(event:MouseEvent):void

    {

    If (comboBox.selectedItem == "Percentage" & textBox1.text == "" & textBox2.text == "") {}

    Alert.Show ("enter the values");

    }

    }

    protected function comboBox_changeHandler(event:IndexChangeEvent):void

    {

    {if(ComboBox.SelectedItem=="Amount")}

    textBox1.editable = false;

    textBox2.editable = false;

    }

    else {if(comboBox.selectedItem=="Percentage")

    textBox1.editable = true;

    textBox2.editable = true;

    }

    }

    ]]>

    Amount

    Percentage

    Thank you and best regards,

    ------------------------------------------------------------------------------------------ --

    Vibhuti Gosavi . [email protected] | www.infocepts.com

    ------------------------------------------------------------------------------------------ --

  • Control Automation with Siri on Mac?

    Control Automation with Siri on Mac?

    I am aware that Siri on a Mac of Sierra does not yet support Apple HomeKit.

    As another example illustrating Siri on a Mac is currently quite limited, it is not extensible by developers unlike Siri on iOS.

  • How to convert a table control connects with VISA

    As VISA can accept only string buffer, how can connect us a "Control Panel with VISA?


  • How to fill a control ring with chains [] array?

    How to fill a control ring with chains [] array?

    It must be karma. (Try really bad karma because I couldn't post this question in my original)

    I must have been a Really bad guy in a previous life...  It's not like I'm bad in this one...

    So... what I want to do this time around?  Something that I thought would be easy... Well... it's a long story...  I had a simple solution, but the client wants something else.  -sigh-

    Here is what they want...  They want a control that allows for multiple selections to a control of the ring (or a control that allows a drop down selection menu).  Bites are filled at run time because it is based on 10 000 other precedents of things this particular choice.  So it must be dynamic.

    The snippet of code & images below show what I'm doing a little...

    The bottom image shows on the right bites which is filled in the control of the ring.  Since the number of items / items changes, I didn't have a bunch of controls stacked on another.  In addition, I have to deal with an unknown quantity of selections.

    Does anyone have a solution that can be recommended?  If so, can you share the solution / idea?

    Thank you

    RayR

    I have posted a code that does something similar here: http://forums.ni.com/t5/LabVIEW/array-of-cluster/m-p/1822451#M625032

    It uses a table hint and individual controls that are moved on top of the table and populated as needed.  This approach might work for you?  You would need a two-column table and only control ring, which you would fill properly whenever the currently active cell changes.

  • How can I remove a control created with NewCtrl?

    I create controls dynamically with NewCtrl(). Now, I need to remove them and create different controls.

    How delete/delete one control that I created with NewCtrl?

    DiscardCtrl (); See the "Programming with controls" section in the help

  • How can I control Illustrator with Powershell?

    I need to automate the conversion of images SVG to monochrome TIFF with Group 4 compression. Illustrator is the only tool I found which allows convert SVG files, that I work with precision. I want to automate the process by using Powershell. Is there a more appropriate tool to use for this task than Illustrator? If so, what is it? Otherwise, there are examples of control Illustrator with Powershell?

    at the base...

    $iapp = New-Object -ComObject Illustrator.Application
    $idoc = $iapp.documents.add()
    $itext = $idoc.textFrames.add()
    $itext.contents = "Hello World from PowerShell!"
    
  • A simple way to load a pdf page into flash with as3

    Hallo,

    is there a simple way to load a pdf page into flash with as3 at Flash.

    I mean no plug in or as a class.

    Thank you.

    If it is an air application, you can use the htmlLoader.

    Otherwise, you can use navigateToURL but that only opens 'in' your swf, and you cannot manipulate the PDF with actionscript.

  • is it possible to make a timer with AS3, which is accurate to a millisecond.

    I am new to AS3. I have somehow developed an auditory and Visual reaction timer taking the script from here and elsewhere. I know that his is not accurate and I also know that I'll write it correctly when I heard the script carefully.

    But I was checking the net about the timer class and various positions on this issue and I am annoyed by a question "if its possible to make a precise timer with AS3?" can someone please tell me with certainty. and I will be grateful if I know how to do it properly. I can post the code I wrote (assembled).

    the answer is, maybe. but for most of the coders, the answer is, no.

    getTimer() is accurate to 1ms.  but to determine the elapsed time / and don't call or to run code on a timed basis. It can be used with the Timer class events or enterframe to do certain things with precision.

    However, the timer class is not accurate in the way of thinking of beginning coders.  It will be, on average, to allow the call of a function near the designated interval so there is no performance problem with your swf file.  It does not allow each function call to occur at regular intervals.

  • Adjust the order of the layers with AS3

    I want to load an external SWF into my project. I do this by adding a charger to the scene. It seems above all, there are 16 layers in my FLA, and I want to put it between the second and the third to the lower layers. How can I do this? I looked at some things online but they are all to change the order of objects on the same layer, and they usually invole do 2 or three objects with AS3 then change the order on the same layer, always above the objects that are actually on the stage of the FLA. I want to put the SWF loaded under Of OBJECTS ALREADY EXISTING that are on different layers.

    My code:

    var pageLoader:Loader = new Loader;

    addChild (pageLoader);

    pageLoader.x = 98;

    pageLoader.y = 121;

    pageLoader.z <-as far as I know it works in a single layer, it won't jump from layer to layer.

    Some have suggested to load my swf in a clip from movie ampty bt when I do this I lose interactivity for swf file, why is this and is there away around this?

    My code:

    var pageLoader:Loader = new Loader;

    pageContainer.addChild (pageLoader);

    pageContainer is an empty movie clip

    I want to load directly to the scene and just change the layer (first method), but if this cannot be done so I need a way to get SWFs loaded into a clip vacuum film and keep their own interactive.

    I dound in connection addChildAt, which is different from addChild, because it has 2 parameters, the name of the object and its z-index. So I was able to do:

    addChildAt(pageLoader,4);

    Then I met the same problem with movie clip method is empty, I lost interactivity. Then I noticed that there movieclips above because one of them is used as a blending mode by covering it. So, I realized that the empty movie clip method did not work because there are video clips above it. So I did mouseEnabled = false. And it works, so YAY!

  • Change the text with AS3 makes the invisible text

    Hi all

    Even for a total n00b like me, this is awkward: I can't even change a text on the stage with as3.

    I place a text on my stage, assign the dynamics, incorporate the police and give it an instance name. When I change the text, he evacuated the scene or if it remains invisible, I don't know.

    I thought it would be as simple as this: myText.text = "new text";   but apparently I am doing something wrong. When I put a trace (myText.text);  before and after, I see the old and the new text in the output window. Then he changes correctly, but why he disappears it? Also tried in a new white project, to ensure that it was not something somewhere.

    I'm totally distraught...

    BTW I use Flash CS5.5 on Win7

    do not enter text in the ide.  Use actionscript to assign the original text of your textfield and also change.

  • Building application kiosk with AS3 of ios for iPad?

    Hello

    How to build a stand iPad IOS App with AS3? I won't need the updates for this app. It will be just a pdf magazine inside, same content forever.

    I can't find any tutorials/introduction on how to build it.

    I got the idea on how to create normal ios App, but creating kiosk App really confussed me.

    Hopefully I can get a good start here

    Help is appreciated!

    This should give it a read:

    http://www.Adobe.com/aboutadobe/pressroom/pressreleases/201110/101211AdobeDPSNewsstand.htm l

  • Why can't you have variable conditionalized on template and control them with expressions?

    I have a chapter that is shared between two guides with different titles. On master pages, I inserted the variables for the two titles of books and conditionalized of each variable.

    When I go to the pages of the body, both titles appear in footers. When I apply expressions to control what as I want to appear, they both disappear. The only way of making return must show all.

    Note that the expressions work perfectly with conditional text on the pages of body. Apparenlty that they do not work on master pages. This seems to be a bug, no?

    I withdraw this question: you can have variable conditionalized on master pages and control them with expressions, provided your expressions do not confuse FM. For example, in the chapter, I have this expression:

    "NotInHelp" ANDNOT "hidden" ANDNOT "SalesPM" ANDNOT "HelpOnly" ANDNOT "Report_Caching."

    The first tag condition, NotInHelp, to which we are asking FM to show (the others hid), is the cause of all hide conditionalilzed, even if it worked properly when we tested it in an individual file.

    Remove "NotInHelpAND" solved the problem. Learned something about expressions today. fun!

Maybe you are looking for

  • Re: lost recovery disk and partition recovery

    My daughter managed to destroy Vista on her laptop. Problem now is that she can not find the recovery disk and formatted the whole c: drive. Is it possible that she can get the operating system from somewhere, because she still has his serial number.

  • Satellite A300 - webcam works do not, the message says "webcam driver open fail.

    It says "driver webcam open fails, restart the computer or the camera. I did it but I don't know what else to do to fix Please help I need for an assignment to the 12th any help is appreciated thnx

  • Laptop scroll

    I have a HP 15 laptop, product number F5Y33UA #ABA, windows 8.1 I want to be able to scroll while on the web.  How can I do this?  I can do through the delivery of programs, but not on the web, unless I hold the button left and made scroll at the sam

  • Blitzz Super G PCI wireless network adapter works only in Windows XP SP3

    I looked for answers to this, and it seems that all they are pointing to the same question. Grave wireless network adapter failed after the Service Pack 3 update. My question is the same thing, I can't get the updated drivers (I have the original ins

  • Download link of windows 7 Home premium

    Original title: Windows 7 Home Pre OA Please give me the link to download windows 7 Home premium OA X 16-96072. I have the product key.