tables N loops

var fontzA:Array is ["BauhausMedium", "Haettenschweiler", 'Machine BT'];.

var fontN:Array = [ft_01, ft_02, ft_03];

for (i = 1; i < 7; i ++) {}

for (k = 0; k < fontzA.length; k ++) {}

fontN [k] .kvar = k;

var dyofnt_fmt:TextFormat = new TextFormat();

_root ["Contents.txtool_mc.fontypeT_mc" + i] .fontN [k] .onRelease = function() {}

/ / trace (dyofnt_fmt.font);

dyofnt_fmt.font = fontzA [this.kvar];

_root ["gmbb_mc.my_Dyn_Txt" + i] .setTextFormat (dyofnt_fmt);

_root ["gmbb_mc.my_Dyn_Txt" + i] .embedFonts = true;

_root ["gmbb_mc.my_Dyn_Txt" + i] .setNewTextFormat (dyofnt_fmt);

_root ["Contents.txtool_mc.fontypeT_mc" + i] .fontN [k] a._visible = false;

_root ["contents.txtool_mc.fontypeT_mc" + i] .fontN [this.kvar] ._visible = true;

}

}

};

I'm stuck here. I want that the police "BauhausMedium" to apply when we click on the ft_01 type of police "Haettenschweiler" to apply when it is clicked on ft_02, etc...

"at the same time I want all the ' ft_01a", "ft_02a", "ft_03a' movieclips to hide with the exception of the similar to the clicked button movieclip." "" "" For example if "ft_02" has been activated ft_02one to be visible = true and remains to be visible = false (a,aft_03 ft_01).

var fontzA:Array is ["BauhausMedium", "Haettenschweiler", 'Machine BT'];. font names

var fontN:Array = [ft_1, ft_2, ft_3]; button names

var dyofnt_fmt:TextFormat = new TextFormat();

_root.gm_mc.my_Dyn_Txt6.embedFonts = true;

for (i = 1; i<>

fontN [i] .ivar = i;

fontN [i] .onRelease = function() {}

dyofnt_fmt.font = fontzA [this.ivar];

_root.gm_mc.my_Dyn_Txt6.setTextFormat (dyofnt_fmt);

_root.gm_mc.my_Dyn_Txt6.setNewTextFormat (dyofnt_fmt);

I don't know what these last two lines are supposed to do, it is not clear, they do

_root.contents.txtool_mc.fontypeT_mc6 ["fta_" + This.Ivar] ._visible = false;

_root.contents.txtool_mc.fontypeT_mc6.fontN [This.Ivar] ._visible = true;

}

};

Tags: Adobe Animate

