Using code loop hard

Hey all, I could use some help with this.

If my current auto code adjusts and resizes a group of text.

I am looking to convert it into a loop so I can do generate more text fields without breaking.

and I'm scratching my head on how to structure.

addEventListener (Event.ENTER_FRAME, patchSpacingFun);

function patchSpacingFun(event:Event)

{

patTexArr1 ['pp2'] .x = patTexArr1 ["pp1"] .width + patTexArr1 ["pp1"] .x;

patTexArr1 ['pp3'] .x = patTexArr1 ['pp2'] .width + patTexArr1 ['pp2'] .x;

patTexArr1 ["pp4"] .x = patTexArr1 ['pp3'] .width + patTexArr1 ['pp3'] .x;

patTexArr1 ["pp5"] .x = patTexArr1 ["pp4"] .width + patTexArr1 ["pp4"] .x;

patTexArr1 ["pp6"] .x = patTexArr1 ["pp5"] .width + patTexArr1 ["pp5"] .x;

patTexArr1 ["pp7"] .x = patTexArr1 ["pp6"] .width + patTexArr1 ["pp6"] .x;

patTexArr1 ["pp8'] .x = patTexArr1 ["pp7"] .width + patTexArr1 ["pp7"] .x;

patTexArr1 ["pp9'] .x = patTexArr1 ["pp8'] .width + patTexArr1 ["pp8'] .x;

patTexArr1 ["pp10"] .x = patTexArr1 ["pp9'] .width + patTexArr1 ["pp9'] .x;

patTexArr1 ['pp11'] .x = patTexArr1 ["pp10"] .width + patTexArr1 ["pp10"] .x;

patTexArr1 ["pp12'] .x = patTexArr1 ['pp11'] .width + patTexArr1 ['pp11'] .x;

}

Here's basically what I started for the loop

its supposed to be those of the PatchLims


var patTexArr1:Array = new Array();

for (var i: int = 0; i < patchLims; ++ i)

{

}

Thank you

If patTexArr1 is a movieclip, use:

var patchLims:int = 11;

for (var i: int = 1; i

{

patTexArr1 ["pp" +(i+1)] = patTexArr1 ["pp" + i] .width + patTexArr1 ["pp" + i] .x;

}

Tags: Adobe Animate

Similar Questions

  • decimal to binary conversion using the loop

    How to create a LabVIEW program to convert a decimal number to binary equivalent using FOR loop?

    can someone help me please...

    Dhass, your sound question as a duty. Is this correct?

    If so, the zip code you have already so that we can identify the weak points in it.

    Tone

  • Problem with creation of table of references notifier by using a loop

    Hi all

    I am attaching two try_ChannelsOn2ndMonitor.vi screws out of the random values to four graphics and ChannelGraphsOnSecondMonitor2.vi receives these values through an array of references Notifier and refers to four corresponding graphics. Essentially, the graphics in the two screws are supposed to - and do - displays the same values.

    As a first step, using a loop to create the table of references of the notifier, I was unable to get the four graphs in the sub - VI to produce the desired values. They showed only the values in Figure 4 in the main VI. I tried to use the indexing, and then I tried using Shift Registers associated with the function of 'Building the table', but none of these methods worked. Finally, the only method that worked was that you see in try_ChannelsOn2ndMonitor.vi, which was to create four reporters simultaneously and combine them using 'building the table '. My question is: why is it not possible to create the array of references notifier by using a loop and always get the correct functionality? I spent a few hours I wondered about this.

    All of the comments related to my use of the notifiers, notifying bays or the reference of VI in the Structure of sequence are also appreciated. The structure of sequence is only there because the sub VI must be taken out of a second monitor; I essentially disabled it by setting the FP. State to 'Standard '.

    Thank you!

    Nemanja

    The table is still the order of the references notifier - so that you know the correct order.

    When you say "it will continue execution as soon as one of the notifications is received", do you know if it means he will send this notification for each registrant, or just for the appropriate warning system?

    I'm waiting on multiple notification - if you expected to return (and continue to run) once it receives all notifications I don't think it's what he does based on my understanding of the documentation.

    OK, now that I have had a good look, I probably slightly different framing the code - I propose the Subvi out of the while loop and then put a while loop around the code in the Sub - VI. Something like this:

    That's what I wanted to say to have individual loops for the Subvi - terminal error is connected to the judgment for loops (and thus the VI) stop running when you release the notifier. That should remove the need for static VI reference as the VI remains before the end of your first level VI - then you can move your code of positioning inside the Subvi.

    Using the sequence of structures here as you have done to make sure that the code block happens before your start of loop is very good, another common method is to wire the error out in (or at) the border of the loop - in a more complicated application, you would maybe put this code in a State 'init' of a state machine.

  • Control reference 1055 error when you use a loop for

    Hello

    I'm having a problem using control references to accomplish the following: I a VI that reads data from a text file, and then uses that automatically update the value of a control on front panel on two live different, then set the default values, and then save them. Comes from the array of control references, I tried looping on text labels until I have find the one corresponding to the order, I want to change and then update its value. The problem I have is that if I use a loop for, then 9times of LabVIEW 10 complains error 1055: "LabVIEW: object reference is not valid. If instead I the wiring to the index table and manually extract the reference, then it works every time and for each index of the reference of the order.

    Can someone take a look at my code and just see if its obvious what the problem is? In this case, I have a simple solution, but I would really like to understand what I did wrong. I have included as a code snippet, but also attached the files if that helps (Its Import_Colormap.vi, which is the problem). Persons with disabilities code fails, the active code works but I can't see what is really the difference between them - I can change the index of array 0,1,2, 3. and no mistake.

    Thank you.

    Your "Colormap.ctl" is a strict type def that contains a ring.  You define the elements programmatically, make the default values, and then save the "Colormap.ctl"?   I was never practicing this but here is a thread that covers this in detail. I do not understand what you expect reach by running.
    The next thing: at the same time (at the same time!), you open the Colormap.vi (this is what we see in yout PNG) that contains an instance of the Colormap.ctl on the front panel. I'm not pretty sure if LabVIEW can handle this correctly. This could be the reason why you sometimes get the error 1105.
    I prefer StringsAndValues and eventually the value of the ring running.  There is no need to do it with a def of strict type.

  • Using the loop

    Hi all

    I have two VO... IE, VO1 and VO2. and I have a handful of two your

    I want to compare attribute VO1 VO2 attribute... both have guess that 4 attributes.

    what I want to do here is: first of all I want to compare all 4 attributess VO1 1 rank to all the 4 attributes of 1st row of VO2. If they're all matches then the 5th value of attribute attribute value VO1 VO2 5th.

    If the 1st rank of VO1 is not with the 1st rank of VO2 then compare VO1 1 rank 2nd in the VO2... and so on...

    If the match then set value and exit that loop... and yet once compare with 2nd row of VO1 1st row of VO2...

    How can I do this... can I use 2 loops?

    loop external and inner loop?

    If Yes, then how can I extract the data of both your and how I can compare their attributes?

    Thank you...

    Hello

    Yes... you can do using two Do While loops. using vo.next.

    Please find the below generic example code.

    OAViewObject dbVo = (OAViewObject) oaapplicationmodule.findViewObject ("SimpleSearchVO");

    Line line = null;

    dbVo.reset ();

    do

    {

    line = dbVo.next ();

    if(Row == null)

    {

    break;

    }

    Line row2 = dbVo.getCurrentRow ();

    String newprice = String.valueOf (row2.getAttribute (viewAttributeName))

    } while (true);

    Thank you

    Bharat

  • creation of an area of dynamic text inside a movieclip using a loop for

    I'm having issues creating several areas of dynamic text inside a movieclip using a loop for.  I use 2 ACEs.  Here is the code I've created so far

    var leading: Number = 0;

    function drawClip (): Void

    {

    this.createEmptyMovieClip ("mc", 10);

    for (i = 0; i < 5; i ++)

    {

    mc.createTextField ('text areas' + i, this.getNextHighestDepth (), 0, leading, 200, 200)

    MC ["text boxes" + i] .text = i;

    leader + a = 20;

    }

    }

    drawClip();

    Create a mc but she only display the number 5

    Any thoughts?

    You are cionstantly, crushing the textfield created previously due to the use of the wrong depth define.  You point to 'this' to get a depth value, but he planted inside 'mc', so it's always at the same depth since "this" index of depth does not change.  Use...

    mc.createTextField ('text areas' + i, mc.getNextHighestDepth (), 0, leading, 200, 200)

  • How to use the loop in BPEL process

    Hi friends

    I did a bpel process that picks up the XMl file using the File adapter and imports the data from the XMl file into db oracle table using the DB adapter...

    But here the XML in the file that have only one line... If I want to insert the XML code in the file that have two or more lines I want to use a loop in my process BPEL how to use loop in my bpel process?

    In my BPEL process, that I have que j' ai utilise used receive, process and call activity where I can use in my BPEL process

    Thanks in advance

    AT

    Here is a basic example of while activity in BPEL

    http://blogs.Oracle.com/ajaysharma/

    Thank you
    AJ

  • by using a loop

    Please help me this code to use a loop instead of cfif series. Thank you!

    See the code below.

  • Using the loop will decrease performance

    Hello
    Using the loop with a query will decrease performance.

    for r_row in (select * from table) Loop
    end of loop.

    This is done within another loop for, more cases, it returns a single value.
    It will decrease the performance of the procedure.
    kindly advice...

    Kind regards
    Balu

    user575682 wrote:
    Using the loop with a query will decrease performance.

    for r_row in (select * from table) Loop
    end of loop.

    This is done within another loop for, more cases, it returns a single value.
    It will decrease the performance of the procedure.

    Perhaps better understand everything that makes this PL/SQL loop construction.

    PL/SQL is two languages. It's PL (logic programming code) like Pascal, C or Java. You can use a 2nd language in it called SQL. The PL engine will be able to recognize when the 2nd language is used. And it compiles all the things that are necessary for motor PL call the SQL engine, pass the data to the SQL engine and get back data, etc. (compare this with the complexity of the use of SQL in Pascal, C or Java language).

    So what's this loop? The PL engine recognizes the SQL SELECT statement. It creates an implicit cursor by calling the SQL engine to analyze (I hope a soft Parser), then run it.

    As part of the loop of the PL, the PL engine now calls the SQL engine to extract data (lines) of the cursor. With 10g and later, the engine of the PL is smart enough to use the implicit treatment in bulk.

    Before 10 g that he used to extract a line from the SQL engine, make the loop, the next line extraction, the loop, etc. In other words, if there is a 1000 lines to pick up, he'll call the SQL engine after 1000.

    With 10g and later he get a 100 lines, which store in a buffer internal and then make the loop once 100. With a 1000 lines to fetch, it requires 10 extractions in bulk instead of one 1000 rank of extractions.

    These extractions require a change of context - as the engine PL must not out back, and in the SQL engine to extract a line. It is an overhead projector and can become so slow the context switch nothing more.

    And it's the construction of bases for this loop (and most other cursor loops) in PL/SQL.

    The ideal is to reduce the number of context switches. It is an overload that can have an impact on performance.

    What about using a loop in a loop. As 'bad '. This example uses the outer loop to retrieve the data. These data are then used to excite the extraction in internal or nested loop. The outside loop draws data from the SQL engine in PL variables Inside loop drives that same data back to the SQL engine.

    Why? It would have been much faster not to pull and push data between the loops using PL.

    It will be much faster do so only through SQL. Write the two loops as a single SQL statement and have the SQL engine directly driving these loops itself. This is called a JOIN in SQL. And the SQL engine can do not only more quickly, but it has a few algorithms of multiplied can be used which are even faster than a nested loop process (called merge joins, hash joins, etc.).

    Bottom line. Optimize SQL. Reduce to a minimum the PL. *

    Do as much of your data, crunch in SQL as possible. SQL is the fastest 'place' and process the data. No PL (or C/Pascal/Java).

  • Is it necessary to use separate external hard drive or external hard drive new or freshly formatted for backup time machine.

    Is it necessary to use separate external hard drive or external hard drive new or freshly formatted for backup time machine.

    Both fresh and freshly, can use as a Time Machine backup HARD drive, although I personally prefer to use newly formatted disk.

  • You can use an external hard drive with the Mac Mini?

    I've seen videos that say that we cannot increase the ram on a min of Mac, but I'm curious if this works like an ordinary computer, if we can attach an external hard drive to store some of the memory to free up space. Sorry if this is something stupid just need to know what I can do with it.

    You can use an external hard drive to boot and run with any Mac. Its not going to improve or replace your ram. If you use a mechanical hard drive in any Mac then help and boot from an external drive, especially if it's a SSD will be significantly faster.

  • Equium P200-1ED: is it possible to use 3 Gbps HARD drive?

    Hi all

    I have a laptop Toshiba Equium P200-1ED and quickly fill capacity on the hard drive. I'm looking to upgrade to something like a 500-700 GB HARD drive.

    However, when I look around for 1.5 gb/s options I am limited to 160 GB maximum.

    Even if the current HARD disk interface is 1.5 gb/s (currently using Hitachi HTS542512K95A00) is possible to use a HARD 3 gb/s drive and P200-1ED will support it?

    I am not so embarrassed on the speed of performance, more the need for a larger storage capacity without having to get an external drive.

    Any advice would be appreciated.

    Announcement

    Hello

    Equium P200 supports the controller SATA HDD and SATA I and SATA II HDD are compatible and would be supported by the BIOS.

    You can use a disk HARD SATA II (3 Gb/s).

    But perhaps only the 1.5BGb / s (SATA I performance) would be reached.

  • Can I use an external hard drive for my photos screensaver?

    Is it possible to use my external hard drive as the source of the photos of the screen saver?

    I'm running El Capitan 10.11.3 and have a Seagate BUP Slim.

    isabelfromsutton

    Just to clarify, this means the iPhoto somehow? Then, in a version?

  • Can I use the drive HARD internal extra for my Satellite A200-1 to 9?

    Hello, new to these forums,

    I recently bought the A200-1 to 9, and I'm very happy with it. I was interested by the addition of an extra internal HDD to the exisitng 120 GB one. I obviously did not have enough research I bought a Toshiba MK2035GSS: 2.5 "HARD 200 GB drive thinking it would be slot directly into the spare slot and it doesn't.

    So, really, I'm looking for some advice if I can add an extra internal hard drive and if so what model and how. After taking the back cover it looks like the aura of the place for another drive, even though I'm not sure if correct connections are there, or maybe if the space is used for something else.

    Any help much appreciated.

    Thank you
    Martin

    Hello Martin

    As far as I know that some A200 models come with hard drives 2. because of this Toshiba laptop brand standard chassis. All A200 models use this standard chassis. Your A200 comes with a single drive HARD and because of this place for the second disc is empty. This does not mean that you can use the second HARD drive.

    I have the same laptop as you and in my case there is no any prepared for second HARD drive HARD drive connector.

  • How to use the second HARD drive of Satellite A210 - BP1 for mirroring

    Satellite A210-BP1 came with 2 HDD (160 GB).
    Now, I want to use the second hard drive mirrored the first, one that has Vista installed.
    This should be done without supervision and in real time - as a RAID 1.

    How can I do this?
    I also have Vista professional available and I would be willing to use 3rd party software as well.

    Thanks in advance for your answers.

    Hi Jan

    I doubt that this is possible
    Why? The point is that you need to use two hard drives in mirroring, RAID striping, mode etc technology
    Satellite A210 can't RAID. It s only a SATA controller without RAID capacity!

    Therefore, the final answer is; NO, it is not possible to use mirroring

    Concerning

Maybe you are looking for