Check generate some Comp based on the drop-down list box and the selection list?

I currently have a dropdown list with the three sizing options in it. Then I have two check boxes, one is ticked ideally would create the model to its normal size composition and if other is checked that it would reverse the widthxheight in the size of the composition. Then below that I have a "Generate" button, I want to be able to click and according to my selections, it creates the model.

Looks like I need a kind of if then statement, but I'm having a hard time putting the two together. See below what I have so far.

There may be missing parts, but I have it all working in a decibel pallate currently. I don't have functionality related to a button again.

Any help would be appreciated!

(also I don't know how to format the script spread here so apologies for that)

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

palette controls

templateGen.VerticalCheckbox = new Object();

templateGen.HorizontalCheckbox = new Object();

set the values for controls

templateGen.comLookup = new Object();

templateGen.compLookup = 'Template1 ';

templateGen.compLookup = "Template2";

templateGen.compLookup = "Template3."

function templateGen_getHashValues (hash)

{ // {{{

var ary = new Array();

for (k hash) {}

ARY.push (Hash [k]);

}

return area;

} // }}}

menu "composition".

var panelGrp1 = templateGen.palette.add ('Panel', undefined, 'Templates Comp');

compGrp1 = panelGrp1.add ('group', undefined, 'List templates');

compGrp2 = panelGrp1.add ('group', undefined, 'Orientation');

compGrp3 = panelGrp1.add ('group', undefined, 'Generate');

templateGen.compList = compGrp1.add ('dropdownlist', LIST_DIMENSIONS, templateGen_getHashValues (bapple.compLookup));

templateGen.compList.helpTip = "choose the type of desired here device model. All compositions are 60 fps. « ;

templateGen.compList.selection = 'Template1 ';

templateGen.compList.graphics.foregroundColor = darkColorBrush;

templateGen.VerticalCheckbox = compGrp2.add ('checkbox', undefined, 'Portrait');

templateGen.VerticalCheckbox .value = true;

templateGen.HorizontalCheckbox = compGrp2.add ('checkbox', undefined, 'Horizontal');

templateGen.HorizontalCheckbox .value = false;

templateGen.generateBtn1 = compGrp3.add ('button', undefined, 'Generate');

applyBtn.onClick =? ;

When I work with drop-down menus, I always liked to tie the data they represent (like the width and height of the model in this case) directly to the elements.

I run the code to really check, but it should work like this:

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

Add models to your drop-down list and store the items in a table

models var = [];

models [0] = templateGen.compList.add('item','template1');

models [1] = templateGen.compList.add('item','template2');

models [2] = templateGen.compList.add('item','template3');

set a width and height of each element

models [0] .width = 1280;

models [0] .height = 720;

models [1] .width = 1024;

models [1] .height = 768;

models [2] .width = 1920;

models [2] .height = 1080;

Choose the item that should be selected by default

models [0] .selected = true;

applyBtn.onClick = function() {}

read the width and height of the selected item

var width = templateGen.compList.selection.width;

var height = templateGen.compList.selection.height;

{if (templateGen.VerticalCheckbox.value)}

swap width and height

var temp = width;

width = height;

height = temp;

}

now create your comp here with the given width and height

}

Tags: After Effects

