Problem with event CreateJS

I am trying to add an event listener to one of my symbols in Flash. Here is the code:

/ * js

This.Stop ();

function handleMouseEvent (evt)

{

evt.target.gotoAndStop ("over");

}

this.addEventListener ('mouseover', handleMouseEvent);

internship. Update();

*/

The symbol has been created on the stage and when published by using the CreateJS extension, it errors every time in the browser to the line where I use the addEventListner method. The error is basically saying there is no method like the one defined. Now, in this video of Grant Skinner, it does basically the same thing but with an older version of the API CreateJS: lish-to-html5-using-the-adobe-flash-professional-toolkit-for-createjs/ http://tv.adobe.com/watch/getting-started-with-flash-professional-toolkit-for-createjs/pub

Why it doesn't work in my example?

The issue is that toolkitforcreatejs is using Easeljs version 0.5.0 new event model was introduced in version 0.6.0. Update of version 0.6, and it should work for you.

Tags: Adobe Animate

Similar Questions

  • problems with event handlers

    Hello world. I have a problem with the start of the event handlers in InDesign CS3. The example code I wrote the tutorial book, will not work. The message that I get when I open a new document is: "error string: the requested operation could not be performed because the object no longer exists." Here's the code I used:

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

    main();
    main() {} function
    myEventListener var = app.addEventListener ("afterNew", myDisplayEventType, true);
    }

    function myDisplayEventType (myEvent) {}
    Alert ("this event is the" + myEvent.eventType + "event.");
    }

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

    What's not here? Thanks in advance,

    mileking

    Hi mileking.

    Use the code example below:

    Code example
    #targetengine "session".
    main();
    main() {} function
    myEventListener var = app.addEventListener ("afterNew", myDisplayEventType, false);
    }

    function myDisplayEventType (myEvent) {}
    Alert ("this event is the" + myEvent.eventType + "event.");
    }

    Kind regards

    River. P

  • Problems with events in flex

    Hello. I'm a guy AS2 and Flash CS3. I started to learn AS3 and Flex 3 transfer. But I had a problem w / events in AS3. I add a component of the canvas to the scene. On this canvas, I added 3 different events: mouse down, mouse move, and mouse upwards. When the mouse move is triggered, it is impossible for me to get the mouse an event triggered, and vice versa, when the mouse upward is triggered, there is no way to get the mouse don't move event triggered. Is there someone to help this newbie with this problem? Any help will be much appreciated.

    Code:

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML layout "="absolute">
    < mx:canvas id = "myCanvas" x = "50" y = "50" width = "500" height = "500" click = "event_1 (); "mouseMove ="event_2 (); "mouseUp ="event_3 (); ">
    < / mx:Canvas >

    < mx:Script >
    <! [CDATA]
    Import mx.controls.Alert;
    import flash.events. *;
    public function event_1 (): void
    {Alert.show ("first event fired") ;}}
    public function event_2 (): void
    {Alert.show ("Second event fired") ;}}
    public function event_3 (): void
    {(Alert.show ("troisième événement déclenché) ;}}
    < / mx:Script >
    < / mx:Application >

    The problem is that your event listeners are not properly configured.

    Your "p1" to listen for the 'mouseUp' event because he was managing the events at this time.

    This is your modified and test code, as long as the mouse is down on the canvas, she fares at the time where you 'mouseUp' stop drawing.


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete =" initApp () ">"

    import com.myDomain.Lines.Main;
    Mx.graphics import. *;
    Import mx.binding.utils.BindingUtils;
    import flash.events.IOErrorEvent;
    import flash.events.Event;
    import flash.display. *;
    Import mx.controls.Alert;
    import com.myDomain.Lines.Main;
      
    public var p1:Main;
    public var pre:Number = 0;
      
    public function initApp (): void
    {
    P1 = new Main();
    this.addChild (p1);
              
    }
     
    public function prepToDraw (): void
    {
    pre = 1;
    }
     
    public void startDraw(event:MouseEvent):void
    {
    if(pre == 1)
    {
    P1. Graphics.Clear ();
    var newColor:int = 0xFF00FF;
    var iniX:Number = mouseX;
    var iniY:Number = mouseY;
    var lineWidth:Number = 10;
    P1. Graphics.LineStyle (width of stripe, newColor);
    P1. Graphics.MoveTo (gwenael, iniY);
    }
       
    imageView.addEventListener (MouseEvent.MOUSE_MOVE, drawLine);
    P1.addEventListener (MouseEvent.MOUSE_UP, stopDraw);
    }
      
    public void drawLine(event:MouseEvent):void
    {
    if(pre == 1)
    {
    P1. Graphics.LineTo (mouseX, mouseY);
    }
    }
    public void stopDraw(event:MouseEvent):void
    {
    imageView.removeEventListener (MouseEvent.MOUSE_MOVE, drawLine);
    }
     
     
    ]]>


     
    mouseDown = "{startDraw (event)}" > "
     



    HTH,

    Kenny

  • Problem with event listener

    Hello

    We have an event listener that does not seem to receive all events insertion of a table.

    Here is the SYS. Order ADD_LISTENER that we use:

    call the SYS. ADD_LISTENER ('tpch ', 'SQLFIRE', 'lineitem', 'demo.vmware.sqlfire.greenplum.MultiHubProxyDispatcher',' connectionurl = jdbc:sqlfire: | numproxies = 4 | sqlfire = username: password = sqlfire ", null);

    MultiHubProxyDispatcher() code distributes the rows inserted between the four tables proxy (proxy_0 through proxy_4). I have attached the MultiHubProxyDispatcher() code in this post.

    Thus, after 2400 lines are inserted in the lines of only about 125 lineitem table are spread to each of the tables four proxy.

    sqlf > select count (*) in the sqlfire.lineitem;
    1
    -----------
    2400

    1 selected line
    sqlf > select count (*) in the sqlfire.proxy_0;
    1
    -----------
    125

    1 selected line
    sqlf > select count (*) in the sqlfire.proxy_0;
    1
    -----------
    125

    1 selected line
    sqlf > select count (*) in the sqlfire.proxy_1;
    1
    -----------
    129

    1 selected line

    This same event receiver code worked with SQLFire v1.0, we have recently updated to v1.0.3.1 and that's when we started to see the problem. I don't see anything unusual in the newspapers. Is there something that has changed with the SYS. Order ADD_LISTENER are we missing?

    Thank you
    Sean

    Hi Sean,.

    I think you want to attach the code for demo.vmware.sqlfire.greenplum.MultiHubProxyDispatcher but I see only MicroBatchListener.

    Looks like you are using both the AsyncEventListener, but also the listener to table which could be added through the SYS. Procedure ADD_LISTENER.

    Can you please write how you use the combination.

    Please note async event listener cannot be added through sys.ad_listener.

    Thank you

    Neeraj

  • Dynamics of code in loop problem with event handlers

    Hello

    What I'm trying to do, is to assign dynamically a deployment and behavior pleased each movieclip with a certain name on my stage. I'm a loop through and attach a function to the event of each movieclip. So far, it works. All the clips on roller and more doing something. However the problem I'm having is dynamically changing values in each function for each different movieclip in a loop. For example, I store the clip I'm targeting original X and Y coordinates in an array that I push in the value to each loop. I draw it to test and trace it correctly on each loop of each value of X and Y for this clip. The problem I have is I am tempted to call orgX and orgy to each loop and attach that to each function, but all the clips using the last value in the table. It is not dynamically attaching the new orgX and orgy to each individual event deployment clips. All deployment events and more are called for each clip, but when I try to put any dynamic code in the function he always uses only the last value. Even if I put a trace in the RollOver event and try to find the instance name of movieclip clips all the clips to trace the last name of the clip on working capital. My logic looks OK but it has to do with how flash events attached runtime? How can I solve this problem?

    These tables are not something and orgX and orgy change values with each iteration of the loop for. at the moment where you deploying your movieclip orgX and orgy will be the last value in the loop for.

    to remedy to try:

  • Problem with event handlers

    Hello

    It seems that my event handlers do not work for some reason any. Could someone help me please?

    That's what I do:

    (1) create a simple Java class (with all necessary libraries) and compile to setMiddleName.jar:

    --

    bunch of pre-treat;

    import...

    public class setMiddleName implements {PreProcessHandler}

    public setMiddleName() {}

    Super();

    }

    @Override

    Public Sub initialize (HashMap < String, String > parameters) {}

    }

    @Override

    public EventResult run (long processId, long eventId, orchestration of the Orchestration)

    {

    Parameters HashMap < String, Serializable > = orchestration.getParameters ();

    String middleName = getParamaterValue (settings, "First name");

    If ((middleName == null) | middleName.equals("")) {}

    String firstName = getParamaterValue (settings, "First name");

    middleName = firstName.substring (0, 1);

    orchestration.addParameter ("middle name", middleName);

    }

    return new EventResult();

    }

    private String getParamaterValue (< String, Serializable > HashMap parameters,

    String key) {}

    {if (Parameters.ContainsKey (Key))}

    String value = (parameters.get (key) instanceof ContextAware)? (String) ((ContextAware) settings)

    .get (Key)). GetObjectValue(): parameters.get (key) (string);

    Returns the value;

    }

    else {}

    Returns a null value.

    }

    }

    @Override

    public BulkEventResult run (long arg0, long arg1, arg2 BulkOrchestration) {}

    TODO self-generating method stub

    Returns a null value.

    }

    @Override

    public void offset (long arg0, arg1 is long,

    {AbstractGenericOrchestration arg2)

    TODO self-generating method stub

    }

    @Override

    public cancel Boolean (long arg0, arg1 is long,

    {AbstractGenericOrchestration arg2)

    TODO self-generating method stub

    Returns false;

    }

    }

    --

    (2) create plugin.xml

    --

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < oimplugins xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance ">

    < pluginpoint = "oracle.iam.platform.kernel.spi.EventHandler plugins" >

    < pluginclass = "preprocess.setMiddleName plugin" version = "1.0"

    name = "setMiddleName" / >

    < / plugins >

    < / oimplugins >

    --

    (3) package zip file with the following content:

    --

    /plugin. XML

    /lib/setMiddleName.jar

    --

    and copy it to /oracle/plugins/setMiddleName.zip

    (4) create EventHandlers.xml and put it in /oracle/eventhandlers/metadata/preProcessEH/EventHandlers.xml

    --

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < eventhandlers xmlns =" http://www.Oracle.com/schema/OIM/platform/kernel "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " xsi: schemaLocation = " http://www.Oracle.com/Schema/OIM/Platform/kernel orchestration - handlers.xsd" >

    < entity-type of the action handler = "User" operation = "CREATE" name = "setMiddleName" Stadium = "preprocess" order = "1050" sync = "TRUE" / >

    < / eventhandlers >

    --

    (5) change ant.properties:

    --

    WLS. Home=/Oracle/MW/wlserver_10.3/

    IOM. Home = / Oracle/MW/Oracle_IDM1/Server

    Login.config = ${IOM. Home}/config/authwl.conf

    MW. Home = / Oracle/MW

    --

    and call 'Ant f pluginregistration.xml register' and specify the location of setMiddleName.zip. Result: [echo] Plugin version 1.0 reregistered preprocess.setMiddleName, BUILD successfully.

    (6) Edit weblogic.properties:

    --

    wls_servername = oim_server1

    application_name = OIMMetadata

    metadata_from_loc = / oracle/eventhandlers

    --

    and call. / weblogicImportMetadata.sh, which translates as:

    --

    Now to the tree of domainRuntime. It is a tree read-only with DomainMBean as the root.

    For further assistance, use the help (domainRuntime)

    Disconnected from the weblogic server: AdminServer

    End of import of metadata script...

    Leaving WebLogic Scripting Tool.

    --

    7)./PurgeCache.sh call all THE

    (8) restart IOM

    (9) result: the event handler does nothing. I don't have the impression to be called never, I tried to add logging resulting not in what either.

    Using the administration console export tool, I check that the handler is however there (it shows as/metadata/preProcessEH and I can export).

    What I am doing wrong? I forgot something?

    Thank you

    Max

    Hello

    In your EventHandlers.xml

    "http://www.Oracle.com/Schema/OIM/Platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" "xsi: schemaLocation =" "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" > "

    I don't see the class?

    See the example below

    <>

    Class = "Oracle.OIM.extensions.PreProcess.SamplePreprocessExtension"

    entity-type = 'User '.

    operation = "CRΘER."

    name = "SetUserMiddleName".

    Stadium = "pretreatment".

    order = "1000".

    Sync = "TRUE" / >

  • Since 10.11 I have not been able to download via the usb port of my Davis Vantage weather station. No solution of tech Davis on the issue even with the new recorder of events in the resort. Is there a problem with the usb?

    Since 10.11 I have not been able to download via the usb port of my Davis Vantage weather station. No solution of tech Davis on the issue even with the new recorder of events in the resort. Is there a problem with the usb?

    What Mac? (details)

  • Problem with the change in value of listbox event

    Hello

    I have a problem with the help of Listbox value change event. The code that I have attached is a simplified version of the largest program, but the problem is the same. One of the loops of Nonna is responsible for handlig occurring events ant the other is responsible for the execution of the program. In the project of oryginal I use a listbox control to determine which plots graphic display of a waveform is visible (first position of the listbox-> only plot first visible etc.). In the attached vi, I just show the current value of the listbox control. The problem is the event runs only once and then the program crashes. I want to be able to change the value of the listbox work both at idle and in State of a program, but when I put the structure of the event in both States, he does not. I'd be very grateful if someone smarter than me could tell me where I made my mistake. I want my program to be able to manage the keys and listbox events in States (slow down and knit) program.

    You have two structures of event in two cases different from the structure of the case, and both are tuned to listbox events has changed. Because only once can be triggered at any time, the VI crashes (lock events the front panel (default) until the event can complement).

    You must use a unique event structure managing all events.

    The overall program architecture looks like inside-out for me.

    For the buttosn, you must use action lock (switch not release!) and use the value changed events.

  • Problem with the event

    Hello
    I am facing a problem with the events. Please Ref. Event.zip the attachment.

    AEv.vi is a LV2G used for the reading/Generate/Init/destroy the event. Test2.VI is a main vi (we must run this vi)

    The AEv.vi Init action must be done in the other vi (other than the Test2.vi:- but for the objective test I've initialized in Test2.vi only).

    Test2.VI is used for genetate event.

    I could have called statically AEv.vi inside the Test2.vi to generate an event... but the path that comes is decided when running... (I have many live similar to AEv.vi...) .. who decided at run time...)

    The problem:

    When I run Test2.vi, it gives me the error code 1 (try running test2.VI... it gives the dialogue on the occurrence of the error)...

    Can someone fix this?

    Thank you!

    I modified your screws to do what I think you want.  The way you did the user events will not work.  I added a line to send orders to Ev.vi

  • Structure of the event: problem with data transfer

    Hello everyone,

    for three days I'm troubleshooting an issue in LabView with the event structures. I really hope someone can help here, because I can't find anything on the entire WEB.

    I had six groups of equal to a VI entry, each containing five checks enum (among others) where the user can specify some configuration of measurement data. I want the program to do is: to recognize if a any of these enum values has been changed and if yes, then submit the values containing the cluster in a subvi then calculates the wiring and affect the material of the ports. In addition, i need to submit the number of the enum element that was changed, so the program is able to clear the user input in the case of a breach (e.g. If the user sets two entries of enum control 1 meter and 2 Group 1 and then tries to set a third counter of entry to port 3, the program displays a message and deletes third entry as the number of entries of counter is limited to 2 per cluster).

    To resolve this problem, I used a structure of the event with 6 x 5 cases (change of enum value 1 Group 1 Group 1 enum value 2 change... and so on until the change in the value enum 5 Group 6).

    The problem is that if the user changes a value, the event structure reacts and performs the proper case; However VALUES of the cluster, the user changed are not subject to the SECOND time that an event occurs. It is a kind of a situation, "n-1". For example, if all five controls Enum of Group 1 are 'disabled' first and the user sets enum 3 of 'Meter entry', the structure of the event runs but submits the values previous to the Subvi (all enums 'Disabled'). When the user makes the second change, say that enum SWITCH1 to "Analog Input", the structure of the event is running again and passes the values of the FIRST user to the Subvi editing, then the Subvi gets data "enum 3 meter inlet and all other disabled enumerations.

    In easier words: if I have new values on my cluster "Kanal 1" (left side of the screenshot) and run the structure of the event, on the right side to "Kanal 1" indicator, I get the previous values (n-1).

    The structure of my event is in a while loop. If I create a timeout every 10 ms, and a loop of 250 ms the waiting time, I got the 80% chance that the recent changes are transferred to the Subvi correctly, in other cases I have a delay of the 1 step as described above. It seems to be directly based on the time that I specify the while to wait - but I can't explain it and I cannot accept a less than 100% chance to transfer the correct data, nor can I accept delays of a few seconds for each loop run. If I indicate timeout (infinite) get delayed 1-1 step values in all cases.

    When I specify cases of event to react on "all items value change" of the structure of the event behaves properly - but then I can't handle indicate which element has changed, as the CtlRef of output in case of a structure does not specify "enum 1, enum 2..." but only "Group 1".

    Does anyone have a solution to this? It is certainly a problem with the structure of the event, but I can't understand what to change.

    Thank you much in advance,

    Mr. Boiger

    This is because the terminal is read until the structure of the event runs.   Terminal is read, the event structure is waiting for an event.  The change in value.  Business events are running, but the value is the old value.

    Put the terminal inside the event.

    Or, you can display the connector called "New value" on the side left (stretching down from the border of the node 'CtrRef').  Use a wire one to come.

  • [JS CS5] problem with memory leak possible with the dialog box in the event handler

    Hello

    I'm having a very difficult problem.

    I am attaching a script in a handler for a menu item, by using an installation script menu that I wrote based on one by Marc Autret. My version of the script menu installation attach a bunch of event handlers at the same time, to the actions of different menu.

    What is the event handler, with that I have a problem is to prompt the user for a URL and then applies the URL as a hyperlink to the text selection, with our house style for the way in which the URL should look like.

    The problem is the following:

    1. all other installed menu actions work very well, except for this one.

    2. the addition of URL script works fine, when you run it directly from the script menu.

    3. the combination of #1 and #2 (using the script to add URL by function as an event handler in the Edit menu) blocks to InDesign. But it is only after the addition of URL script has finished and done what it was supposed to do!

    4. when I comment on the section of the script URL adding user input, so that instead of saying

    userInput = myDisplayDialog();
    

    It is said

    userInput = "http://thisworks.com";   // userInput = myDisplayDialog();
    

    It works well as an event handler.

    So obviously a problem with the dialog box, but only when adding URL script is executed as an event handler. My first guess is that this is some kind of memory leak, but I think I am following the model of. destroy() the way I saw it elsewhere.

    Someone knows something like that before?

    I can provide all relevant if necessary scripts, but they are quite complicated. The most important of them is the input of the user function. Here it is:

    var myDisplayDialog = function( defaultText ) {
      
        var defaultText = defaultText || "";
        
        var myDialog = app.dialogs.add({
            name: "Type in a URL"
        });
        
        var myOuterColumns = [];
        var myInnerColumns = [];
        var myOuterRows = [];
        var myBorderPanels = [];
        var myTextEditboxes = [];
        var myInput;
        
        myOuterColumns[0] = myDialog.dialogColumns.add();
        myOuterRows[0] = myOuterColumns[0].dialogRows.add();
    
    
        myBorderPanels[0] = myOuterRows[0].borderPanels.add();
        myInnerColumns[0] = myBorderPanels[0].dialogColumns.add();
        myInnerColumns[0].staticTexts.add({
            staticLabel: "URL:"
        });
        
        myInnerColumns[1] = myBorderPanels[0].dialogColumns.add();
            
        myTextEditboxes[0] = myInnerColumns[1].textEditboxes.add({
             minWidth: 300,
             editContents: defaultText ? defaultText : "http://"
        });
        
        var myResult = myDialog.show();
        var myInput = myTextEditboxes[0].editContents;
        
        myDialog.destroy();
    
        if (myResult == false) {
              exit();
        }
        
        return myInput;
    
    }
    
    

    Hi Richard,

    Unfortunately, there is no guarantee that the ScriptUI longer work.

    Thake a peek here: http://forums.adobe.com/message/2881364

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

  • Problem with xfa.event.change in 3.3 XFA

    Hi all

    I found a problem with the way in which that XFA 3.3 treats the script below on a change event when a user more than 1 character in a textfield dough.

    sChange var = xfa.event.change;

    If ((sChange.length>1)) {}

    App.Alert ("Bad User\nCopy and paste has been disabled for this field");

    throw change

    XFA. Event.change = "";

    }

    XFA 3.0 the alert is sent, the change is eliminated, XFA 3.3, the alert is sent and persists the change.

    Any ideas?

    Yes, unfortunately, this is a known bug in Acrobat X and XFA forms.  He is currently in the study...  If you are targeting Acrobat or Reader 9.1 or later (not 10.0 or later), and then it works fine.

    Mark

  • Strange problem with the keyboard event listener

    I have a full screen touch app. To close the application, I set an event listener on keyboard for the key "0". I don't want the press user due to some restrictions Alt + F4 key combination. Problems begin when the application loses focus. Here's the code;

    protected function onComplete(event:FlexEvent):void
    {

    this.setFocus ();
    this.addEventListener (KeyboardEvent.KEY_DOWN, trapKeys, true, 0, true);

    }

    private void trapKeys(e:KeyboardEvent):void {}

    If (e.keyCode == 96) {}
    This.Close ();
    }

    Else if (e.keyCode == 48) {}
    This.Close ();
    }

    }

    When the user change the screen to a different with Alt + TAB application, or any other combination of keys flex app loses focus and does not work when he turns back to my app "0". How can I solve this problem?

    Thanks in advance.

    Hi, Ahmed.

    I have absolutely no problem with the solution you are trying to set up - you use mode full-screen interactive mode of keyboard?

    Please consider:

    on full add keyboard listener

    protected function applicationCompleteHandler(event:FlexEvent):void

    {

    this.stage.addEventListener (KeyboardEvent.KEY_DOWN, trapKeys);

    };

    //

    protected function applicationActivateHandler(event:AIREvent):void

    {

    If (this.stage)

    {

    switch the State to display full-screen when activated

    If (this.stage.displayState! = StageDisplayState.FULL_SCREEN_INTERACTIVE)

    {

    this.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

    };

    };

    };

    //

    private var exitHandled:Boolean = false;

    on NUMBER_0 | NUMPAD_0 exit-close

    protected function trapKeys(event:KeyboardEvent):void

    {

    If ((event.keyCode is Keyboard.NUMBER_0

    || event.keyCode is Keyboard.NUMPAD_0)

    (& this.exitHandled == false)

    {

    exitHandled = true;

    this.stage.removeEventListener (KeyboardEvent.KEY_DOWN, trapKeys);

    This.Close ();

    };

    }

    (Note: applicaton of the events 'applicatonComplete' and "applicationActivate" are routed to over managers)

    Kind regards

    Peter

  • Help with the problem of event possible mouseEvent/keyboard

    Hi guys, I have problems with a game I've created now.  The problem seems to lie on the mouse / keyboard event.

    Basically I have a character that the player can control using the arrow keys on the keyboard and it works perfectly well on its own.  Whenever the game begins, the player can control the character instantly with the keyboard. Here's the problem now, after that I added another page (in box 1) and created a game start button, keyboard events does not start immediately more.  The player must click on the stage before it works.  Is there a method to solve this problem?

    At the present time, here is my page of the Start button.

    var start_btn:Start_btn = new Start_btn;
    start_btn.addEventListener (MouseEvent.CLICK, goGame);

    function goGame(event:MouseEvent) {}
    gotoAndStop ("game"); The game framework
    this.removeEventListener (MouseEvent.CLICK, goGame);
    }

    Here is a code for the actual game part.

    stage.addEventListener (KeyboardEvent.KEY_DOWN, keyP resurrected);

    function keyPressed (e:KeyboardEvent): void {}
    Code of character... like charcter.x ++ movement, x - etc.
    }

    Thanks in advance

    How about you try:

    internship. Focus = stage;

    in goGame().

  • Problems with the script to output event

    In fact I don't know if I have a problem with the Exit event or if there is something wrong with my script syntax... The output of a field event, I check if the field is empty or not and check a flag I put in place.

    The first if statement works - if I get back a value in the field, everything goes as planned. If I delete the value of the field, nothing happens.

    //if field has a value hide subSection04
    if (!(this.rawValue == null || this.rawValue.length == 0))
    {
         subSections.subSection04.presence = "hidden";
    }
    
    //if field is empty and flag equals true show subSection04
    else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == true))
    {
         subSections.subSection04.presence = "visible";
    }
    
    //if field is empty and flag equals false hide subSection04
    else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == false))
    {
         subSections.subSection04.presence = "hidden";
    }
    
    There are a few groups radio button that also control this behavior, they are all inter relate. So I tried also triggers the Click event of a radiobutton Group (which resembles the value in this field) out of this area, but that doesn't seem to work.

    Hi Jono,

    Your expression subFlags.Commercial.rawValue is true compares a String data type with a Boolean data type.

    Edit the expression as subFlags.Commercial.rawValue is 'true'

    I hope that this should work for you.

    Your code should look like

    //if field has a value hide subSection04
    if (!(this.rawValue == null || this.rawValue.length == 0))
    {
         subSections.subSection04.presence = "hidden";
    }
    
    //if field is empty and flag equals true show subSection04
    else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == "true"))
    {
         subSections.subSection04.presence = "visible";
    }
    
    //if field is empty and flag equals false hide subSection04
    else if ((this.rawValue == null || this.rawValue.length == 0) && (subFlags.Commercial.rawValue == "false"))
    {
         subSections.subSection04.presence = "hidden";
    }
    

    Nith

Maybe you are looking for