.onActivate callback for object Panel

Hello.

I'm working on a user interface that uses a lot of eventListeners. I would like to add and remove depending on the State of the window.

To do this, I use reminders:

.onActivate

.onDeactivate

The script below works like a charm when it is run from file > Scripts > run Script file...

When recorded in the Scripts/ScriptUI Panels/scriptname.jsx and then run it from the window menu in AE, the recall of .onActivate doesn't seem to work.

In any case not when right clicking on the window.

But when you click on the first button, the .onActivate callback is triggered.

The recall of .onDeactivate works as expected; he get is triggered when I click on another part of the interface of AE.

Any ideas?

{
function safeEventWindow(thisObj){
  var win = thisObj instanceof Panel ? thisObj : new Window('palette',"Safe Event Window",undefined,{resizable:true})
  win.alignChildren = ['fill','fill']
  var mGrp = win.add('panel',undefined,'PANEL!')
  mGrp.minimumSize = [200,200]
  var btn1 = win.add('button',undefined,"I'm just a button, man.")
  btn1.alignment = ['center','center']
  btn1.onClick = switchText
  var txt1 = mGrp.add("StaticText",undefined,"\\^___________^/")
  txt1.alignment = ['center','center']
  txt1.hide()


  // FUNCTIONS
  function switchText(event){
  var state = txt1.visible
  if(state) txt1.hide()
  else txt1.show()
  }


  function mWin_refresh(){
  win.layout.layout(true)
  win.layout.resize()
  }

  // EVENT HANDLERS & FUNCTIONALITY


  function startMouseListeners(event){
  $.writeln("startingMouseListeners")
  mGrp.addEventListener("mouseover",switchText)
  mGrp.addEventListener("mouseout",switchText)
  }
  function stopMouseListeners(event){
  $.writeln("stoppingMouseListeners")
  mGrp.removeEventListener("mouseover",switchText)
  mGrp.removeEventListener("mouseout",switchText)
  }


  win.onActivate = startMouseListeners
  win.onDeactivate = stopMouseListeners
  win.onResizing = mWin_refresh


  //__INIT__
  if(win instanceof Window){
  win.show()
  win.center()
  }
  mWin_refresh()
}


//__INIT__
safeEventWindow(this)


}

Checked the AE CC2014, windows 7: onActivate does not work, onActivate only triggered when activating a widget (the button), but not the Panel.

Note: you should care when adding event listeners to a group/Committee: 'mouseover', and 'mouseout/mouseouthandler()' can trigger for both the Panel AND the static text (when it is visible)

Is that what you want?

Xavier

Tags: After Effects