Similar Questions

  • Create a secondary named calculation in a repeating subform based on a drop down list?

    Hi all

    I need a little crazy script. Not sure it is even possible.

    What I have:

    1. repeating subform SummarySub amounts
      1. calculation at the end of the form TotalOver field gives the total dollar amount of all iterations of SummarySub

        so far, so simple. but then:
    2. I need another, repeating the SubRow subform at the end of the form to give to other total:
      1. based on the drop-down list the name of the originator in SummarySub
      2. and break out the totals of all iterations of SummarySub based on payer such as chosen by the user names.

    Ideally, the subform (the principal totals) (B) at the end of the form would add instances as the user leaves the field name of the payer. I was not able to find a way to make and to keep the value in the field (name of the payer) of the additional instance.

    All this makes sense?

    I'll appreciate any help.  I'm trying to learn more about JavaScript in LC, but my bills just keep coming...

    Thank you very much

    Laura

    Dropbox - AFBS_OverpaymentReport_121914.pdf

    Hi Laura,

    Take a look at the modified version of your form, https://sites.google.com/site/livecycledesignercookbooks/home/AFBS_OverpaymentReport_01011 5.pdf? attredirects = 0 & d = 1.  I added a subform called PayerTotals, which has a summary of insurance created in his event to calculate.  The code looks like.

    var oFields = xfa.resolveNodes("SummarySub[*]"); 
    
    var nNodesLength = _SummarySub.count; 
    
    var nSum = 0; 
    
    var insuranceCompanies = {}
    
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) { 
    
     var item = oFields.item(nNodeCount);
    
     if (!item.InsuranceCompany.isNull && !item.OverpaymentAmount.isNull) {
    
     if (insuranceCompanies[item.InsuranceCompany.rawValue]) {
    
     insuranceCompanies[item.InsuranceCompany.rawValue] += item.OverpaymentAmount.rawValue
    
     else {
    
     insuranceCompanies[item.InsuranceCompany.rawValue] = item.OverpaymentAmount.rawValue
    
      nSum += item.OverpaymentAmount.rawValue; 
    
    totalover.rawValue = nSum;
    
    _PayerTotal.setInstances(0);
    
    for (var insuranceCompany in insuranceCompanies) { 
    
     var payerTotal = _PayerTotal.addInstance();
    
     payerTotal.InsuranceCompany.rawValue = insuranceCompany;
    
     payerTotal.totalover.rawValue = insuranceCompanies[insuranceCompany]; 
    

    Hope this helps

    Bruce

  • Please help a poor beginner to open a text box based on a drop-down list

    Hello world

    I am quite new to the life cycle and my experience isn't in the lineup, so I hope that you will be kind to me. I designed a form that we use to send to our Bank to hire contractors. I need to make a text field become visible collection of some inscriptions on the drop-down list. for example, if an entry in the drop-down list "Holiday", I need another text field become visible to the user of maunally enter an extension number. If the user selects, say, "Study leave", I need the text box to stay invisible to the user.

    I hope this makes sense.

    Thank you guys & Gal

    Heavy E

    It is a java script placed on the drop-down list on the change event;

    If (xfa.event.newText is "Vacancy")
    TextField1.presence = "visible";

    else TextField1.presence = "hidden";

    Field1 text is defined as hidden

    To answer your second example, add in the same field:

    If (xfa.event.newText is ' Study/leave')
    TextField1.presence = "hidden";

    If it's confusing, let know us

  • How to fill a textfield based on a drop-down list and a checkbox control

    Hi guys,.

    I need help.
    first step: I have a drop down list, if I click in the dropdownlist control 'a' and place it in the digital field a number greater than 99, checkbox must be marked and second step: a textfield1 must be visible.

    the first stage works perfectly, but the second does not.
    This is my code for the second stage of the event: java script of change of

    If ((DropDownList1.rawValue == "a") & & (this.rawValue == 1))
    {
    TextField1.presence = "visible";
    }
    on the other
    TextField1.presence = 'hidden ';


    everyone has no idea why?

    Thank you!!

    Diana

    Hi Diana,

    You are on the right track. deleteItem is zero base; so if you want to remove the second point, it would be deleteItem (1).

    I would recommend a script similar to the output from the drop-down list, so that if the user goes back and changes the value, the same logic would apply. Also when you remove items from a drop-down list by using script, it is useful to addItem() again in the other part of the if statement. In this way, you can restore the list because the shape is changed.

    Also I would wrap the script in the numberField in another State to check for null first.

    Attached example.

    Good luck

    Niall

  • Fill other fields based on a drop-down list box

    Hello

    I am completely new to LiveCycle and just starting to teach me how to use it.

    I want to speed up the filling of a purchase order by bringing them to fill based essentially on what is put in other areas.

    For example, I would like to than our usual suppliers to be included in a drop of water to the bottom of the box (I know not how, at least) and then have the address fields automatically filled.

    I know that I can do this using javascript, but it is rather annoying because I don't want to sit here put 276 suppliers in my script. In addition, I don't want to have to edit the script whenever we want to add a new provider.

    Is it possible to create a form that made it and can pull info on another file or database? Also, I would make it pretty fool-proof when it comes to adding new suppliers.

    Thank you

    Darryl

    The way to proceed is to hang on to the top of the drop-down list for a service web and that the web service returns a list of providers (in load of the form). Once the user selects a supplier a second web service would draw information and fill in the appropriate fields.  This technique is easier to configure on the client machines (as all the information is contained in the form). You will need to get another piece of software called LiveCycle Reader Extensions Server to allow the form make calls from web service of the player (assuming that the reader is used).

    The form can connect to a database directly, but this solution has drawbacks as well. You need to configure a dataconnection on each machine as the machine must be on the same network as the DB. It will work on Windows machines. You also punctuated by player to allow DB with Reader connections.

    Hope that helps

    Paul

  • Change an amount (that docks a calculation) based on a drop-down list

    Hi all.

    As I said in the title, I'm trying to dynamically change a field (called CostSalesforce) dynamically from the selection of the field drop-down list (salesforce_company) and have this indictment in a running total that I have form and quantity changes.

    2015-10-22_1343.png

    Fixed the amounts you want to use as the values of export for each of the items in the drop-down list field, and then use this field in your calculation as you would a text field.

  • Some way to make a drop-down list with dressing

    I is it possible to make a drop-down list contains a long sentence and when you select the sentence, he trained actually phrase to encapsulate in a multi-line text box?  I seem to be able to enter a fairly long series of words in the drop-down list, but when you make a selection of the text encapsulates not and the right edge of the field cost overruns.  If this can be done is a way of pre-existing reference somewhere else comments hidden in the shape and align them on the field with the selection list?

    I think that this is a limitation in the LC Designer. However, you get the sentence on mouse hover.

  • Can not get a text field to atuo fill based on a drop-down list selection

    I have a drop down box with 3 values that can be selected:

    Dropdown2 is 101-3 subd. A

    101-3 subd. B

    101-3 subd. C

    I'm trying to get a field of text automatically fill based on selection:

    If Dropdown2 = 101-3 subd. A Text4 then = 'a. '.

    If Dropdown2 = 101-3 subd. B then Text4 = 'b. '.

    If Dropdown2 = 101-3 subd. C then Text4 = 'ValueC.

    I tried to create a custom for Text4 calculation script:

    var v = getfiled("Dropdown2").value;

    If (v = "subd 101-3. A") event.value ="A."

    ElseIf (v = "subd 101-3. B") event.value ="B."

    ElseIf (v = "subd 101-3. C') event.value = "ValueC."

    else event.value = "";

    I walked into this script and syntax seems to be OK. (At least for Acrobat XI.  I'm not know programmer and have just enough knowledge to be dangerous).  When I select a value in Dropdown2 nothing happens.  No value appears in Text4.  I checked the "selected value immediately commit" in the Dropdown2 option by google'ing.  I don't understand why the values do not appear.  Any help would be appreciated.

    Thank you

    You made a mistake... The comparison operator is "is" (or ' = '), not of '=', which is used to assign a value.

    So replace all these:

    If (v = "subd 101-3. A")

    To do this:

    If (v is "subd 101-3. A")

  • The PHP/MySQL dynamic drop-down list

    I know this should be easier he became... I even bought two new books on PHP and Dreamweaver, and I'm still lost.

    I am trying to create a very simple search for a Web site. This research would be a category based with a drop-down list only search. There would also be an admin section that would add new records to the DB.

    So far, I have created a basic admin page that submits new records to the appropriate categories.

    I created a simple search with a dynamic Drop Down page, and I have created a basic results page.

    If the problem I have is that the Drop Down dynamic list shows the names of similar category according to the number of records exists. Where it should show only the unique category names.

    Once selected, the results page and the records are displayed correctly using a dynamic array.

    Anyone know what I should do to change this dynamic list so that it does not display the duplicate names?

    Thank you.

    destind4film wrote:
    > Can give you details on how to do it. I saw this same response in another
    > post in the forums but I do not understand where this setting is.

    This is a very basic SQL query. The SEPARATE after that SELECT keyword ensures
    that duplicate records are removed from the Recordset.

    > I checked my phpmyadmin and there is an option for single, but it will not
    > work for categories in my PB because there are naturally several entries
    > with the same name of category attached.

    UNIQUE is a type of index that forces a column to store only unique values.

    > I don't see this option in DW.

    You will not. Dreamweaver provides the absolute basics to create the
    code for working with a database. Unless you want to be severely limited in
    what you create, you have to learn a few basics of database
    design and build your own SQL queries.

    To add SEPARATE to your basic SQL query, you must click on the Advanced
    button in the Recordset dialog box and insert it into the SQL query by hand.

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Width of drop-down list and the number of drop-down list values

    How to increase / decrease the width of a drop-down list on the screen of your interview? In addition, how you increase the number of menu options drop-down user, some of my options in drop-down list don't show up. This shows only 3 points:...

    For OPM 10.4:

    Increase the number of visible items in a drop-down list

    There are two options:

    1. make a regular drop-down list instead of a list of drop-down list box. Regular drop-down lists always display all items, regardless of the length of the list. To do this, set "enable-search-comboboxes = false" in the appearance.properties file. "

    2. increase in the search results max for the combo box in the file appearance.properties, for example 'search max-results = 20' (or another number as appropriate)

    See article OPM the User Guide for more details: http://docs.oracle.com/html/E54499_01/toc.htm#Interviews%20and%20flows/Customize_Web_Determinations.htm#Change4

    I have a vague memory that the increase in the width of the drop-down lists is a bit more tedious. I'll take a look and post here...

    See you soon,.

    Jasmine

  • How do I automatically populate the text field box based on data generated automatically in the drop-down list?

    I created a drop down list which includes various regions.  When a region is selected it auto-renseigne another drop-down list with places.  I would like to automatically fill a text field with predetermined phone numbers when you have selected a location in the drop-down list of "places".  I want to integrate the phone numbers in the code, since the form will not access a database.  Any help would be greatly appreciated.  Thank you, Ed.

    Hello

    Here is the link to your form. https://Acrobat.com/#d=BaCL7BKKdAcgV3JIk61nZg

    You have the updated field matches in the event changes from the 2nd menu drop-down.

    While referencing you use .page1 while your page is Page1.

    Thank you.

    Sidonie.

  • show/hide fields based on the drop-down list of choices

    I have a field from the drop-down list with three choices. Based on the selection, I need a specific text form field to appear and the others to stay hidden. (Or if it makes the code cleaner, the resulting field could be a drop-down list, too, with the selected choice.) I don't know Java well enough to extrapolate the code from the examples online and it fit my forms. I can provide an example of form. Thanks in advance for your help.

    There are ways to run this.  the easiest for you would be to add this script to the event (calculation of the Properties tab) to calculate the field that must be hidden.  Take notes, all "/ /" is some tips for you to understand the code.  You will need to put this script in all the areas you want to replicate the behavior, change the value depending on what you want to accomplish.  the word 'event' means myself to make you understand.

    If (this.getField("dropdown").value == 'put value here') {//replace "drop down" with the name of the drops}

    Event.Target.Display = display.visible;

    }

    else {}

    Event.Target.Display = display.hidden;

    }

    This works if you have a small amount of fields.  If you manage to have a large number of similar fields, let me know because there are other, faster ways.

  • Creation of calculation based on the result of the drop-down list

    Hello. I hope that someone will be kind enough to help me with some Javascript because it seems that I am too blonde and middle ages to figure out by myself.

    I have a drop-down list box 'Member '. The Yes value is 0. The value is 10.

    Then I have three check boxes. "Day 1" value is 35. "Day2" value is 25. 'Dinner' value is 65.

    If this option is enabled, I want the sum of the check boxes, if they are checked. (for example, total if all checked = 125)

    If no is selected, the value of each check box rose 10. (for example, total if all checked = 155)

    I use Acrobat X.

    Thanks in advance.

    Due to the fact that you want to add a constant number of values if a given condition is met then you will need to use a custom calculation script.

    get the value of the fields

    var cMember = Number (this.getField("Member").value);

    var nDay1 = this.getField("Day1").value;

    var nDay2 = this.getField("Day2").value;

    var nDinner = this.getField("Dinner").value;

    define a varaiable for the sum

    var sum = 0;

    day 1 more SETTINGS

    If (nDay1! = "Off") the sum += (nDay1) Number + cMember;

    day 2 more SETTINGS

    If (Day2! = "Off") the sum += (nDay2) Number + cMember;

    more dinner SETTINGS

    If (nDinner! = "Off") the sum += (nDinner) Number + cMember;

    Event.Value = sum;

    Excel is easy if you would see Microsoft calculations.

  • fill a list based on a value from the drop-down list box

    Well, I know a way around it but its quite long with what I know. I worked on a better solution for a day now. So maybe (or likely) someone knows better. I'm trying to fill a drop drop down based on a user selection figure in a list of check boxes. I know I could create several drop-down lists and hide away them until the user changes the value of binding. But the dropdowns would consume a lot of space in my form design in liveCycle. So is there another way or I'm stuck he made a long journey. I also need to assign values to these elements, since they change because the values are used as item numbers later that fill a text/number field later in form as a list of materials.

    Tell me if I'm wrong, please (I'm new to all this)

    in the box in the click event

    If (this.) RawValue == 1)

    {

    dropDownList1.addItem ("item # 1", "value1111");

    dropDownList1.addItem ("item # 2", "value2222");

    }

    on the other

    {

    dropDownList1.rawValue = "null";

    }

    I'm sure that null is not good and I don't know that I have to set the drop-down menu to clear items on preOpen. Or maybe not. And there is a way to add items without the addition of a new right of the line? I'm on the right track?

    Hello

    Rather than having the script in each of the boxes, you can have the script in the event preOpen the drop-down list that leans on the boxes.

    I downloaded an example here: https://acrobat.com/#d=VwREjsMgvqXpVqPu54kSNw

    Take a look at the preOpen the dropdown event.

    // clear the dropdown displayed value and items
    this.rawValue = null;
    this.clearItems(); 
    
    // repopulate the items based on the checkboxes
    if(fruit.rawValue == 1)
    {
         this.addItem("Apples", "fruit_001");
         this.addItem("Pears", "fruit_002");
         this.addItem("Oranges", "fruit_003");
         this.addItem("Bananas", "fruit_004");
         this.addItem("Grapes", "fruit_005");
    }
    
    if(cars.rawValue == 1)
    {
         this.addItem("Volvo", "car_001");
         this.addItem("Ford", "car_002");
         this.addItem("Opel", "car_003");
         this.addItem("Toyota", "car_004");
         this.addItem("Nissan", "car_005");
    }
    
    if(counties.rawValue == 1)
    {
         this.addItem("Co. Tipperary", "county_001");
         this.addItem("Co. Cork", "county_002");
         this.addItem("Co. Dublin", "county_003");
         this.addItem("Co. Clare", "county_004");
         this.addItem("Co. Kerry", "county_005");
    }
    

    Hope that helps,

    Niall

  • Jdev v.10.1.3.4 - hide inputtext af based on the drop-down list box

    Hello

    I'm trying to hide and display a text entry box based on what is selected by a drop-down list box. I have some difficulty getting the javascript code I think that to read the value of the selection box.

    Here is a simple example of what I'm trying to do. I tried a couple of different ways but no luck. I appreciate any help anyone can offer.

    Thank you
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view>
      <afh:html>
        <afh:head title="test">
          <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    
        </afh:head>
        <afh:body>
    <f:verbatim>
            <script type="text/javascript">
            function changed(){
               if(document.getElementById("current").value =="1" ){
                document.getElementById("currentSize").style.display='block'; //show textbox
                }
                else{ 
                document.getElementById("currentSize").style.display='none'; //hide textbox
                }
            }
            
            </script>
    </f:verbatim>
        
        
        
        <h:form>
            <af:selectOneChoice id="current" label="select item" onchange="change();">
              <af:selectItem label="item 1" value="1"/>
              <af:selectItem label="item 2" value="2"/>
              <af:selectItem label="item 3" value="3"/>
              <af:selectItem label="item 4" value="4"/>
            </af:selectOneChoice>
          <af:inputText label="Input Size:" maximumLength="5" id="currentSize" columns="7" rows="1"/>              
          </h:form></afh:body>
      </afh:html>
    </f:view>

    It works if you use af:form instead of h:form?
    What happens if you set the partial relaxation of the af: form to point to the 'current '?

Maybe you are looking for