Similar Questions

  • Filling N-dimensional table without loop for

    Hello

    I would like to create a table to N dimensions without the use of loops, one in other than n times because I would like to have the number of variable dimensions, so I don't want to change the code by adding or removing loops whenever I change the number of dimensions. I would like to start Let's say with 7 dimensions 10x10x10x10x10x15x20.

    Thank you

    Zied


  • clear the table of loop for

    Hello world

    I have a question about the erasure of history to the table. It sounds simple, but I'm really confused...

    As the example attached below, I've built a table within a while loop and a loop. After totally run the program once, when I run it a second time, it seems that the table has a memory of the last time, that is the size of table does not start from 0, and appears the old number from last time, even through its initialization of the for loop.

    How can I make it go empty each time when I restart the table?

    Need your help. Thank you very much. : )

    You must also have a shift in the loop FOR. This will keep the data for the duration of the program, but it clear at the beginning of the next run.

  • Two questions in table "While loop"

    Hello

    I have two questions about creating tables in while loops. I'm using LabView 8.5.1.

    In its simplest form, my current while loop (delay set to 0, 2 s) has 3 variables that have been changed by moving a slider. They are each sent to a line in a block of 'Building the table' (data type is DBL 1 d) - this table is then written to a spreadsheet file, such as the three values are written to a new line (one value per column) whenever the while loop runs.

    Question 1

    How can I add a column 'Time' in this worksheet? In other words, get at the present time the loop works since then, from 0 seconds in the spreadsheet, via the table block building.

    I can think of how to do this with a loop For, but given that the While loop runs through an unknown number of iterations, I can't figure out how to get the counter to work.

    Question 2

    How can I text column headings on the worksheet?

    Thanks for the help and if you need anything anyone stating, please let me know

    To answer question 1:

    There is a function of 'Elapsed Time' you can put as the first colum of the data.

    This then reformatted your spreadsheet as
    Time Data1 Data2 Data3

    Time Data1 Data2 Data3

    Time Data1 Data2 Data3

    etc...

    To answer question 2:

    Build a table of positions, then write this table in the file only once, outside the loop.

    Your table with the data and time will write inside the loop.

  • Table of loop one

    Hi all

    How can I change this VI to have the output array update with each iteration of the loop rather than wait the program exit the loop and then update all?

    Thank you

    You must use a shift register to table and table to build inside the loop.  Move the terminal indicator inside the loop.

  • Using subset of table with loops

    I have a 2D (m * n) table and I want to look at a subset of this table (x * y). I am having some problems using the subset of the table by doing this. If I want to browse 'y' columns of items containers 'x', I thought I could use a loop with the function of the subset of the array for interior but the resulting table I receive is actually a populated by the diagonal elements of my natal chart. I enclose my current VI where I hope that things.

    For example, if I load an image that is 800px * 600px then my program creates an array of 800 * 600 and each element is the maximum of the value of red, green and blue pixel. So, I want to watch the first 320px * 600px (which is a subset of the array with size 320 * 600). So, how can I use subset table properly to generate that 2d hack? My goal after this step would be to perfom some basic mathematical calculations like averaging on the subset.

    This is what you want?

  • Table attached loop

    This seems to be a simple problem, but I shouldn't be watching correctly.  I read in a stream of bytes from a file and plot the data in a chart of waveform. The files are very large, so I'm reading in a part of the data, passing by a vi that converts it a 2D array and store them in a table. This is done with a loop until the entire file has bene read. The data is then plotted.  My problem is when the loop completes all the iterations, the only data are the latest iteration.  I tried to use registers to lag and feedback nodes to carry data from one iteration to iteration, and I tried passing the data outside of the table with a tunnel of automatic indexation. Each method creates a 3D Board. I understand that if I have the index a table 2d of course, I'll get a 3d board.  Instead of indexing, I want to add the data of each iteration.  Sounds simple enough, but I don't have a chance.  Here are some of my vi.  Can anyone help?

    You will not be able to do so unless the feedback node is initialized with a 2D array. There a table 2D-wire to the terminal of the initializer of the Feedback node.

    Having said that, based on your previous thread, I would like to see what you do in this small Subvi you have there.

  • Delete the text of the table via loop field for

    Hello

    I have a problem to delete text added via loop fields for.

    What im do is, via loop GI dynamically create menu with 10 buttons.

    Each button contain, created dynamically, background (shape) and the text field.

    And all is well.

    But when im trying to delete text fields, then I got this error:

    -I'm using the button to remove text fields - lang_btn.addEventListener (MouseEvent.CLICK, clickHandler);

    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
              at flash.display::DisplayObjectContainer/removeChild()
              at Loading_Img_fla::MainTimeline/xmlLoaded()
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/onComplete()
    
    

    In the script below marked in red is what should remove the fields of text in a table, instead me gives error.

    Here's my script

    // Create for loop
    for (var i:int = 0; i < 10; i++)
    {
              for each (xml in listItems)
              {
                        if (i == xml.attribute("Id"))
                        {
                                  // Add MovieClip to stage to hold the data
                                  addChild(lmHolder);
                                  lmHolder.x = 0;
                                  lmHolder.y = 0;
      
                                  // Create new MovieClip to hold buttons
                                  lmButtonsMCArray[i] = new MovieClip();
                                  lmButtonsMCArray[i].buttonMode = true;
                                  lmButtonsMCArray[i].mouseChildren = false;
                                  lmButtonsMCArray[i].x = 20;
                                  lmButtonsMCArray[i].y = 20 + btCount * buttonSpace;
    
    
                                  // Add each button MovieClip to lmHolder MovieClip
                                  lmHolder.addChild(lmButtonsMCArray[i]);
    
    
                                  // Create Background to buttons
                                  lmButtonsArray[i] = new Shape();
                                  lmButtonsArray[i].graphics.beginFill(lmBgColor0, 1);
                                  lmButtonsArray[i].graphics.drawRect(0, 0, 230, 85);
                                  lmButtonsArray[i].x = 0;
                                  lmButtonsArray[i].y = 0;
    
    
                                  // <<-- Add Background shape to the buttons MovieClips 
                                  lmButtonsMCArray[i].addChild(lmButtonsArray[i]);
    
    
                                  // Create a new array to preserve data from XML List
                                  lmNameArrayEG = new Array();
                                  lmNameArrayUS = new Array();
    
    
                                  // Create local variable to hold
                                  var lmTxtFieldContentUS:String;
                                  var lmTxtFieldContentEG:String;
                                  var lmTxtContent:String;
      
                                  // If clicked button is EG then make array with Arabic text
                                  // If clicked button is US then make array with English text
                                  if (footer.lang_btn.langState == "EG")
                                  {
                                            for each (var leftMenuName:XML in egLanguageList)
                                            {
                                                      lmNameArrayEG.push(leftMenuName);
                                            }
                                            lmTxtFieldContentEG = lmNameArrayEG[i];
                                            lmTxtContent = lmTxtFieldContentEG;
                                  }
                                  else
                                  {
                                            for each (var leftMenuNameUS:XML in usLanguageList)
                                            {
                                                      lmNameArrayUS.push(leftMenuNameUS);
                                            }
                                            lmTxtFieldContentUS = lmNameArrayUS[i];
                                            lmTxtContent = lmTxtFieldContentUS;
                                  }
                                  // Setup new text field each time script is executed
                                  lmTxtFieldsArray[i] = new TextField();
                                  lmTxtFieldsArray[i].width = 110;
                                  lmTxtFieldsArray[i].border = false;
                                  lmTxtFieldsArray[i].wordWrap = true;
                                  lmTxtFieldsArray[i].multiline = true;
                                  lmTxtFieldsArray[i].selectable = false;
                                  lmTxtFieldsArray[i].embedFonts = true;
                                  lmTxtFieldsArray[i].antiAliasType = AntiAliasType.ADVANCED;
                                  lmTxtFieldsArray[i].autoSize = TextFieldAutoSize.CENTER;
                                  lmTxtFieldsArray[i].text = lmTxtContent.toUpperCase();
                                  lmTxtFieldsArray[i].x = 10;
                                  lmTxtFieldsArray[i].name = "lmTxtFieldName" + i;
    
    
                                  // <<-- Add Text fields to the Movie Clip
                                  lmButtonsMCArray[i].addChild(lmTxtFieldsArray[i]);
    
    
                                  // If clicked button is EG then set Arabic text format, and make array with Arabic text fields
                                  // If clicked button is US then set English text format, and make array with Egnlish text fields
                                  if (footer.lang_btn.langState == "EG")
                                  {
                                            lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_eg);
                                            // Make array from text fields;
                                            pushEgTFintoArray.push(lmTxtFieldsArray[i]);
                                  }
                                  else
                                  {
                                            lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_us);
                                            // Make array from text fields;
                                            pushUsTFintoArray.push(lmTxtFieldsArray[i]);
                                  }
      
                                  // If clicked button is EG then loop thrue the for loop and remove English text fields from array
                                  // If clicked button is EG then loop thrue the for loop and remove Arabic text fields from array
                                  if (footer.lang_btn.langState == "EG")
                                  {
                                            for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
                                            {
                                                      //remove the text field array from the display
                                       removeChild(pushUsTFintoArray[rNr_us]);
                                            }
                                            //clear the array
                                            pushUsTFintoArray = [];
                                  }
                                  else
                                  {
                                            for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
                                            {
                                                      //remove the text field array from the display
                                       removeChild(pushEgTFintoArray[rNr_eg]);
                                            }
                                            //clear the array
                                            pushEgTFintoArray = [];
                                  }
                        }
              }
    
    
              btCount++;
    }
    
    

    If you don't know what you're doing, you can always use:

    {If (pushUsTFintoArray [rNr_us] & {pushUsTFintoArray [rNr_us] .stage)}

    pushUsTFintoArray [rNr_us].parent.removeChild (pushUsTFintoArray [rNr_us]);

    }

  • Table - ForEach loop - print

    I have the following code to test table for each loop. First loop prints the elements in the "correct" order Why the 2nd loop print NOT in the right order
    public class ArrayForEachLoopExample {
         public static void main(String[] args){
              int[] intArray = {1,2,3,4,5,6,7,8,9,0};
              for(int i = 0; i< intArray.length; i++){
                   System.out.println("Printing  "+ i + "th element : "+ intArray);
              }
              System.out.println();
              for(int j : intArray){
                   System.out.println(j + "th element is " + intArray[j]);
              }
         }
    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    has njguy writes:
    The program should have been written as follows

                   System.out.println(j + "th element is " + j);
    

    It is always false. You do not have an index in the second loop (and it's pretty much the idea) unless you create one artificially. But in this case, you can simply use a loop for ordinary.

  • Transmission of data in a table with loop and case

    Hi all, I'm Felix and new to labview.

    I am currently on a certain data editing project. I have some data (Spectra taken in different times) in a .lvm file which needs a Gaussian fit and I would like to have the characteristics of adjustment to a 2D array, so I can trace the amplitude, time vs Center and width.

    My problem is that my final picture is a 2d one and made it gives me 1 d.

    Can you please help me to solve this problem.

    Thank you

    Felix

    Hi felixd,

    According to my understanding, your problem is in the construction of the matrix. Instead of spending items in the funcion with a 2D table array construction, you can initially built a 1 d array elements and then include her in a 2D array using another feature of table construction. Check the attached vi.

    Concerning

    Amine31

    (Give congratulations to good answers and Mark as a Solution If your problem is resolved)

  • With tables nested loops

    It's my current and outer cfloop. How many nested cfloops do I need to go on field data.current_version.en.text ? My guess is two loops, but I'm not sure about specifying the value for the 'to' in the cfloop.

    < cfif structKeyExists (cfData, 'data') >

    < cfoutput >

    < cfloop index = "i" = "1" to = "#arrayLen (cfData.data) #" >

    #cfData.data.searchTitle.en # < h1 > < / h1 >

    #cfData.data.current_version.en.text # < p > < /p >

    < / cfloop >

    < / cfoutput >

    < / cfif >

    And this is what looks like the struct.

    ColdFusion-Array.png

    OK, got it working.

    #cfData.data [i] .name #.

    #cfData.data [i].current_version.en.text #.

  • Table of while loop

    Hello

    How can I get the table while loop in the attachment?

    Any help will be appreciated.

    [Running LabView 8.5].

    Thank you

    hiNi.

    What do you mean by "get a picture?"  You get a table that will have a random number in the 1st item and the number 10 as the second element.

    You try to build a table of values that contain information on all iterations?  Then right-click on the tunnel and turn on automatic indexing.

  • Generation of loop infinite nest

    Hello

    I have tried to create a nest of infinite loop For TestStand and stuggling to find a way to do a little.

    If you see the attached screenshot, the program runs to each index of the table, for loop 1. There is another loop For loop 2, with the Start/Stop/not inside the loop For For 1. Execution stage element is the index of loop nest, for example, Array Index 2 will start at 5, go to index 1 and run the loop (from 0 to 10 in step 2 and here at every step, he goes back to the Index 0 and run the table. When finished will return to index 1 index 0, and go well the loop. The same systematic for the Index 2 at each stage will be index 0 or everything he has the value).

    In LabVIEW, I can just set it to re-entry VI and feed in the index of the step to execute, but how can I do this in TestStand?

    I really appreciate the help in advance.

    Best regards.

    tlee16 wrote:

    Thanks for the response Doug.

    So I have the sequence (with levels who read from a variable) and wants to call itself its own sequence but with different values in the variable (at runtime, called sequence data passed in this sequence should not replace the sequence of the appellant), how can I implement something like this? Is there a way to check where the sequence has been called since then? or maybe some sort of entry stamp can I write/pass data entry in the sequence? Maybe I should change the way of how it is written/designed...

    Thank you!

    You must use "by value" settings of your variables. To create these settings, insert variables in the setting of the display of the variables group. By default, they are "pass by reference", to change them to be passed by value, right-click on the variable parameter and uncheck the option menu "pass by reference". The variables that are passed by value are passed as in the copies of the original, everything changes for them in the order does NOT affect the original versions in the calling sequence. However, if you want to be able to pass data in the sequence they you need to at least some of your settings to "pass by reference" so that changes made to the parameter in the subsequence may be returned to the calling sequence.

    Hope this helps,

    -Doug

  • How to use table 1 d of waveform in the Matlab Script

    I use Lavbiew to make the classification of Vibration signal.

    The first problem I encountered is the form of incorrect data.

    The output signals are 1 d arrary of waveform. I don't know how to use the Matlab Script.

    is someone can help me with this?

    I really appreciate your help.

    Hey beauzhang,

    I hope that you are well today. It certainly seems that we lack in some problems with the different sources and data types of wells. LVM VI Express load you have emerged from a table of waveforms. So we would need to do a few things. First of all, we need to ignore the range of interests, and we must get the waveform data elements table.

    I have provided an example of how we can extract the waveform in position 0 of the table and then pass the array of data values to the script node Y. I have configured the entry of the data of a table 1 d Reals node (by adding an entry and then the right of entry and select choose data type.)

    If you are interested in getting the values Y and build the table like you did in the script, you need to implement a different subset of table and looping mechanism in LabVIEW code to move each item to the script individually. However, I would recommend working with the entry level instead.

    I hope this helps!

  • For loop runs with the value of N unwired

    In this case will be a loop run connected to the loop N worthless? I have seen a few examples of the loop for run without a certain number of times set to be ran wired or for example a size of table or something like that.

    PauldePaor wrote:

    Here's a program I am and as you can see the image that the program runs without the loop N being wired. The program will run without problem

    As everyone else has said, you don't have to plug something on N.  If you wire up a table for loop for input "auto-index", the loop for will run automatically the smaller table size.

    Perhaps an example will help:

    This makes a loop on my table size (in this case, long of 5 elements).  On the edge of the loop for which resembles [] brackets, indicates that it is auto-indexé.  The loop should go through each item one at a time (1, then 2, then 3, then 4, then 5).

Maybe you are looking for

  • HP HDX 16t chipsets and processors Acceptable

    As I searched for hours and could not find this information, I thought I'd post my findings.  I contacted Intel and here's what they say for the 16 t with 130M nVidia graphics card: -intel 4 Series Chipset PM45 (http://www.intel.com/products/notebook

  • Assistant scanner and Camra appears to be missing

    I did a reinstall of my OS and the scanner and camera wizard seems to be missing. Does anyone know how I can re - install this you or where to go to get it? I have the recovery CD and the application support CD that came with my PC. Thank you.

  • Complete cant install from the CD

    OK guys, here's a weird. I just bought a WRT54GS wireless. I have 2 desktop computers; running an XP SP2 and the other running Vista Home Premium SP1. I also have a laptop Gateway running Vista Home Premium SP1. I bought it so I can use my laptop wit

  • Restart the laptop everytime I close.

    Hello people... I have the problem that whenever I close my T60 still running, I have to restart again. Does anyone knows how to fix this?

  • How can I reinstall the Windows Media Center Gadget on my PC with Windows 7, 64-bit?

    How can I reinstall the Windows Media Center Gadget on my PC with Windows 7, 64-bit?  I had left it one day and now I don't know where he is. I went into the control panel and tried to 'Restore the Gadget', but he said it was not something to restore