Similar Questions

  • Strange problem with the object Panel.

    Hi all! I found this forum in a desperate attempt to find a solution to my problem. I searched without success, but if has already replied to this question, can someone point me in the right direction?

    FreeHand MXa works with Vista? (Or MX, I tried two versions of the disc in the box). I can install that's fine, no problem at all. When I actually started working, I noticed that the object Panel was not on the right side where it normally is, so I click on the window and you click object. Instead of giving me the Panel, I have a popup that says "Could not complete your request because an unknown command has occurred", and then a little box pop up that looks like it might be the object Panel, but it is empty. No marks, no nothing and it does not meet anything, except when I hit the button of output on this subject. It is the same version I had installed on my old computer. I got a new computer yesterday and I tried to install today and I can't understand why it doesn't let me open the object Panel. I'm so lost without it! Is there another way to work in FreeHand without it? I have Illustrator, but I really prefer working in Freehand for more things I did on a daily basis. It's just much faster for me to do some of the things I do. I need my object Panel...

    This TechNote may help:

    http://go.Adobe.com/kb/ts_tn_12050_en-us

    Judy Arndt

  • Error on the server after restoring the backup: "could not allocate space for object database because the 'primary' filegroup is full.

    Original title: Hi Experts,

    Hi Experts,

    Pls help me...
    When I tried to restore the backup of one of my site in my server, I got error like "cannot allocate space for object database because the 'primary' filegroup is full"... Microsoft SQL-DMO(ODBC SQL State:42000))

    Hello

    The question you have posted is related to professional level support. Please visit the link below to find a community that will support what ask you:

    http://social.technet.Microsoft.com/forums/en-us/category/SQLServer/

  • An error occurred during the execution of the request for export: could not allocate space for object ' dbo. DS_Property_Member_Array'. 'IdxPropMbrArr04' to database 'EPMA' because the 'PRIMARY' filegroup is full.

    Cannot deploy the planning application. I get the following message.

    Detail: An error has occurred during execution of the export demand: could not allocate space for object ' dbo. DS_Property_Member_Array'. 'IdxPropMbrArr04' to database 'EPMA' because the 'PRIMARY' filegroup is full. Create disk space by deleting unnecessary files, removing objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on it to the existing files in the file group.

    No idea where I need to check the space I checked my essbase server and workspace and they both seem to have enough space for a normal deployment.

    It's a question on the SQL Server database with the allocation of space, searching the Internet for something like "Create disk space by deleting unnecessary files, removing objects in the filegroup" and you should get a lot of results.

    For example - the primary filegroup is full SQL Server 2008 - database to stack Exchange administrators

    See you soon

    John

  • Creating HTML dynamically in JS tags for my Panel (using the syntax)

    I am tryinng to dynamically generate a user interface for my Panel. Create tags work very well with the code below - the problem is the syntax for the background image.

    // Construct HTML tags dynamically and append to content container
    for (var i = 0; i < myList.length; i++){
        var html = "";
        html += "<button class='lol'>";
        html += "<span class='lol2' style='background-image: url(" + myList[i].icon + ")'></span>"; // Syntax broken here
        html += "<p class='lol3'>" + myList[i].text + "</p>";
        html += "</button>";
        $("#content").append(html);
    }
    

    The tags are generated fine - but I don't get the property background-image for them - probably because the url() attribute syntax is broken. Also important to mention is that myList [i] icon contains a string - so it's not a data problem.

    The url of the background image is not a string itself? Try adding additional quotes in there:

    var html = "";
    

    Had to get away from them otherwise is a mess.

    Hope this helps,

    Davide Barranca

  • Save the settings for the panels

    I have a question - y at - it a good workaround solution, how to save the settings of a Panel? I intend to provide options for a Panel, which the user must be able to turn on/off. I thought to save the settings in the Json file. I don't know how to do better, or someone has a better idea or another way to get the result?

    You can set the persistence on (as when the user reopens the Panel * in the same session of PS *, it will keep the same status), or otherwise use LocalStorage, persistence independent of sessions.

    Davide Barranca

    http://htmlpanelsbook.com

  • The call for objects with specific CMYK values?

    Hello

    I'm trying to create a script that seeks paths that have specific CMYK values within a document and then changes the opacity of this path. I can clarify that he only looks for objects that have a CMYK color, but not getting anything once I have try to specify CMYK values, that I'm looking.

    In addition, should I specify that the output will be a "new CMYKColor", or is it sufficient to say "paths [i].fillColor.back = 100.0", for example, in the output. Here's what I have for this particular function:

    var docRef = app.activeDocument; 
    var paths = docRef.pathItems; 
    
    for (i=0; i< paths.length; i++) {
    
    if (paths[i].fillColor.typename == "CMYKColor" ) {
    
    if (paths[i].fillColor.cyan == 0.0 &&
    paths[i].fillColor.magenta == 0.0 &&
     paths[i].fillColor.yellow == 0.0 &&
     paths[i].fillColor.black == 20.0 &&
     paths[i].opacity == 100.0) {
    
    var NewColor = new CMYKColor ();
    
    NewColor.cyan = 0.0;
    NewColor.magenta = 0.0;
    NewColor.yellow = 0.0;
    NewColor.black = 100.0;
    paths[i].opacity = 20;
    }
    
    else {
    alert ("Object(s) not recognized.")
    }
    
    }
    else {
    alert ("Object not CMYK.")
    }
    }
    

    Thank you.

    Hi Silly-V,

    No, it's isn't weird.

    Illustrator is a bit crazy. Most of the values should be rounded off during playback. (as in this thread: Re: working on a script that will add a new work plan and remove the old if it is not a specific size)

    And if Luis Oyola can do something like this:

    var docRef = app.activeDocument;
    var paths = docRef.pathItems;
    
    for (i=0; i< paths.length; i++) {
        if (paths[i].fillColor.typename == "CMYKColor" ) {
            if (Math.round(paths[i].fillColor.cyan) == 0.0 &&
                Math.round(paths[i].fillColor.magenta) == 0.0 &&
                Math.round(paths[i].fillColor.yellow) == 0.0 &&
                Math.round(paths[i].fillColor.black) == 20.0 &&
                Math.round(paths[i].opacity) == 100.0) {
                    paths[i].fillColor.black = 100;
                    paths[i].opacity = 20;
                    } else {
                        alert ("Object(s) not recognized.");
                        }
                    } else {
                        alert ("Object not CMYK.");
                        }
                    }
    

    Have fun

  • Extensions are zoomed to make them too large for their panels and unusable

    All my extensions in PS are too big for their panels appearing like they're zoom 10 x so I only see a small part of them.

    Adobe_Photoshop_CC_2014.png

    Sorry, I forgot to come back and update this thread. I ended up get my machine to a backup because I started having other issues, this fixed my problem of Photoshop extensions as well. My best guess is that it was something with the OS X 10.10.2 beta. We'll see if the problem comes when 10.10.2 goes official.

  • Instance / alias of name for objects in Captivate 3?

    It is possible to assign instance names (or alias) to objects in Captivate (eg. a text box)? I want to be able to make a button object check another object (e.g. a text entry area) before deciding what to do on the 'success' (or failure). I don't see how to do it without (at least) with the instance names for objects (and then trying to write some actionscript to java, etc.) to connect.

    I'm new to Captivate so I can miss the obvious here...

    Bravo for assistance.

    Hello

    In Captivate-3 steps.

    Captivate 4 variable introduced and scripts. You can take a look at this.

    --

    Maury

  • Activate security for this Panel configuration

    Why does it display my panels built with Configurator sometimes in Ps Cs4?

    "If it please close all panels or restart Photoshop to activate security for this Panel configuration.

    Fence panels or you restart Photoshop does not allow signs but exporting Configurator allows them. Why I have to keep exporting?

    I think I've stumbled on the answer to this problem, so I want to pass on to others who have a similar problem.

    My experience is that it is an intermittent problem, so I asked what I do from time to time which could be the cause of this difficulty. The answer is that I use a program called CC cleaner to clean the temporary files (that in theory I don't need). I found, after the execution of CC cleaner, I have re - export the configuration file (that I get the error message that is described in a previous publication) so that the Control Panel, then open correctly when I open C S 4.

    I immediately run CC cleaner and found he wanted to delete only a single group of files located in the following folder:

    C:\Documents and utilisateur\Application Flash application * of Settings\nom. *

    So, I asked "CC cleaner", in order to exclude this folder and everything what it (for deletion):

    Now, if I'm running CC cleaner to get rid of all my temporary Internet files and other temporary files, but this does not change the folder above, and so far the Control Panel opens properly in Photoshop.

    I don't use Windows "disk cleaner" so I'm not sure whether or not this cleanser is a potential problem. In any event, it is the Macromedia folder described above that is causing the problem.

    It is clear that Adobe Configurator uses Macromedia flash to do its thing, so I hope I have this problem in the long term.

  • How to get the vertical scroll bar is displayed for control panel

    Hi there, Im a beginner in Flex and I'm working on my first application for a client. I have the most difficult time to get a vertical scroll bar to work for a Panel control, that I use. Here's the overview:

    1. I have a control of the application with a horizontal layout
    2. I have a Vbox left with 2 panels on top of the other,
    3 - I have a Panel on the right with a bunch of text controls just above another.

    the application looks like this. Think fair spaces and dashes since this wont let me enjoy the areas:

    ______________________
    | - - - - - - - - -| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - |
    | ---------------| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - | -browser window ends here
    | - - - - - - - - -| - - - - text - - - - |
    | - - - - - - - - -| - - - - text - - - - |
    ______________________


    MY PROBLEM: I would like the application to stay confined to the browser window and have scroll bars appear in the right panel when text controls contained too long for the browser window. Yet, I can't make it work, Ive tried to use clipContent = true and activation verticalScrollPolicy but nothing seems to make the sign on the right contrain at the height of the browser window.

    I have a feeling it's something really simple so any help would be LARGELY APPRECIATED!

    The best
    Stephen

    I have it! Thanks Darin for work through this with me. Liike looks like, I really need the Hbox, so do the layout of Panel = "absolute" as josh suggested. Then wrap all text with a vbox controls, Viola! I get scrolling as expected! Here's the final MXML:


    http://www.Adobe.com/2006/mxml"layout ="horizontal">











    Here is a bunch of text in a single text control

    ]]>





    Ashraf asdawdd wadmdwad mildm awdn wad I niawfnaf nawfn awfn awifn awf

    adsadwadwadawd

    asdadwavawvvawvaw

    ]]>





    asdasdsav

    asdasdsadwninib

    awnvndzln

    qwanil

    asbnil nl

    ]]>




    Thank you very much!
    s

  • The pending request for objects...

    Hello

    I have a Pl/Sql query that when run takes a long time to run.

    When I put a trace on this subject, I found he's waiting for 2 items and as soon as the wait is over the product query the result immediately.

    I tried puuting indexes on tables that had large files as I thought initially that he may have to wait because of full table scan, but it's not a great help.

    Earlier this query used to run within 5 minutes about 3 months back, but now it takes about an hour per day and when tracing is enabled, it shows again that it must wait for 2 objects.

    What im thinking is that earlier when the query used to run within 5 minutes the data in question was not so heavy, but since the last 2 months, the data are in millions of dollars each month.

    Could you suggest me a possible solution to this problem of waiting for objects.

    Thank you.

    Database version being used - Oracle 10 g

    Hello

    When I put a trace on this subject, I found he's waiting for 2 items and as soon as the wait is over the product query the result immediately.

    "he's waiting for 2 objects? What do you mean exactly by that?

    If you did a trace so why don't you post the tkprof output?
    Thanks for posting the tkprof (including waiting events) result and your PL/SQL procedure (or a representative piece of code examples)

    Put this tag =>

    before and after your tkprof output/code examples, so it says readable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    
  • (3) connection objects between the Explorer objects &amp; Panel

    LookoutDirect 4.5

    (3) in the object browser, I can see all the name of the object, but how can I quickly find out which object in the Control Panel, it is, or vice versa? It is quite difficult to check one by one from a long list.

    It is also a new feature of 6.2.

    So I think that the solution for you is to open a copy of the file .lks by the text editor and search for the location of the object from the source file.

  • Callback Extension object

    I'm developing an extension. I want to send an object to the callback function, I sent a String in the back and all is well. But I want to send an object that is part of my own class in this extension. How should I set this class so I can access this object and its attributes to the javascript widget? You have all the samples in this topic?

    Hi ibarrera,

    Usually, the best way to figure on this sort of thing is to check the actual APIs BB. If the data object is not very complex, because it seems to be in your case, nothing fancy is required. The code below has quickly ripped out of https://raw.github.com/blackberry/WebWorks/master/api/io/src/main/java/blackberry/io/file/FileProper...

    import net.rim.device.api.script.Scriptable;
    
    public final class Data extends Scriptable {
    
        private Hashtable _fields;
    
        private static final String FIELD_NAME = "name";
        private static final String FIELD_ID   = "id";
    
        public Data( String name, Long id  ) {
            _fields = new Hashtable();
    
            _fields.put( FIELD_NAME, name );
            _fields.put( FIELD_ID, id );
        }
    
        /**
         * @see net.rim.device.api.script.Scriptable#enumerateFields(Vector)
         */
        public void enumerateFields( Vector v ) {
            if( !_fields.isEmpty() ) {
                for( Enumeration e = _fields.keys(); e.hasMoreElements(); ) {
                    v.addElement( e.nextElement() );
                }
            }
        }
    
        /**
         * see net.rim.device.api.script.Scriptable#getElementCount()
         */
        public int getElementCount() {
            return _fields.size();
        }
    
        /**
         * @see net.rim.device.api.script.Scriptable#getField(String)
         */
        public Object getField( String name ) throws Exception {
            Object field = _fields.get( name );
            if( field == null ) {
                return UNDEFINED;
            }
            return field;
        }
    }
    

    Something more complicated case the source of audio extension for the Player objecthttps://github.com/blackberry/WebWorks/tree/master/api/audio/src/main/java/blackberry/audio/Player

  • Template for HTML5 Panel structure

    Hello

    Is there a template directory/file structure to create a HTML5 Extension Panel to the body?

    Or the documentation on creating a HTML5 Extension Panel to the body?

    My problem is that I created a HTML5 Extension Board (based on the PProPanel) Agency on 1 computer and it works fine.

    I copied on a second computer and when I tried to load the Extensions Panel, I get a "Exception: IOError: file or folder does not exist.


    After pressing 'OK '.  A "Run Script Error - undefined is not an object."


    After pressing 'OK '.  My load with the button panel all appear but then "Run Script Error - undefined is not an object." for each button.


    I copied the same folder structure on computer 2, so I'm stumped.


    Thanks for any thoughts,

    Kelly

    PProPanel is specific to the Organization, and there is no documentation beyond the quick start guide.

    The fact that it is running on a machine and not the other suggest that the problem is specific to these configurations. Maybe your Panel made reference to external files or folders, you copy the new machines?

    If you want to send me the band's repertoire, I can test it here.

Maybe you are looking for

  • Firefox won't load at all because of the ATL error message

    When I touched the Firefox icon and error message comes to say Uniode error AtL80.DLL and she even try to load because I can not get the error message to close. I have to shut my computer down and when he returns to the top, and then try again., the

  • Compaq mini 110 c-1010ET: System

    Hello don't boot up my laptop. Do the writing on the screen: Enter the CURRENT password: X Enter the CURRENT password: X Enter the CURRENT password: X Password check failed Fatal error... System stopped. CNU9303QB4 Thank you

  • attachments: I have a folder in my email account and I want to join the entire folder to a new email

    I have a folder in my email account and I want to join the entire folder to a new email

  • Update Firmware of SonicWall tips

    This SonicWall has been neglected for some time and I tried to make the updates of the firmware on it. I took a look at the firmware versions and took note of all the necessary updates. Can anyone offer advice to keep in mind if I'm going to update t

  • Cannot delete the sync partnership

    This is the second time that this has happened after I re-installed Windows 7 to solve it the first time. When I have copied a standard file from W7 as my Pictures\Slideshows or moved to the location of Username\Downloads on a network share, it creat