myPanel.grp.myTabbedPanel.myTab1.onChange = function

How can I make an onChange or onClick function to my tab?

{

function myScript (thisObj) {}

function myScript_buildUI (thisObj) {}

var myPanel = (thisObj instanceof Panel)? thisObj: new window ("palette", "Estudio Voraz Panel', undefined, {resizable: true}");

myPanel.layout.resize ();

res = "group {orientation: 'column', margins: a spacing of 0: 0,------}»

alignment: ["fill", "fill"] alignChildren: ['fill', 'top'],

myTabbedPanel: Panel {type: 'tabbedpanel'------}

myTab1: Panel {type: 'tab', text: 'Salidas', margins: [4,8,4,8], spacing: 5, alignChildren: ['fill', 'center'],------}

},\

},\

myTab2: Panel {type: 'tab', text: "Plecas"------}

imageWIP: IconButton {text: 'In PROGRESS', alignment: ["top", "top"], preferredSize: [372 180]},

},\

myTab3: Panel {type: 'tab', text: 'Bites',------}

imageWIP: IconButton {text: 'In PROGRESS', alignment: ["top", "top"], preferredSize: [372 180]},

},\

myTab4: Panel {type: 'tab', text: 'Menus'------}

imageWIP: IconButton {text: 'In PROGRESS', alignment: ["top", "top"], preferredSize: [372 180]},

},\

myTab5: Panel {type: 'tab', text: 'Wipers'------}

imageWIP: IconButton {text: 'In PROGRESS', alignment: ["top", "top"], preferredSize: [380 180]},

},\

}";

myPanel.grp = myPanel.add (res);

myPanel.grp.spacing = 0

FUNCTION

myPanel.grp.myTabbedPanel.myTab1.onChange = function() {}

What

{

case 'tab1 ':

blablabla

}

END PANEL - NO PONER NADA ESTA LINEA ABAJO.

Return myPanel;

}

var myScriptPal = myScript_buildUI (thisObj);

If ((myScriptPal! = null) & & (myScriptPal instanceof window)) {}

myScriptPal.center ();

myScriptPal.show ();

}

}

myScript (this);

}

I want to do some functions for different cases of tab. For example:

When I change the brand Tab2 a function etc.

this. Selection , this is what tells you what tab was clicked. This is how you identify the purpose of the tab. If you want to perform a function based on the clicked tab, you would use this.selection and then feed the installation of switch that you had originally.

myPanel.grp.myTabbedPanel.onChange = function(){
    var selectedTab = this.selection;
    switch(selectedTab.text){     //Use tab name as unique identifier
          case "Salidas":     //If Salidas was clicked...
              //...run function here
              break;
          case "Plecas":     //If Plecas was clicked...
              //...run function here
              break;
          //and so on for the other tabs you have.
    }
}

The purpose of the tab has these properties...

imageWIP

assets

alignment

characters

justify

text

Graphics

visible

limits

location

maximumSize

minimumSize

preferredSize

size

windowBounds

alignChildren

children

page layout

margins

orientation

spacing of

Properties

activated

helpTip

dash

layoutDirection

parent

textDirection

window

type

.. .and may use these methods:

Close()

Show()

masquer()

Add()

Remove()

toSource()

addEventListener()

removeEventListener()

dispatchEvent()

Tags: After Effects

Similar Questions

  • How the fire javascript Onchange function AUTOMATICALLY

    Hello

    I have 2 items together is to have a javascript function Onchange.

    P1_SELECT_LIST1 (javascript - Onchange1)
    P1_SELECT_LIST2 (javascript - Onchange2)

    I want Onchange2 automatically runs whenever Onchange1 is executed.
    I mean whenever Onchange1 is executed... I want the fire automatocally Onchange2 javascript...

    Thank you
    Deepak

    Deepak,

    I don't have what you're trying here?

    P1_SELECT_LIST1 - attributes of HTML form elements
    OnChange = "JavaScript:F1 (this); »

    function f1 (pThis)
    {
    $x_Value ('P1_YYYY', 'XX');
    }

    So now change SL1, f1 is triggered and you pass the object to the f1. But you do not use? So what is the use of pass?

    In your initial post...

    I want Onchange2 automatically runs whenever Onchange1 is > run.

    But you do it in reverse?

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

    However, try...

    P1_SELECT_LIST1 - attributes of HTML form elements

    onchange="javascript:f1();"
    

    P1_SELECT_LIST2 - attributes of HTML form elements

    onchange="javascript:f2(this);"
    

    Page - header HTML

    
    

    Kind regards
    Hari

  • onClick, onBlur, onChange function etc.

    I ' v browsed number of threads and found that (for example) 'The HTML Form element attributes' people can fill "onBlur, onClick, onChange, etc.". In fact what programming language is used to fill this? Functions of "onXXX" how many out there? Documentation can help.
    Thank you.

    Gamez.

    Hello

    what you're talking about are the javascript event handlers. Since I'm German I this quick overview for you: http://de.selfhtml.org/javascript/sprache/eventhandler.htm

    Maybe you can use it to search the function names in the web.

    Welcome them

  • onChange Panel tabs, had an error in my window Panel.

    I have a problem with my Panel of the window, when I close the Panel after effects I had this NULL IS NOT AN OBJECT error in this line: switch (selectedTab.selection.text) how can I fix that?

    The thing is that I have this case to call my TabbedPanel with the names of different tab, but when I close the Control Panel window I got this error.

    // FUNCIONES EL TABBED PANEL
    myPanel.grp.myTabbedPanel.onChange = function(){ 
        var selectedTab = myPanel.grp.myTabbedPanel;
        switch(selectedTab.selection.text){
              case "Salidas":     //If Salidas was clicked... 
                    
                        myPanel.grp.myTabbedPanel.myTab1.ddPanel.selection = 0
                    
                  break; 
              case "Plecas":     //If Plecas was clicked... 
    
    
                         myPanel.grp.myTabbedPanel.myTab1.ddPanel.selection = 0
                        
                  break; 
              //and so on for the other tabs you have. 
              default:
              break;
        } 
    } 
    

    This means that the selectedTab is not a choice.

    Add the following statements before your error line:

    If (! selectedTab |! selectedTab.selection) return;

  • User input handling using the GUI resource string...

    I know that I can pass values in the resource string to energize the GUI. I was able to transmit values in and even create loops through several items in a listbox.

    Is it possible to add several EditText boxes to the resource string or I can only pass values to a box of EditText already contained in the resource string? For example: in my code below, I have a "myEditText: EditText {text: 'My text edit'},-" in my groupTwo. Apart from my resolution (resource string) I pass values in the res (see: / / by default). Is it possible for example to create several EditText elements in the Res based on the selection of the users on the drop-down list?

    myScript (this);

    function myScript (thisObj) {}

    var myScriptPalette = myScript_buildUI (thisObj);

    function myScript_buildUI (thisObj) {}

    var myPanel = (thisObj instanceof Panel)? thisObj: new window ("palette", "my window name', undefined, {resizable: true}");

    {//Build GUI

    res = "group {orientation: 'row',------}.

    groupOne: group {orientation: "column,"------}

    MyButton: button {text: 'Name of button'}, \

    myCheckbox: checkbox {text: 'Checkbox'}, \

    myRadioButton: RadioButton {text: 'My Radio button'}, \

    myDropDownList:DropDownList {properties: {items: ["Item1 DD',"DD Item2","DD Item3","DD Item4"]}}, \

    myProgressBar: Progressbar {text: "Progressbar", value: 50}, \

    },\

    groupTwo: group {orientation: "column,"------}

    myIconButton: IconButton {text: 'IconButton' image: ' /Users/design2/Desktop/PanelTutorial/images/AFG.jpg'},\}

    myImage: Image {text: 'Image', image: ' /Users/design2/Desktop/PanelTutorial/images/AFG.jpg'},\}

    myStaticText: StaticText {text: 'My static text'}, \

    myEditText: EditText {text: 'My text edit'}, \

    mySlider: Slider {text: 'My Slider', value: 25}, \

    myScrollbar: scroll bar {text: 'My scroll bar', value: 50}, \

    },\

    }";

    }

    myPanel.grp = myPanel.add (res);

    Default values

    myPanel.grp.groupOne.myCheckbox.value = true;

    myPanel.grp.groupOne.myDropDownList.selection = 0;

    myPanel.grp.groupOne.myProgressBar.value = 20;

    Return myPanel;

    }

    If ((myScriptPalette! = null) & & (myScriptPalette instanceof window)) {}

    myScriptPalette.center ();

    myScriptPalette.show ();

    }

    }

    Hi Shawn, welcome to the forum. I did a little test today after your last email. This is what works to add dynamically to the user interface. The overall user interface must first be resizable with the elements follows the same path, so...

    (1) just above the back line you need to add:

    myPanel.layout.layout (true);

    myPanel.grp.minimumSize = myPanel.grp.size;

    myPanel.layout.resize ();

    myPanel.onResizing = myPanel.onResize = function () {this.layout.resize () ;}

    Return myPanel;

    }

    (2) then for the sake of simplicity we will place the current edittext area in a group...

    groupThree: group {orientation: "column,"------}

    myEditText: EditText {text: 'My text edit'}, \

    },\

    (3) then you will need to determine your list dropdown onChange function. In this case I put it to the top to add an edittext area based on the selection of the index from the drop-down list. This point we create a box, two creates two and so on.

    myPanel.grp.groupOne.myDropDownList.onChange = function() {}

    child var = myPanel.grp.groupTwo.groupThree.children [0] .size;     Grab the first dimensions edittext

    var n = myPanel.grp.groupTwo.groupThree;     Group variable

    var idx = myPanel.grp.groupOne.myDropDownList.selection.index + 1;     Index number of drop-down list selection + 1 offset 0 function array returned value.

    for (var i = 0; i)

    n.Add ('edittext', [0, 0, child.width, child.height], 'Hi');

    }

    n.Layout.Resize ();     Resizes the Group

    myPanel.grp.layout.layout (true);     Updates the layout of the items in the Group

    myPanel.grp.layout.resize ();     Resize the main window of the user interface

    n.Show ();     Reveals results

    }

    (4) I also added a button function to remove editboxes so you can see how it works.

    myPanel.grp.groupOne.myButton.onClick = function() {}

    GRP var = myPanel.grp.groupTwo.groupThree;     Group variable

    var lastKid = grp.children.length - 1;     Last child edittext in the Group

    If (lastKid! = 0) {//Making sure that the last edittext is not the original one source.

    GRP. Remove (BRM. Children [lastKid]);     Remove it

    GRP. Layout.Resize ();

    myPanel.grp.layout.layout (true);

    myPanel.grp.layout.resize ();

    GRP. Show();

    }

    }


  • myDropDownList.onChange buttons hide/visible, staticText etc., but scrolling through albums of all components

    Here is my code, but the thing is when I change my ddList that all objects of the Panel remain in the same place, so the thing is that I want to hide things but scrolling upward things have ordered more of my Panel.

    C5 ToolKit v1.0

    An after effects Script by Adrian Wülfrath

    // [email protected]

    Estudio Voraz

    VARIABLE CALL PARA A LAS DISTINTAS IMAGENES

    var imageName0 = "_vorazimg/voraz.png";

    var imagePath0 = File($.fileName).path + ' / ' + escape (imageName0);

    var imageName1 = "_vorazimg/off.png;

    var imagePath1 = File($.fileName).path + ' / ' + escape (imageName1);

    var imageName2 = "_vorazimg/sni.png";

    var imagePath2 = File($.fileName).path + ' / ' + escape (imageName2);

    var imageName3 = "_vorazimg/sna.png";

    var imagePath3 = File($.fileName).path + ' / ' + escape (imageName3);

    var imageName4 = "_vorazimg/proyectoBtn.png";

    var imagePath4 = File($.fileName).path + ' / ' + escape (imageName4);

    var imageName5 = "_vorazimg/sva.png";

    var imagePath5 = File($.fileName).path + ' / ' + escape (imageName5);

    Voraz Explorer button

    var winBrowserCmd = "C:/Program Files/Internet Explorer/iexplore.exe."

    var macBrowserCmdStart = "osascript-e ' open location------" ";" "

    var macBrowserCmdEnd = ' \ ' "";"

    AQUI BEGINS HAS CREARSE VENTANA DEL PANEL

    {

    function myScript (thisObj) {}

    function myScript_buildUI (thisObj) {}

    var myPanel = (thisObj instanceof Panel)? thisObj: new window ("palette", "Estudio Voraz Panel', undefined, {resizable: true}");

    res = "group {orientation:"column",-}".

    groupOne: Panel {text: 'Master', direction: "column", alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    ddPanel: DropDownList {properties: {items: ['OFF', 'Salida No. Image', 'Salida No. Astérix', 'Salida Ventana Asterix','-']}}, \

    },\

    groupTwo: Panel {text:' template:', direction: "column", the alignment: ['fill', 'top'], alignChildren: ["fill", "fill"],------}

    imageDemo: IconButton {text: 'Model Salida No. Image',}, alignment: ["fill", "fill"],

    },\

    groupThree: Panel {text: 'Color System + line selector', direction: "column", alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    ddColorSystem: DropDownList {properties: {items: ['Amarillo', 'Morado', 'Blue', 'MidBlue', 'DarkBlue','Roj o ']}}, \

    ddLineSelector: DropDownList {properties: {elements: ['line 1' ", ' 1 Hashtag + line" ", ' 1 line + Info", 1 Line + Info + Hashtag ','-', "2 lines","2 lines + Hashtag" ", ' 2 lines + Info", 2 lines + Info + Hashtag ',' '-', ' 3 lines "", ' 3 lines + Hashtag "", ' 3 lines + Info ' ", ' 3 lines + Info + Hashtag"]}},

    },\

    BtnGroup: Panel {text: 'Botones' orientation: 'row', alignment: ['fill', 'top'],------}

    editText: button {text: 'Edit text', alignment: preferredSize ['fill', 'left'],: [80,25]},

    editCaritas: button {text: 'Edit Caritas', alignment: preferredSize ['fill', 'left'],: [80,25]},

    editIconos: button {text: "Edit Iconos", alignment: preferredSize ['fill', 'left'],: [80,25]},

    editImage: button {text: "Change image", alignment: ['fill', 'left'], preferredSize: [100,25]},

    },\

    groupFour: Panel {text:'Caritas / Iconos, direction: "column", alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    ddArreglosAsterix: DropDownList {properties: {items: ['OFF', "Caritas Astérix", 'Iconos Astérix']}}, \

    },\

    groupChecker: Panel {text: 'Options', orientation: 'row', alignment: alignChildren ['fill ', ' fill'],: ["fill", "fill"],------}

    ddPatterns: DropDownList {properties: {items: ['Models OFF', '-', "Acción", "Comedia", "Deportees", "Girly", "Geek", "Todo",' -','EXTRA ','-',' ASTERIX ']}},

    CBfoto: Case {text: "Foto"},

    CBWipper: Case {text: 'Wipper In'}, \

    CBSting: Case {text: 'Hashtag Sting'}, \

    },\

    groupRender: Panel {text: "Add al Render tail", orientation: 'row', alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    renBtn: button {text: 'Add al Render tail'}, \

    },\

    groupVoraz: Panel {text: "www.estudiovoraz.com", of orientation: 'column', alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    myIconButton: IconButton {text: 'IconButton',},

    },\

    }";

    myPanel.grp = myPanel.add (res);

    Default values (Practicamete're nada mas para indicate en position default por goes a permanecer cada cosa).

    myPanel.grp.groupOne.ddPanel.selection = 0

    myPanel.grp.groupFour.ddArreglosAsterix.selection = 0

    myPanel.grp.groupThree.ddColorSystem.selection = 0

    myPanel.grp.groupThree.ddLineSelector.selection = 0

    myPanel.grp.groupChecker.ddPatterns.selection = 0

    myPanel.grp.groupVoraz.myIconButton.image = imagePath0

    myPanel.grp.groupTwo.imageDemo.image = imagePath1

    myPanel.layout.layout (true);

    Home default

    myPanel.grp.groupTwo.visible = true;

    myPanel.grp.groupThree.visible = false;

    myPanel.grp.BtnGroup.visible = false;

    myPanel.grp.groupFour.visible = false;

    myPanel.grp.groupRender.visible = false;

    myPanel.grp.groupChecker.visible = false;

    myPanel.grp.groupTwo.imageDemo.image = imagePath1

    AL HACER CLICK IN THE IMAGEN MANDA UNA ALERTED

    myPanel.grp.groupTwo.imageDemo.onClick = function)

    {

    Alert ("Primero debes seleccionar una opcion del Menu drop-down. ADVERTENCIA esto solo con works the paquetería of channel 5. \

    ("If need more information you can consultarlo con www.estudiovoraz.com");

    }

    From aqui to add todo el código than dedicate con sus variable mandas is a call desde tus variable y functions.

    Sub-panels: (Cuando mandas a con call variable in a number of a specific algo to you UI)

    var BtnURL = myPanel.grp.groupVoraz.myIconButton

    var BtnText = myPanel.grp.BtnGroup.editText

    var BtnCaritas = myPanel.grp.BtnGroup.editCaritas

    var BtnIconos = myPanel.grp.BtnGroup.editIconos

    var BtnImagen = myPanel.grp.BtnGroup.editImage

    var ddSelectPanel = myPanel.grp.groupOne.ddPanel

    var myPanel.grp.groupThree.ddColorSystem = ddColor

    var ddPatterns = myPanel.grp.groupChecker.ddPatterns

    var ddLineSelector = myPanel.grp.groupThree.ddLineSelector

    var ddOpciones = myPanel.grp.groupFour.ddArreglosAsterix

    var rendaBtn = myPanel.grp.groupRender.renBtn

    var myPanel.grp.groupChecker.CBfoto = CFoto

    var CWipper = myPanel.grp.groupChecker.CBWipper

    var CSting = myPanel.grp.groupChecker.CBSting

    var patInp = myPanel.grp.groupFour.patInp

    MANAGER PARA AS VEAN O SE ESCONDAN LAS THINGS LED PANEL

    ddSelectPanel.onChange = function()

    {

    Switch (ddSelectPanel.Selection.Text)

    {

    //PRIMER CASE                                                                                                                                            ---------  SALIDA NO IMAGE   ---------

    case "Salida No. Image":

    myPanel.grp.groupTwo.visible = true;

    myPanel.grp.groupTwo.imageDemo.image = imagePath2

    myPanel.grp.groupThree.visible = true;

    myPanel.grp.BtnGroup.visible = true;

    myPanel.grp.BtnGroup.editImage.visible = false;

    myPanel.grp.groupFour.visible = true;

    myPanel.grp.groupRender.visible = true;

    myPanel.grp.groupChecker.visible = true;

    myPanel.grp.BtnGroup.editCaritas.visible = true;

    myPanel.grp.BtnGroup.editIconos.visible = true;

    myPanel.grp.BtnGroup.editImage.visible = false;

    myPanel.grp.groupChecker.CBSting.visible = false;

    myPanel.grp.groupChecker.CBfoto.visible = false;

    CUANDO SE EN EL MENU SELECT DROPDOWN SALIDA NO. IMAGE O LO THAT MATCH, LO ABRE EN EL VIEWER

    projectItem ("_Render Salida No. Image") .openInViewer ();

    CUANDO SE HACE CLICK IN IMAGE TREE MODEL USED

    myPanel.grp.groupTwo.imageDemo.onClick = function)

    {

    projectItem ("_Render Salida No. Image") .openInViewer ();

    }

    ACCION BOX WIPPER

    CWipper.onClick = function)

    {

    if(CWipper.Value == true)

    {

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([1]);

    }

    if(CWipper.Value == False)

    {

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([0]);

    }

    }

    COLOR SYSTEM OF MENU DROP-DOWN

    ddColor.onChange = function)

    {

    Switch (ddColor.selection.text)

    {

    case "Amarillo":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([1]);

    break;

    case 'Morado ':

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([2]);

    break;

    case "LightBlue":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([3]);

    break;

    case study 'MidBlue ':

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([4]);

    break;

    case "blue":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([5]);

    break;

    case "Rojo":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([6]);

    break;

    by default:

    Alert ("error: perhaps no none option selected, brought Nuevo...");

    break;

    }

    }

    LINE SELECTOR DROPDOWN LIST

    ddLineSelector.onChange = function)

    {

    Switch (ddLineSelector.selection.text)

    {

    case "1-line":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([1]);

    break;

    case "1 line + Hashtag:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([2]);

    break;

    case "1 line + Info:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([3]);

    break;

    case "1 line + Info + Hashtag:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([4]);

    break;

    case "2 lines:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([6]);

    break;

    case "2 lines + Hashtag:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([7]);

    break;

    case "2 lines + Info:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([8]);

    break;

    case "2 lines + Info + Hashtag:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([9]);

    break;

    case "3 lines":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([11]);

    break;

    case '3 lines + Hashtag:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([12]);

    break;

    case '3 lines + Info:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([13]);

    break;

    case '3 lines + Info + Hashtag:

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([14]);

    break;

    by default:

    Alert ("error: perhaps not a stereo none option, select una opcion del Line Selector");

    break;

    }

    }

    LIST DROPDOWN CARITAS / ICONOS

    ddOpciones.onChange = function)

    {

    Switch (ddOpciones.selection.text)

    {

    case "OFF":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property (Caritas Asterix").setValue([0])";

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("Iconos Asterix").setValue([0]);

    break;

    case "Caritas Astérix":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property (Caritas Asterix").setValue([1])";

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("Iconos Asterix").setValue([0]);

    break;

    case "Iconos Astérix":

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property (Caritas Asterix").setValue([0])";

    projectItem("Salida_No_Image").layer ("_Control") .property ("Effects").property("Control_v2").property ("Iconos Asterix").setValue([1]);

    break;

    by default:

    Alert ("error: perhaps no none option selected, brought Nuevo...");

    break;

    }

    }

    EDIT TEXT BUTTON

    BtnText.onClick = function)

    {

    projectItem ("NIS _EditTxt") .openInViewer ();

    }

    CHANGE CARITAS BOTON

    BtnCaritas.onClick = function)

    {

    projectItem ("NIS _EditCaritas") .openInViewer ();

    }

    CHANGE THE BOTON ICONOS

    BtnIconos.onClick = function)

    {

    projectItem ("NIS _EditIconos") .openInViewer ();

    }

    MODELS OF MENU DROP-DOWN

    ddPatterns.onChange = function)

    {

    Switch (ddPatterns.selection.text)

    {

    case 'OFF models':

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([1]) of control. "

    break;

    case "acción":

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([3]) of control. "

    break;

    case "Comedia":

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([4]) of control. "

    break;

    case "deportees":

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([5]) of control. "

    break;

    case "Girly":

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([6]) of control. "

    break;

    case 'Geek ':

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([7]) of control. "

    break;

    case "Todo":

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([8]) of control. "

    break;

    case 'EXTRA ':

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([10]) of control. "

    break;

    case "ASTERIX":

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([12]) of control. "

    break;

    by default:

    Alert ("error: perhaps no none option selected, brought Nuevo...");

    break;

    }

    }

    ACCION BOX FOTO

    CFoto.onClick = function)

    {

    if(CFoto.Value == true)

    {

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Foto").setValue([1]) of control. "

    }

    if(CFoto.Value == False)

    {

    "projectItem("Salida_No_Image").layer ("_Control").property("Effects").property (v2").property("Foto").setValue([0]) of control. "

    }

    }

    ADD TO RENDER QUEUE

    rendaBtn.onClick = function)

    {

    var QTtemplate = "Lossless." Select el model

    salt1 var = projectItem ("_Render Salida No. Image"); Search the model that will has Renderizar por su number

    var newPath = ('Salida No. Image');  Este are el number del path knew the asigna para salida to

    If (salt1! = null & & salt1 instanceof CompItem) {}

    var theRender = app.project.renderQueue.items.add (salt1);

    If (salt1 == salt1) {}

    theRender.outputModules [1] .applyTemplate (QTtemplate);

    theRender.outputModules [1] mpfprojectdir\dev10\src\csharp\projectbase.file = new queue (newPath);

    }

    }

    }

    break;

    //SEGUNDO CASE                                                                                                                                    ---------  SALIDA NO ASTERIX   ---------

    case "Salida No. Asterix":

    myPanel.grp.groupTwo.visible = true;

    myPanel.grp.BtnGroup.editImage.visible = true;

    myPanel.grp.groupTwo.imageDemo.image = imagePath3

    myPanel.grp.groupThree.visible = true;

    myPanel.grp.BtnGroup.visible = true;

    myPanel.grp.groupFour.visible = true;

    myPanel.grp.groupRender.visible = true;

    myPanel.grp.groupChecker.visible = true;

    myPanel.grp.groupChecker.CBSting.visible = false;

    myPanel.grp.groupChecker.CBfoto.visible = false;

    myPanel.grp.groupFour.visible = false;

    myPanel.grp.BtnGroup.editCaritas.visible = false;

    myPanel.grp.BtnGroup.editIconos.visible = false;

    myPanel.grp.BtnGroup.editImage.visible = false;

    CUANDO SE EN EL MENU SELECT DROPDOWN SALIDA NO. IMAGE O LO THAT MATCH, LO ABRE EN EL VIEWER

    projectItem ("_Render Salida No. Asterix") .openInViewer ();

    CUANDO SE HACE CLICK IN IMAGE TREE MODEL USED

    myPanel.grp.groupTwo.imageDemo.onClick = function)

    {

    projectItem ("_Render Salida No. Asterix") .openInViewer ();

    }

    ACCION BOX WIPPER

    CWipper.onClick = function)

    {

    if(CWipper.Value == true)

    {

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([1]);

    }

    if(CWipper.Value == False)

    {

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([0]);

    }

    }

    COLOR SYSTEM OF MENU DROP-DOWN

    ddColor.onChange = function)

    {

    Switch (ddColor.selection.text)

    {

    case "Amarillo":

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([1]);

    break;

    case 'Morado ':

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([2]);

    break;

    case "LightBlue":

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([3]);

    break;

    case study 'MidBlue ':

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([4]);

    break;

    case "blue":

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([5]);

    break;

    case "Rojo":

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([6]);

    break;

    by default:

    Alert ("error: perhaps no none option selected, brought Nuevo...");

    break;

    }

    }

    LINE SELECTOR DROPDOWN LIST

    ddLineSelector.onChange = function)

    {

    Switch (ddLineSelector.selection.text)

    {

    case "1-line":

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([1]);

    break;

    case "1 line + Hashtag:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([2]);

    break;

    case "1 line + Info:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([3]);

    break;

    case "1 line + Info + Hashtag:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([4]);

    break;

    case "2 lines:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([6]);

    break;

    case "2 lines + Hashtag:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([7]);

    break;

    case "2 lines + Info:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([8]);

    break;

    case "2 lines + Info + Hashtag:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([9]);

    break;

    case "3 lines":

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([11]);

    break;

    case '3 lines + Hashtag:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([12]);

    break;

    case '3 lines + Info:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([13]);

    break;

    case '3 lines + Info + Hashtag:

    projectItem("Salida_No_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([14]);

    break;

    by default:

    Alert ("error: perhaps not a stereo none option, select una opcion del Line Selector");

    break;

    }

    }

    MODELS OF MENU DROP-DOWN

    ddPatterns.onChange = function)

    {

    Switch (ddPatterns.selection.text)

    {

    case 'OFF models':

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([1]) of control. "

    break;

    case "acción":

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([3]) of control. "

    break;

    case "Comedia":

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([4]) of control. "

    break;

    case "deportees":

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([5]) of control. "

    break;

    case "Girly":

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([6]) of control. "

    break;

    case 'Geek ':

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([7]) of control. "

    break;

    case "Todo":

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([8]) of control. "

    break;

    case 'EXTRA ':

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([10]) of control. "

    break;

    case "ASTERIX":

    "projectItem("Salida_No_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([12]) of control. "

    break;

    by default:

    Alert ("error: perhaps no none option selected, brought Nuevo...");

    break;

    }

    }

    EDIT TEXT BUTTON

    BtnText.onClick = function)

    {

    projectItem ("_EditTxt SNA") .openInViewer ();

    }

    ADD TO RENDER QUEUE

    rendaBtn.onClick = function)

    {

    var QTtemplate = "Lossless."   Select el model

    var SEL2 = projectItem ("_Render Salida Asterix No.");  Search the model that will has Renderizar por su number

    var newPath = ('Salida No. Asterix');  Este are el number del path knew the asigna para salida to

    If (sel2! = null & & sel2 instanceof CompItem) {}

    var theRender = app.project.renderQueue.items.add (sel2);

    If (sel2 == sel2) {}

    theRender.outputModules [1] .applyTemplate (QTtemplate);

    theRender.outputModules [1] mpfprojectdir\dev10\src\csharp\projectbase.file = new queue (newPath);

    }

    }

    }

    break;

    //TERCER CASE                                                                                                                                            ---------  SALIDA VENTANA ASTERIX ---------

    case "Salida Ventana Astérix":

    myPanel.grp.groupTwo.visible = true;

    myPanel.grp.groupTwo.imageDemo.image = imagePath5

    myPanel.grp.groupThree.visible = true;

    myPanel.grp.BtnGroup.visible = true;

    myPanel.grp.BtnGroup.editImage.visible = true;

    myPanel.grp.groupFour.visible = false;

    myPanel.grp.groupRender.visible = true;

    myPanel.grp.groupChecker.visible = true;

    myPanel.grp.BtnGroup.editCaritas.visible = false;

    myPanel.grp.BtnGroup.editIconos.visible = false;

    myPanel.grp.BtnGroup.editImage.visible = true;

    myPanel.grp.groupChecker.CBSting.visible = false;

    myPanel.grp.groupChecker.CBfoto.visible = true;

    CUANDO SE EN EL MENU SELECT DROPDOWN SALIDA NO. IMAGE O LO THAT MATCH, LO ABRE EN EL VIEWER

    projectItem ("_Render Salida Ventana Asterix") .openInViewer ();

    CUANDO SE HACE CLICK IN IMAGE TREE MODEL USED

    myPanel.grp.groupTwo.imageDemo.onClick = function)

    {

    projectItem ("_Render Salida Ventana Asterix") .openInViewer ();

    }

    ACCION BOX WIPPER

    CWipper.onClick = function)

    {

    if(CWipper.Value == true)

    {

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([1]);

    }

    if(CWipper.Value == False)

    {

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([0]);

    }

    }

    COLOR SYSTEM OF MENU DROP-DOWN

    ddColor.onChange = function)

    {

    Switch (ddColor.selection.text)

    {

    case "Amarillo":

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([1]);

    break;

    case 'Morado ':

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([2]);

    break;

    case "LightBlue":

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([3]);

    break;

    case study 'MidBlue ':

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([4]);

    break;

    case "blue":

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([5]);

    break;

    case "Rojo":

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("colour System").setValue([6]);

    break;

    by default:

    Alert ("error: perhaps no none option selected, brought Nuevo...");

    break;

    }

    }

    LINE SELECTOR DROPDOWN LIST

    ddLineSelector.onChange = function)

    {

    Switch (ddLineSelector.selection.text)

    {

    case "1-line":

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([1]);

    break;

    case "1 line + Hashtag:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([2]);

    break;

    case "1 line + Info:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([3]);

    break;

    case "1 line + Info + Hashtag:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([4]);

    break;

    case "2 lines:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([6]);

    break;

    case "2 lines + Hashtag:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([7]);

    break;

    case "2 lines + Info:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([8]);

    break;

    case "2 lines + Info + Hashtag:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([9]);

    break;

    case "3 lines":

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([11]);

    break;

    case '3 lines + Hashtag:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([12]);

    break;

    case '3 lines + Info:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([13]);

    break;

    case '3 lines + Info + Hashtag:

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("line Selector").setValue([14]);

    break;

    by default:

    Alert ("error: perhaps not a stereo none option, select una opcion del Line Selector");

    break;

    }

    }

    EDIT TEXT BUTTON

    BtnText.onClick = function)

    {

    projectItem ("SVA _EditTxt") .openInViewer ();

    }

    BtnImagen.onClick = function)

    {

    projectItem ("SVA _EditFootage") .openInViewer ();

    }

    MODELS OF MENU DROP-DOWN

    ddPatterns.onChange = function)

    {

    Switch (ddPatterns.selection.text)

    {

    case 'OFF models':

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([1]) of control. "

    break;

    case "acción":

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([3]) of control. "

    break;

    case "Comedia":

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([4]) of control. "

    break;

    case "deportees":

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([5]) of control. "

    break;

    case "Girly":

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([6]) of control. "

    break;

    case 'Geek ':

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([7]) of control. "

    break;

    case "Todo":

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([8]) of control. "

    break;

    case 'EXTRA ':

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([10]) of control. "

    break;

    case "ASTERIX":

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Patterns").setValue([12]) of control. "

    break;

    by default:

    Alert ("error: perhaps no none option selected, brought Nuevo...");

    break;

    }

    }

    ACCION BOX FOTO

    CFoto.onClick = function)

    {

    if(CFoto.Value == true)

    {

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Foto").setValue([1]) of control. "

    }

    if(CFoto.Value == False)

    {

    "projectItem("Salida_Ventana_Asterix").layer ("_Control").property("Effects").property (v2").property("Foto").setValue([0]) of control. "

    }

    }

    ACCION BOX FOTO

    CWipper.onClick = function)

    {

    if(CWipper.Value == true)

    {

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([1]);

    }

    if(CWipper.Value == False)

    {

    projectItem("Salida_Ventana_Asterix").layer ("_Control") .property ("Effects").property("Control_v2").property ("Wipper In").setValue([0]);

    }

    }

    ADD TO RENDER QUEUE

    rendaBtn.onClick = function)

    {

    var QTtemplate = "Lossless." Select el model

    salt1 var = projectItem ("_Render Salida Ventana Asterix"); Search the model that will has Renderizar por su number

    var newPath = ('Salida Ventana Asterix');  Este are el number del path knew the asigna para salida to

    If (salt1! = null & & salt1 instanceof CompItem) {}

    var theRender = app.project.renderQueue.items.add (salt1);

    If (salt1 == salt1) {}

    theRender.outputModules [1] .applyTemplate (QTtemplate);

    theRender.outputModules [1] mpfprojectdir\dev10\src\csharp\projectbase.file = new queue (newPath);

    }

    }

    }

    break;

    //DEFAULT CASE                                                                                                                                    ---------  DEFAULT CASE  APAGA TODO  ---------

    by default:

    myPanel.grp.groupTwo.visible = true;

    myPanel.grp.groupThree.visible = false;

    myPanel.grp.BtnGroup.visible = false;

    myPanel.grp.groupFour.visible = false;

    myPanel.grp.groupRender.visible = false;

    myPanel.grp.groupChecker.visible = false;

    myPanel.grp.groupTwo.imageDemo.image = imagePath1

    AL HACER CLICK IN THE IMAGEN MANDA UNA ALERTED

    myPanel.grp.groupTwo.imageDemo.onClick = function)

    {

    Alert ("Primero debes seleccionar una opcion del Menu drop-down. ADVERTENCIA esto solo con works the paquetería of channel 5. \

    ("If need more information you can consultarlo con www.estudiovoraz.com");

    }

    break;

    }

    }

    ACCIÓN PARA EL ESTUDIO VORAZ LINK

    BtnURL.onClick = LinkToURL;

    function LinkToURL()

    {

    alert ("http://www.estudiovoraz.com");

                var URL = " http://www.estudiovoraz.com "; your web page

    If ($.os.indexOf ("Windows")! = - 1).

    system.callSystem (winBrowserCmd + "" + URL);

    on the other

    system.callSystem (macBrowserCmdStart + URL + macBrowserCmdEnd);

    }

    FUNCION WHAT TODOS LOS OF THE INDEX OF THE ITEM PROJECT DETECTA Y IN ASIGNARLE LUGAR DEL LO DETECTA POR SU NUMBER NUMBER

    projectItem (name) function

    {

    var items = app.project.items;

    i = 1;

    While (I < = items.length) {}

    If (items [i] .name = name)

    {

    Return app.project.item (i);

    break;

    }

    i ++ ;

    }

    }

    END PANEL - NO PONER NADA ESTA LINEA ABAJO.

    Return myPanel;

    }

    var myScriptPal = myScript_buildUI (thisObj);

    If ((myScriptPal! = null) & & (myScriptPal instanceof window)) {}

    myScriptPal.center ();

    myScriptPal.show ();

    }

    }

    myScript (this);

    }

    OK, apparently it does work well with panels, because even if the height is 0, something is from the Panel...

    You can try the panels inside the packing groups. It will start to be a little heavy, but it works.

    Here's a toy example to illustrate:

    var w = new Window("palette", "test");
    w.content=w.add("group{orientation: 'column', margins: 0, spacing: 0,\
                                    alignment: ['fill', 'fill'], alignChildren: ['fill', 'top'],\
                                    gr1: Group{orientation: 'row', margins: [0,5,0,5], spacing: 10, alignChildren: ['fill', 'center'],\
                                                    titleST: StaticText{text: 'Option Level', alignment: ['left', 'center']},\
                                                    menu : DropDownList{properties: {items: ['0', '1', '2', '3']}},\
                                                    },\
                                    gr2: Group{orientation: 'row', margins: [0,5,0,5], alignChildren: ['fill', 'center'],\
                                                    content: Panel{orientation: 'row', margins: [5, 10, 5, 5], spacing: 0, alignChildren: ['fill', 'center'],\
                                                                        text : 'Option 1',\
                                                                        menu : DropDownList{properties: {items: ['A', 'B', 'C', 'D', 'E']}},\
                                                                        },\
                                                    },\
                                    gr3: Group{orientation: 'row', margins: [0,5,0,5], alignChildren: ['fill', 'center'],\
                                                    content: Panel{orientation: 'row', margins: [5, 10, 5, 5], spacing: 0, alignChildren: ['fill', 'center'],\
                                                                        text : 'Option 2',\
                                                                        menu : DropDownList{properties: {items: ['A', 'B', 'C', 'D', 'E']}},\
                                                                        },\
                                                    },\
                                    gr4: Group{orientation: 'row', margins: [0,5,0,5], alignChildren: ['fill', 'center'],\
                                                    content: Panel{orientation: 'row', margins: [5, 10, 5, 5], spacing: 0, alignChildren: ['fill', 'center'],\
                                                                        text : 'Option 3',\
                                                                        menu : DropDownList{properties: {items: ['A', 'B', 'C', 'D', 'E']}},\
                                                                        },\
                                                    },\
                                    gr5: Panel{orientation: 'row', margins: [5, 10, 5, 5], spacing: 10, alignChildren: ['fill', 'center'],\
                                                    text : 'Commands',\
                                                    btnA: Button{text: 'A'}, btnB: Button{text: 'B'}, btnC: Button{text: 'C'},\
                                                    },\
                                    }");
    w.content.gr1.menu.onChange = function(){
        // set visibility of options groups (gr2 to gr4)
        var x = this.selection.index + 1;
        var k;
        for (k=1; k<=3; k++){
            w.content.children[k].maximumSize.height = x>k ? 1000 : 0;
            };
        w.layout.layout(true);
        };
    //==============================
    w.content.gr1.menu.selection = 0;
    w.show();
    

    Xavier

  • How to change the Source with EditText text in my Script?

    Here is my code, actually, the thing is I want to change my myEditText text in my control panel:

    function myScript(thisObj) {
              function myScript_buildUI(thisObj) {
                        var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Panel Name", [0, 0, 300, 300]);
    
                        res="group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
                                  myEditText: EditText{text:'EditText text'},\
                                  myButton: Button{text:'Button Name'},\
                        }"
    
                        //Add resource string to panel
                        myPanel.grp = myPanel.add(res);
                        
                        
                        var texto = myPanel.grp.myEditText.text.value
                        
                        var btn =  myPanel.grp.myButton
                        
                        
                        
                        btn.onClick = function (){
                            
                            app.project.item(2113).layer("TXT 1").property("Text").property("Source Text").setValue = texto
                            
                            }
                        
                        
                        
                        
    
    
                        //Setup panel sizing and make panel resizable
                        myPanel.layout.layout(true);
                        myPanel.grp.minimumSize = myPanel.grp.size;
                        myPanel.layout.resize();
                        myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}
    
                        return myPanel;
              }
    
    
              var myScriptPal = myScript_buildUI(thisObj);
    
    
              if ((myScriptPal != null) && (myScriptPal instanceof Window)) {
                        myScriptPal.center();
                        myScriptPal.show();
                        }
              }
    
    
              myScript(this);
    

    Something like this should work:

    function myScript(thisObj) { 
    
      var textStr = "";
    
      function myScript_buildUI(thisObj) {
    
      var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Panel Name", [0, 0, 300, 300]);  
    
      res = "group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
      myEditText: EditText{text:'EditText text'},\
      myButton: Button{text:'Button Name'},\
      }"
    
      //Add resource string to panel
      myPanel.grp = myPanel.add(res);
    
      // I added the next two lines.
      textStr = myPanel.grp.myEditText.text;
      myPanel.grp.myEditText.onChange =  myPanel.grp.myEditText.onChanging = textStringUpd;
    
      myPanel.grp.myButton.onClick = function (){
    
      app.project.item(2113).layer("TXT 1").sourceText.setValue(textStr);
      //or tell the script to change the soureText property of the currently selected layer (remove the two slashes from the line below and add them to the line above)
      //app.project.activeItem.selectedLayers[0].sourceText.setValue(textStr);
    
      }
    
      //Setup panel sizing and make panel resizable
      myPanel.layout.layout(true);
      myPanel.grp.minimumSize = myPanel.grp.size;
      myPanel.layout.resize();
      myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}
    
      return myPanel;
    
      }  
    
      var myScriptPal = myScript_buildUI(thisObj);
    
      // I added this function.
      function textStringUpd() {
    
      textStr = this.text;
    
      }
    
      if ((myScriptPal != null) && (myScriptPal instanceof Window)) {
                myScriptPal.center();
      myScriptPal.show();
      }
      }  
    
    myScript(this);
    

    I've added comments to indicate the changes that I made

  • Collect the value of edittext box &amp; menu drop-down list to manipulate the project

    I built a simple GUI with a dropdown Panel and three boxes of edittext. I know not how to retrieve the values of each object to pass to the ASP (layers of text, project items). I'm still confussed on how to the onClick, onChange, onDeactivate, etc. methods work with functions... If I want to for example, to take the values in the boxes edittext to change values to text in a model layer, how could - I collect these values and pass them? In the sample code below it passes the default values for areas of edittext straight for layers of text in the model as soon as the GUI is launched...

    myGUI (this);

    function myGUI (thisObj) {}

    var myGUIPalette = myGUI_buildUI (thisObj);

    function myGUI_buildUI (thisObj) {}

    var myPanel = (thisObj instanceof Panel)? thisObj: new window ("palette", "user input panel', undefined, {resizable: true}");

    {//Build GUI

    res = "group {orientation:"column",-}".

    titleGroup: group {orientation: 'row', \}

    myStaticText: StaticText {text: 'Handset team word interludes'}, \

    },\

    textLineGroup: Panel {orientation: "column,"------}

    teamList:DropDownList {properties: {items: ['SORT CODES', '-', "ARI", "ATL", "BALL"]}}, \

    line01: EditText {}, \

    line02: EditText {}, \

    line03: EditText {}, \

    },\

    'ButtonGroup': group {orientation: 'row', \}

    clearButton: button {text: 'Clear'}, \

    renderButton: button {text: 'Making'}, \

    },\

    }";

    }

    myPanel.grp = myPanel.add (res);

    Default values

    var myPanel.grp.textLineGroup = textBox;

    textBox.teamList.selection = 0;

    textBox.line02.visible = false;

    textBox.line03.visible = false;

    var button = myPanel.grp.buttonGroup;

    var textBoxSize = (200, 20);

    var textBoxCharacters = 30;

    textBox.line01.size = textBoxSize;

    textBox.line01.characters = textBoxCharacters;

    textBox.line02.characters = textBoxCharacters;

    textBox.line03.characters = textBoxCharacters;

    Text box settings

    var defaultText01 = "enter the text of the line 01 ';

    var defaultText02 = "enter the text of the line 02."

    var defaultText03 = "enter line 03 Text."

    var myPanel.grp.textLineGroup = textBox;

    textBox.line01.text = defaultText01;

    textBox.line02.text = defaultText02;

    textBox.line03.text = defaultText03;

    textBox.line01.onActivate = function() {setTextBox (textBox.line01, defaultText01)};

    textBox.line02.onActivate = function() {setTextBox (textBox.line02, defaultText02)};

    textBox.line03.onActivate = function() {setTextBox (textBox.line03, defaultText03)};

    function setTextBox (activeTextBox, defaultText) {}

    if(activeTextBox.Text == DefaultText) {}

    activeTextBox.text = "";

    }

    activeTextBox.onDeactivate = function() {}

    If (activeTextBox.text == "") {}

    activeTextBox.text = defaultText;

    }

    ElseIf (activeTextBox == textBox.line01) {}

    textBox.line02.visible = true;

    }

    ElseIf (activeTextBox == textBox.line02) {}

    textBox.line03.visible = true;

    }

    };

    }

    var teamTri;

    textBox.teamList.onChange = function() {teamTri = textBox.teamList.selection};

    Settings button

    button.clearButton.onClick = function() {}

    textBox.line01.active = false;

    textBox.line02.active = false;

    textBox.line03.active = false;

    textBox.line02.visible = false;

    textBox.line03.visible = false;

    textBox.teamList.selection = 0;

    textBox.line01.text = defaultText01;

    textBox.line02.text = defaultText02;

    textBox.line03.text = defaultText03;

    }

    Manipulate the AE project

    ////////////////////////////////////

    ////////////////////////////////////

    #include "/ GFXM1/Script_Workflows/commonFunctions.jsx".

    var targetWidth;  Horizontal limit for altered text layers

    var modifiedLayers = new Array();

    numItems = app.project.items.length; collect the number of project items

    var teamLogosFolderMov = locateProjItems (FolderItem, "teamLogosMov");  Use CompItem to comps

    var teamLogosFolderRaster = locateProjItems (FolderItem, "teamLogosRaster");  Use CompItem to comps

    var teamLogosFolderVector = locateProjItems (FolderItem, "teamLogosVector");  Use CompItem to comps

    If (textBox.line03.text! = ' ': textBox.line03.text! = defaultText03) {}

    lineValue = textBox.line01.text + textBox.line02.text + "\r\n" + "\r\n", textBox.line03.text;

    }

    ElseIf (textBox.line02.text! = ' ': textBox.line02.text! = defaultText03) {}

    lineValue = textBox.line01.text + "\r\n" + textBox.line02.text;

    }

    else {lineValue = textBox.line01.text ;}

    for (c = 1; c < = numItems; c ++) {}

    model var = app.project.items [c];

    If (comp instanceof CompItem) {}

    for (i = 1; i < = comp.numLayers; i ++) {}

    {Switch (COMP. Layer (i). Name)}

    case 'textLines_GD ':

    targetWidth = 1720;

    setTextLayer_caseSensitive (comp.layer (i), lineValue);

    projectName = lineValue;

    If (scaleTextLayer (COMP. Layer (i), comp.layer (i).sourceRectAtTime(1,_true).width, targetWidth)) {}

    modifiedLayers.push (comp.layer (i));

    }

    break;

    case 'teamLogo_GD ':

    var numFolderItems = teamLogosFolderMov.numItems; Get the number of items in the folder teamLogos

    swapTeamLogo (numFolderItems, teamLogosFolderMov, teamTri, comp.layer (i));

    break;

    }

    }

    }

    }

    function swapTeamLogo (numFolderItems, teamLogosFolder, teamTri, layer) {}

    for (b = 1; b < = numFolderItems; b ++) {/ / loop in the teamLogos folder}

    If (teamLogosFolder.item (b) .name == teamTri) {/ / Check for game}

    layer.replaceSource (teamLogosFolder.item (b), true);  team swap in comp teamLogo logo

    }

    } //end check the teamLogos folder

    }

    ////////////////////////////////////

    ////////////////////////////////////

    Return myPanel;

    }

    If ((myGUIPalette! = null) & & (myGUIPalette instanceof window)) {}

    myGUIPalette.center ();

    myGUIPalette.show ();

    }

    }

    Hello, if your range variables are in the scope of your function (which is the case here) you need not pass them as arguments to your function.

    Then you can simply activate what wrote you in a function already and call on events, something like this:

    doIt() function

    {

    var

    targetWidth, numFolderItems, lineValue, ProjectName

    modifiedLayers = new Array(),

    numItems = app.project.items.length; collect the number of project items

    teamLogosFolderMov = locateProjItems (FolderItem, "teamLogosMov"), //Use CompItem for comps

    teamLogosFolderRaster = locateProjItems (FolderItem, "teamLogosRaster"), //Use CompItem for comps

    teamLogosFolderVector = locateProjItems (FolderItem, "teamLogosVector"), //Use CompItem for comps

    model,

    I, c;

    If (textBox.line03.text! = ' ': textBox.line03.text! = defaultText03) lineValue = textBox.line01.text + textBox.line02.text + "\r\n" + "\r\n", textBox.line03.text

    ElseIf (textBox.line02.text! = ' ': textBox.line02.text! = defaultText03) lineValue = textBox.line01.text + "\r\n" + textBox.line02.text

    else lineValue = textBox.line01.text;

    for (c = 1; c<= numitems;="" c++)="" if="" (="" (comp="app.project.item(c))" instanceof="">

    {

    for (i = 1; i<= comp.numlayers;="" i++)="">

    {

    case 'textLines_GD ':

    targetWidth = 1720;

    setTextLayer_caseSensitive (comp.layer (i), lineValue);

    projectName = lineValue;

    If (scaleTextLayer (COMP. Layer (i), comp.layer (i).sourceRectAtTime(1,_true).width, targetWidth)) modifiedLayers.push (comp.layer (i));

    break;

    case 'teamLogo_GD ':

    numFolderItems = teamLogosFolderMov.numItems; Get the number of items in the folder teamLogos

    swapTeamLogo (numFolderItems, teamLogosFolderMov, teamTri, comp.layer (i));

    break;

    default:;

    };

    };

    };

    myPanel.grp.buttonGroup.renderButton.onClick = needs;

    If instead you want to write a function that is independent from the UI variables, IE not dependent on variables of string, then you must pass these values as arguments:

    function must (text01 text02 text03, defaultText01, defaultText02, defaultText03)

    {

    same start

    get lineValue of arguments

    lineValue = text01; If (text02! = "" |) Text02! = defaultText02) {lineValue += "\r\n" + text02;}  If (text03! = "" |) Text03! = defaultText03) lineValue += "\r\n" + text03 ;} ;

    same end

    };

    myPanel.grp.buttonGroup.renderButton.onClick = function() {has (textBox.line01.text, textBox.line02.text, textBox.line03.text, defaultText01, defaultText02, defaultText03) ;};

    Note: I changed my computer var = app.project.items [c]; (does not work) to comp = app.project.item (c); and if (textBox.line02.text! = ' ' | textBox.line02.text! = defaultText03) (risky) if (textBox.line02.text! = ' ': textBox.line02.text! = defaultText03).

    Xavier.

  • Password entry

    I did this, but I don't know why my function is bad when the input text have the correct pass "hola" here is my code:

    //AQUÍ EMPIEZA A CREARSE LA VENTANA DEL PANEL
    
    
    {
        function myScript(thisObj){
            function myScript_buildUI(thisObj){
                var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","Panel Estudio Voraz",undefined,{resizable:true},{borderless:false});
                myPanel.layout.resize();
                
                res = "group{orientation:'column',margins: 0, spacing: 0,\
                                  grp3: Panel{type:'panel',text:'Patterns',orientation:'column',margins: [4,9,4,5], spacing: 1,\
                                                     alignChildren:['center','fill'],\
                                    textInput: EditText{text:'',minimumSize:[150,10],properties:{noecho:true}},\
                                },\
                         grp4: Panel{type:'panel',text:'Patterns',orientation:'column',margins: [4,9,4,5], spacing: 1,\
                                                     alignChildren:['center','fill'],\
                                    btn: Button{text:'Comprobar',minimumSize:[150,10],properties:{noecho:false}},\
                                },\
                         }";
                         
                         myPanel.grp = myPanel.add(res);
                         
    
     var pass = myPanel.grp.grp3.textInput.text
    
    
    myPanel.grp.grp4.btn.onClick = function (){
    
    
    if(pass == 'hola'){
         alert("TRUE");
        } 
    else(pass != 'hola'){
        alert("FALSE");
        }
    }
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         
                         //FUNCION QUE DETECTA TODOS LOS PROJECT ITEM Y EN LUGAR DE ASIGNARLE UN NÚMERO DEL INDEX LO DETECTA POR SU NOMBRE
    function projectItem(name)
    {
      var items = app.project.items;
      i = 1;
      while (i <= items.length) { 
      if (items[i].name == name) 
      {
      return app.project.item(i);
      break; 
      }
      i++;
      }
    }
    

    I don't think you need the "(pass! = 'hola')' after the 'else' on 33. Not only is incorrect JavaScript syntax, but your 'if' condition already explains cela. If you really want to keep, I would write line 33 as "ElseIf (pass!". = "hola")"

  • Drop Down List index - my script does not recognize the leader line in my function

    Community AE script-

    I'm a designer not a programmer naked with me.  I just try something simple, no baby and I cannot for the life of make me this simple script to work.

    I saw the script adds FAST and thought I would try to imitate this script for me as a challenge.  I watched videos of David Torno on Pro video Coalition and a simple example Script UI.  I searched for my answer on these here forums and tried to combine a simple script to examples within these forums and may not have to recognize clues to my drop-DOWN LIST down.  Here's my simple script:

    {

    function myScript (thisObj) {}

    function myScript_buildUI (thisObj) {}

    var myPanel = (thisObj instanceof Panel)? thisObj: new window ('palette', 'Add', undefined, {resizable: true});

    res = "group {orientation: 'row', alignment: ["fill","fill"] alignChildren: ["fill","fill"],------}»

    groupOne: group {orientation: 'row', alignment: ["fill", "fill"] alignChildren: ['fill', 'top'],------}

    myStaticText: StaticText {text:'New:'}, \

    myDropDownList: DropDownList {properties: {items: ['solid', 'Light']}}, \

    },\

    groupTwo: group {orientation: 'row', alignment: ["fill", "fill"] alignChildren: ['fill', 'top'],------}

    MyButton: button {text: 'Add'}, \

    },\

    }";

    myPanel.grp = myPanel.add (res);

    Default values

    myPanel.grp.groupOne.myDropDownList.selection = 0;

    myPanel.grp.groupTwo.myButton.onClick = myButtonClick;

    Design of Control Panel

    myPanel.layout.layout (true);

    myPanel.grp.minimumSize = myPanel.grp.size;

    Make the resizable Panel

    myPanel.layout.resize ();

    myPanel.onResizing = myPanel.onResize = function() {this.layout.resize ()};

    Return myPanel;

    }

    function myButtonClick() {}

    var app.project.activeItem = myComp;

    If (myComp! = null & & myComp instanceof CompItem) {}

    If (myPanel.grp.groupOne.myDropDownList.selection.index == 0) {}

    myComp.layers.addSolid ([0,0,0], "MySolid", myComp.width, myComp.height, 1)

    } Else if (myPanel.grp.groupOne.myDropDownList.selection.index == 2) {}

    myComp.layers.addLight ("Light", [myComp.width/2, myComp.height/2]);

    }

    }

    }

    Make a floating window

    var myScriptPal = myScript_buildUI (thisObj);

    If ((myScriptPal! = null) & & (myScriptPal instanceof window)) {}

    myScriptPal.center ();

    myScriptPal.show ();

    }

    }

    myScript (this);

    }

    If I comment out the lines

    If (myPanel.grp.groupOne.myDropDownList.selection.index == 0) { and If (myPanel.grp.groupOne.myDropDownList.selection.index == 1) { }}

    the script will add the SOLID and LIGHT.  But it will never work with these active lines - Add button does nothing.

    I could just make use of onChange with the drop-down list, but I want to understand how onClick actions of connection in the drop-down list.

    I copied this piece of the forum script and modified to work with my script, but nothing seems to work:

    buttonOne.onClick = onButtonOneClick;

    function onButtonOneClick() {}

    If (myPalette.dropdownlistOne.selection.index == 0) {}

    to do this

    } else {}

    This instead

    }

    }

    Can someone take a look at my script at the top of the page and tell me why this won't work?  I pretty much pulled out the last piece of hair I have on this - simple problem?

    Thank you in advance.

    Your click of button function does not know what "myPanel. You could do something like this inside the function:

    var this.parent.parent.parent = myPanel;

    There are other ways to do it, maybe as a global variable that maintains the reference of the Panel.

    In addition, your second if looking for selection.index == 2 instead of 1.

    Dan

  • Passing the value to the function clears the default value of the textBox before onClick

    I created a 'clearTextBox()' function so that when an edittext obj is clicked in the default text disappears. He works until I try to spend the 'default' text in the service, to which cases it erases the text without the onClick. See: "textBox.line01.onClick = clearTextBox (textBox.line01, defaultText01);"

    myGUI (this);

    function myGUI (thisObj) {}

    var myGUIPalette = myGUI_buildUI (thisObj);

    function myGUI_buildUI (thisObj) {}

    var myPanel = (thisObj instanceof Panel)? thisObj: new window ("palette", "user input panel', undefined, {resizable: true}");

    {//Build GUI

    res = "group {orientation:"column",-}".

    titleGroup: group {orientation: 'row', \}

    myStaticText: StaticText {text: 'Handset team word interludes'}, \

    },\

    textLineGroup: Panel {orientation: "column,"------}

    line01: EditText {text: 'Enter the text line 01'}, \

    line02: EditText {text: 'Enter line 02 Text'}, \

    line03: EditText {text: 'Enter line 03 Text'}, \

    },\

    'ButtonGroup': group {orientation: 'row', \}

    clearButton: button {text: 'Clear'}, \

    renderButton: button {text: 'Making'}, \

    },\

    }";

    }

    myPanel.grp = myPanel.add (res);

    Default values

    //TextBox settings

    var defaultText01 = "enter the text of the line 01 ';

    var defaultText02 = "enter the text of the line 02."

    var defaultText03 = "enter line 03 Text."

    var myPanel.grp.textLineGroup = textBox;

    textBox.line01.text = defaultText01;

    textBox.line01.onClick = clearTextBox (textBox.line01, defaultText01);

    function clearTextBox (activeTextBox, defaultText) {}

    if(activeTextBox.Text == DefaultText) {}

    activeTextBox.text = "";

    }

    }

    Return myPanel;

    }

    If ((myGUIPalette! = null) & & (myGUIPalette instanceof window)) {}

    myGUIPalette.center ();

    myGUIPalette.show ();

    }

    }

    Hi sbaden04.

    Your syntax does not work, since the textBox.line01.onClick = clearTextBox (textBox.line01, defaultText01); entitled to textBox.line01.onClick the result of the right side, which is not a function, but undefined. You can try this way:

    textBox.line01.onClick = function() {clearTextBox (textBox.line01, defaultText01) ;};}

    Or like this:

    textBox.line01.properties = {defaultText: defaultText01};

    textBox.line01.text = defaultText01;

    textBox.line01.onClick = plain text;

    function clearText() {if (this.text = this.properties.defaultText) this.text ="" ;};}

    Xavier.

  • To update the window onChange?

    Hey guys,.

    How can I update my window with the onChange event? My solution works, but I need groups to collapse when it is not visible.

    w.DD.onChange = function() {

         switch (this.selection.text){

              case 'Headline':

                   if(w.visiblegroup)

                   w.visiblegroup.visible = false;

                   w.visiblegroup = w.texted;

                   w.texted.visible = true;

              break;

         }

    }

    I tried to use w.show , w.update (with documentation, still not sure what put only) after adding items in the case itself. But I can't understand this.

    w.DD.onChange = function() {

         switch (this.selection.text){

              case 'Headline':

                   w.add('checkbox', undefined, 'User-Color');

                   //w.show();

                   w.update();

              break;

         }

    }

    Does anyone have an idea of how this might work?

    Thanks in advance!

    Hi Pickory, Stamn

    In fact there is no such think really see as w.layout.layout (true) Marc http://indiscripts.com/blog/public/LayoutManager-Draft.pdf and Re: Documentation of ScriptUI window.update ()?.

    It is w.layout.layout (0), w.layout.layout (1) or w.layout.layout (2)

    w.Layout.Layout (true) would be assessed to save it as w.layout.layout (1) in Stamn case he would probably want to got for w.layout.layout (2)

    This small example illustrates the difference between (1) and (2).

    Concerning

    Trevor

  • ListItem.selected reports false values in DropDownList.onChange

    There is a bug in PS CS5 or later (still present in the CC, not in CS2) with the ListItem.selected property. It is not set correctly when you access in its list drop-down list's onChange event. However, ListItem.selection work.

    Copy the following code shows a panel empty (as it shouldn't):

    var dialog = new Window("dialog", "ListItem.selected bug");
    dialog.orientation = "column";
    
    dialog.ddl = dialog.add("dropdownlist", undefined, ["A", "B", "C"]);
    dialog.ddl.preferredSize = [40, 20];
    dialog.panel = dialog.add("panel", undefined, "Options:");
    dialog.panel.preferredSize = [200, 100];
    dialog.panel.orientation = "stack";
    
    var options = new Array();
    var texts = ["This is A", "This is B", "This is C"];
    for (var i = 0; i < dialog.ddl.items.length; ++i) {
         var itemOpts = dialog.panel.add("statictext", undefined, texts[i]);
         options.push(itemOpts);
    }
    
    dialog.ddl.onChange = function() {
         for (var i = 0; i < options.length; ++i) {
              if (this.items[i].selected) {
                   options[i].show();
              }
              else {
                   options[i].hide();
              }
         }
    };
    
    dialog.ddl.selection = 0;
    
    dialog.center();
    dialog.show();
     

    I reported this to official channels. It would be nice if you saved it:

    JS script: ListItem.selected bug in onChange

    A workaround is using the DropDownList.selection property:

    dialog.ddl.onChange = function() {
         for (var i = 0; i < options.length; ++i) {
              options[i].hide();
         }
         options[this.selection.index].show();
    };
    
  • onChange dropdownlist changes?

    I use a drop-down list to make a selection and inspired while I would like the second list drop-down list to change the selection based on the election.

    myStandardDown.onChange = function () {if (myStandardDown.selection == 1) {myTypeDown = ('dropdownlist', undefined, lithoNames) ;}}}}

    I tried something like that and,.

    this:

    If (myStandardDown.selection == 0) {myTypeDown = myInputGroup.add ('dropdownlist', undefined, execNames) ;}}

    or

    myStandardDown.onChange = function () {if (myStandardDown.selection == 1) {myTypeDown.graphics = ('dropdownlist', undefined, lithoNames) ;}}}}

    I do not know. The end result, I'm having a lot of things change based on this, therefore, is the heart of it.

    I can get a text edit box to edit, but that's all.

    I have three bottom of different fall he needs to change.

    If you can point me in the right direction, it would be appreciated.

    So I think that I figured it although if you have a better way to straighten it out feel free to post, but it works.

    myStandardDown.onChange = function () {if (myStandardDown.selection == 1) {while (myTypeDown.items.length > 0) {myTypeDown.remove (myTypeDown.items [0]) ;}}}}

    for (var i = 0; i)

    Else if (myStandardDown.selection == 2) {while (myTypeDown.items.length > 0) {myTypeDown.remove (myTypeDown.items [0]) ;}}}

    for (var i = 0; i)

    else {while (myTypeDown.items.length > 0) {myTypeDown.remove (myTypeDown.items [0]) ;}}}

    for (var i = 0; i)

    essentially on evolution, it removes the list in the drop down in a while loop then adds a list of back with a loop according to the selection made on the changes.

  • How to pass values from one function to the other

    Hello

    I am a school teacher and a beginner in Flash Actionscript. I am creating a countdown for use in my classroom during testing. The beginning and break according to need, but not the pause button functions. When I click on the pause button, the timer is reset to 0:00:00. Help, please. Here is the code that I had written so far:

    var Subject1timeLeftHr;

    var Subject1timeLeftMin;

    var Subject1timeLeftSec;

    Subject1start_btn._visible = true;

    Subject1pause_btn._visible = false;

    Subject1rotor_mc.gotoAndStop (1);

    Subject1rotor_mc._visible = false;

    Subject1durationHr_txt. Text = "0";

    Subject1durationMin_txt. Text = "00";

    Subject1durationSec_txt. Text = "00";

    Selection.setFocus (Subject1durationHr_txt);

    function SubjectdurationHr (SubjectxdurationHr_txt, SubjectxdurationMin_txt)

    {

    if (SubjectxdurationHr_txt.length == 1)

    {

    Selection.setFocus (SubjectxdurationMin_txt);

    }

    }

    function SubjectdurationMin (SubjectxdurationMin_txt, SubjectxdurationSec_txt)

    {

    if (SubjectxdurationMin_txt.length == 2)

    {

    Selection.setFocus (SubjectxdurationSec_txt);

    }

    }

    function SubjectdurationSec (SubjectxdurationSec_txt, SubjectxdurationHr_txt)

    {

    if (SubjectxdurationSec_txt.length == 2)

    {

    Selection.setFocus (SubjectxdurationHr_txt);

    }

    }

    Subject1durationHr_txt. OnChanged = function()

    {

    SubjectdurationHr (Subject1durationHr_txt, Subject1durationMin_txt);

    };

    Subject1durationMin_txt. OnChanged = function()

    {

    SubjectdurationMin (Subject1durationMin_txt, Subject1durationSec_txt);

    };

    Subject1durationSec_txt. OnChanged = function()

    {

    SubjectdurationSec (Subject1durationSec_txt, Subject1durationHr_txt);

    };

    function startcountdown (SubjectxdurationLeft, SubjectxdurationHr, SubjectxdurationHr_txt, SubjectxdurationMin, SubjectxdurationMin_txt, SubjectxdurationSec, SubjectxdurationSec_txt, Subjectxduration, SubjectxstartTime, SubjectxendTime, Subjectxtimer_mc, Subjectxpause_btn, Subjectxstart_btn, Subjectxrotor_mc, SubjectxtimeLeft, SubjectxtimeLeftHr, SubjectxtimeLeftMin, SubjectxtimeLeftSec, SubjectxtimeLeftHr_txt, SubjectxtimeLeftMin_txt, SubjectxtimeLeftSec_txt)

    {

    delete SubjectxdurationLeft;

    delete SubjectxdurationHr;

    delete SubjectxdurationMin;

    delete SubjectxdurationSec;

    delete Subjectxduration;

    delete SubjectxdurationHr_txt.text;

    delete SubjectxdurationMin_txt.text;

    delete SubjectxdurationSec_txt.text;

    SubjectxstartTime = getTimer();

    Subjectxtimer_mc.onEnterFrame = function()

    {

    if (SubjectxdurationHr_txt.text == Nan |) SubjectxdurationMin_txt.text == Nan | SubjectxdurationSec_txt.text is Nan)

    {

    }

    else

    {

    SubjectxdurationHr = 60 * 60 * 1000 * Number (SubjectxdurationHr_txt.text).

    SubjectxdurationMin = 60 * 1000 * Number (SubjectxdurationMin_txt.text).

    SubjectxdurationSec = 1000 * Number (SubjectxdurationSec_txt.text).

    Subjectxduration = SubjectxdurationHr + SubjectxdurationMin + SubjectxdurationSec;

    SubjectxendTime = SubjectxstartTime + Subjectxduration;

    SubjectxdurationLeft = SubjectxendTime - getTimer();

    if (SubjectxdurationLeft > 0)

    {

    SubjectxdurationHr_txt._visible = false;

    SubjectxdurationMin_txt._visible = false;

    SubjectxdurationSec_txt._visible = false;

    Subjectxpause_btn._visible = true;

    Subjectxstart_btn._visible = false;

    Subjectxrotor_mc._visible = true;

    Subjectxrotor_mc.play ();

    SubjectxtimeLeft = SubjectxdurationLeft / (1000 * 60 * 60);

    SubjectxtimeLeftHr = Math.floor (SubjectxtimeLeft);

    SubjectxtimeLeftMin = Math.floor ((SubjectxtimeLeft-SubjectxtimeLeftHr) * 60);

    SubjectxtimeLeftSec = Math.floor (((SubjectxtimeLeft-SubjectxtimeLeftHr) * 60 - SubjectxtimeLeftMin) * 60);

    SubjectxtimeLeftHr_txt.text = String (SubjectxtimeLeftHr);

    if (SubjectxtimeLeftHr_txt.length < 1)

    {

    SubjectxtimeLeftHr_txt.text = '0' + SubjectxtimeLeftHr_txt.text;

    }

    SubjectxtimeLeftMin_txt.text = String (SubjectxtimeLeftMin);

    if (SubjectxtimeLeftMin_txt.length < 2)

    {

    SubjectxtimeLeftMin_txt.text = '0' + SubjectxtimeLeftMin_txt.text;

    }

    SubjectxtimeLeftSec_txt.text = String (SubjectxtimeLeftSec);

    if (SubjectxtimeLeftSec_txt.length < 2)

    {

    SubjectxtimeLeftSec_txt.text = '0' + SubjectxtimeLeftSec_txt.text;

    }

    }

    else

    {

    delete Subjectxtimer_mc.onEnterFrame;

    SubjectxtimeLeftHr_txt.text = "";

    SubjectxtimeLeftMin_txt.text = "";

    SubjectxtimeLeftSec_txt.text = "";

    SubjectxdurationHr_txt._visible = true;

    SubjectxdurationMin_txt._visible = true;

    SubjectxdurationSec_txt._visible = true;

    Subjectxrotor_mc.gotoAndStop (1);

    Subjectxrotor_mc._visible = false;

    SubjectxdurationHr_txt.text = '0 '.

    SubjectxdurationMin_txt.text = "00";

    SubjectxdurationSec_txt.text = "00";

    Subjectxpause_btn._visible = false;

    Subjectxstart_btn._visible = true;

    Selection.setFocus (SubjectxdurationHr_txt);

    }

    }

    };

    }

    function pausecountdown (SubjectxdurationHr_txt, SubjectxtimeLeftHr, SubjectxdurationMin_txt, SubjectxtimeLeftMin, SubjectxdurationSec_txt, SubjectxtimeLeftSec, Subjectxstart_btn, Subjectxpause_btn, Subjectxrotor_mc)

    {

    delete Subjectxtimer_mc.onEnterFrame;

    SubjectxdurationHr_txt.text = String (SubjectxtimeLeftHr);

    SubjectxdurationMin_txt.text = String (SubjectxtimeLeftMin);

    SubjectxdurationSec_txt.text = String (SubjectxtimeLeftSec);

    Subjectxstart_btn._visible = true;

    Subjectxpause_btn._visible = false;

    Subjectxrotor_mc.stop ();

    }

    Subject1pause_btn.onRelease = function()

    {

    pausecountdown (Subject1durationHr_txt, Subject1timeLeftHr, Subject1durationMin_txt, Subject1t, imeLeftMin, Subject1durationSec_txt, Subject1timeLeftSec, Subject1start_btn, Subject1pause_btn, Subject1rotor_mc);

    };

    Subject1start_btn.onRelease = function()

    {

    startcountdown (Subject1durationLeft, Subject1durationHr, Subject1durationHr_txt, Subject1dura, tionMin, Subject1durationMin_txt, Subject1durationSec, Subject1durationSec_txt, Subject1durati, Subject1startTime, Subject1endTime, Subject1timer_mc, Subject1pause_btn, Subject1start_btn, Subject1rotor_mc, Subject1timeLeft, Subject1timeLeftHr, Subject1timeLeftMin, Subject1timeLeftS ec, Subject1timeLeftHr_txt, Subject1timeLeftMin_txt, Subject1timeLeftSec_txt);

    };

    Subject1cancel_btn.onRelease = function()

    {

    Subject1timeLeftHr_txt.text = "";

    Subject1timeLeftMin_txt.text = "";

    Subject1timeLeftSec_txt.text = "";

    Subject1durationHr_txt._visible = true;

    Subject1durationMin_txt._visible = true;

    Subject1durationSec_txt._visible = true;

    Subject1durationHr_txt.text = '0 '.

    Subject1durationMin_txt.text = "00";

    Subject1durationSec_txt.text = "00";

    Subject1timeLeftHr_txt._visible = true;

    Subject1timeLeftMin_txt._visible = true;

    Subject1timeLeftSec_txt._visible = true;

    Subject1pause_btn._visible = false;

    Subject1start_btn._visible = true;

    Subject1rotor_mc._visible = false;

    Subject1rotor_mc.gotoAndStop (1);

    delete Subject1timer_mc.onEnterFrame;

    delete Subject1durationLeft;

    delete Subject1duration;

    delete Subject1durationHr_txt.text;

    delete Subject1durationMin_txt.text;

    delete Subject1durationSec_txt.text;

    };

    I think you need to spend time by reducing your code at a practical level.  You seem to be any passage in the book in each function and I think that probably none of this is necessary.  If you have declared these variables at the beginning, then you don't need to transfer them to any function, because they are gobally available to one of the functions/code that follows.  Similarly, if you have some textfields on stage, it is pointless to pass those in all functions for the same reason.

    I see you doing the overuse of 'delete' (and possibly errant use as well).  Is probably the only thing you might want or need to use...

    delete Subjectxtimer_mc.onEnterFrame;

    Which stops the enterframe trigger activity, which I think is used to update the textfields which indicate the time.

    And that conditional uses == Nan is not likely to do anything except wonder what is a Nan.  TextFields hold the strings, which are cited.  SO unless you have a variable named Nan somewhere that has a value of string assigned to her, this condition will do nothing for you.  You probably don't need it at all if you get this working properly.

Maybe you are looking for