How do you write a code to automate this?

Hi team,

Always try to improve my code...

So I had all these buttons... How would I go about coding so I did not have this repeated 100 times function?

See you soon,.

Void

for example

GSmain.gsshape.gss1.gssr.gssr1.addEventListener (MouseEvent.CLICK, page2go)

function page2go(e:MouseEvent) {}

gotoAndStop (2);

}

GSmain.gsshape.gss1.gssr.gssr2.addEventListener (MouseEvent.CLICK, page3go)

function page3go(e:MouseEvent) {}

gotoAndStop (3);

}

GSmain.gsshape.gss1.gssr.gssr3.addEventListener (MouseEvent.CLICK, page3go)

function page3go(e:MouseEvent) {}

gotoAndStop (4);

}

etc etc.

use:

for (var i: int = 1; i<>

GSmain.gsshape.gss1.gssr ["gssr" + i] .addEventListener (MouseEvent.CLICK, top)

}

function pagego(e:MouseEvent) {}

gotoAndStop (int (e.currentTarget.name.substring (4)));

}

Tags: Adobe Animate

Similar Questions

  • How can you write a time interval in the timer for User Interface?

    Use a timer on a control panel, that triggers a callback function to the sample data.  I would like to read a digital input from the user interface panel and then set this value in the interval of the timer.  But how do you write the interval of timer?  Obvious function doesn't seem to work,

    SetCtrlVal (panelHandle, PANEL_TIMER, %SAMPLESECONDS%);

    Probably the best place to start is with the help of high level for the control that you are interested in.   I usually just to go to the index tab in help, start typing the name of the control (timer in this case) and then choose the top level help topic.  From here, you can see the attributes that you can use the events you can capture, programming concepts, etc.

    NickB

    National Instruments

  • How can you correct error code 800 F082F I get when trying to install SP1?

    How can you correct error code 800 F082F I get when trying to install SP1?

    Hello

    1. you are trying to install service pack 1 through Windows Update?
    2. What is the exact error message?

    Cause of the error 800F082F: cannot install this update with the other updates. Therefore, if you have already installed other updates without rebooting, and then you try to install this update, you may receive error 800F082F. To resolve this issue, restart your computer, and then install this update again.

    If the problem still persists, then download SP1 from the Microsoft Download Center and install it.
    For 32-bit computers: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=30
    For 64-bit computers: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21299

  • How can I write ASCII code on my HP G56-130SA laptop that has no numeric keypad?

    I would like to know if it is possible to write the ASCII code on my laptop because there is no numeric keypad.

    Thanks a lot for your help.

    There is a way, but it is not as easy if a numeric keypad was present.  At least, it was the closest match I could find.

    Go to start, search for character map and open this result.

    You should get a screen like this.

    Scroll through the different characters, highlight a character you want and press select.  In the character of the text box copy, you can copy and paste the character from there to your program of your choice.

    I know that's not ideal, but that's really all that I could find.

    You can also use a USB NumPad as this one.

  • How do you create a calculation that automatically updates the changes?

    Hi all

    I am trying to create a named using subtraction calculation. That's how it is stated:

    KM

    -KG

    Field1 =

    -Field2

    = GM (liquid)

    The tab calculate for zone 1, I wrote in the simplified field notation:

    KM - KG

    And the tab calculate = GM (liquid), I wrote it in simplified field notation:

    Field1 Field2

    And it all works perfectly that I change all the totals in the fields of Field2 or KG or KM .

    If changes in these areas they don't update automatically.

    How can I make them to update automatically?

    Any help would be much appreciated.

    Thank you very much.

    Bridie

    To set the order of computation of field, go first in forms editing mode (Tools > forms > change), then: tasks > other tasks > edit fields > set field calculation order

    Order the fields in a list of everything that makes sense for your form. Be sure to do it again once the form works as you want to ensure that it is always configured correctly.

  • How can you write a table to a file when you press a button in Labview 8.5

    I am new to LabVIEW, so I don't know if it's hard or not or can even be done. I have data I am gather and store it in a table in LabVIEW but I want to be able to take all the data table and write in a text or excel file. Another part I want is whether when a user presses a button, in which case they screwed up. Any help would be appreciated. Thank you!

    It is not hard to do. If you have a main loop that collects data continuously, so you can wire just up the Boolean value control to a case structure, so when the button is true you write to the file. It is supposed to be a one-off, or are more than a rocker (which means that you connect so that the button is true)? You can also use a structure of the event. See the "New handler" example that comes with LabVIEW (help-> find examples).

  • How can you write a resume using windows Vista Home Basic?

    How can I write a resume using windows Vista Home Basic? I put t have microsoft word or office.

    Start menu -All Programs - Accessories - Wordpad.

  • How can you write "A SEQUENCE OF characters" in sql... ?

    Gurus of the afternoon,

    A fast if all goes well. I am eager to return all records where a family of field name! = A SEQUENCE OF characters IN THE fnd.description field.

    How do I do this in SQL?
    SELECT DISTINCT fnd.CREATION_DATE, fnd.user_name, fnd.start_date,  per2.last_updated_by,
    per2.last_update_date,per2.employee_number, per2.EMAIL_ADDRESS, 
    per2.full_name, fnd.LAST_LOGON_DATE 
    
    FROM fnd_user fnd, per_people_f per2
    
    WHERE  fnd.employee_id  = per2.person_id(+) 
    
    AND fnd.end_date IS NULL
    
    how do I rewrite this..? ** AND SUBSTR(per2.LAST_NAME, 2, 6) !=  SOME SEQUENCE OF characters IN per2.EMAIL_ADDRESS **
    
    aND per2.EMAIL_ADDRESS LIKE '%priddle%' 
    ORDER BY 2 ASC;
    How can I write in SQL ' a SEQUENCE OF characters IN per2. As of email_address one ' % the same characters as its in SUBSTR (per2. LAST_NAME, 2, 6) %'...?

    I hope it's unclear! Please ask any questions.

    Thanks for the research.

    S

    Two ways:

    AND per2.EMAIL_ADDRESS NOT LIKE '%'||SUBSTR(per2.LAST_NAME, 2, 6)||'%'
    

    or

    INSTR(per2.EMAIL_ADDRESS,SUBSTR(per2.LAST_NAME, 2, 6),1) = 0
    

    Published by: AP on July 30, 2010 08:30

  • How can I write the SQL query for this requirement?

    Hello

    I have a table that looks like this:

    NAME | ANNUAL |     VALUE
    ==== | ====== | =====
    execno |     480.     000004
    step |      480.     0400
    SCNA |     480. cd_demo
    System |     480.     D47-010
    type |     480.     step
    free_text |     480.     stage 400
    rbare |     480.     RBA-1
    execno |     482. 000004
    SCNA |     482. cd_demo
    System |     482.     D47-010
    free_text |     482.     step 300
    step |          482.          0300
    type |      482.     step
    rbare |     482.     RBA-1
    execno |     483.     000001
    type |     483.     step
    rbare |     483.     rke1
    SCNA |     483.     rke10
    step |     483.     0240

    Now, say that I want to fetch ONLY annual with execno = '000004' and '400' = step and scna = "cd_demo" and system = "d47-010' and type = 'step', how to write SQL code?
    At first, it seemed like a simple writing query but I've been struggling with it for hours without success. I must admit though that I'm not strong in SQL :-)
    There, can anyone help? Please...

    Thanks in advance.

    Emmanuel

    Published by: user12138559 on October 30, 2009 03:05

    Hi, Emmanuel.

    Welcome to the forum!

    Here's a way to do what you asked:

    SELECT       doc_id
    FROM       table_x
    GROUP BY  doc_id
    HAVING       SUM (CASE WHEN name = 'execno' AND value = '000004'  THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'step'   AND value = '400'     THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'scna'   AND value = 'cd_demo' THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'system' AND value = 'd47-010' THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'type'   AND value = 'step'    THEN 1 END) > 0
    ;
    

    If you think that a WHERE clause would be used, but WHERE does apply to a single line. You need a condition that checks several rows in the same group.
    WHEN has an effect something like WHERE.

    Published by: Frank Kulash, October 30, 2009 06:26

    This solution assumes that (name, annual) is unique.

  • How can you write text in ADOBE ACROBAT in VERTICAL WAY

    How can write us vertically in pdf format?

    And, how can write us in a slightly different direction for example, angle of 45 degrees.

    It is very important when doing short notes and give its positions.

    Because the PDF is not a word processor format, you won't try "mastering content" in PDF format.

    PDF does not support that (see standard ISO ISO 32000 for PDF).

    That said, you could use Acrobat to turn a page in 90 degrees and then enter the text with, say, the typewriter tool. Turn the page and you have a vertical text.

    45 degrees, you can use Acrobat to apply a watermark annotation.

    But for annotating a PDF file with comments just use the comment / markup tools availabe with Acrobat and Adobe Reader XI.

    Be well...

  • How can you write in the script of the OIDC today

    Hello

    I'm trying to compare date. Can anyone help me on how to write today.

    For example: <! - $if xEventEnd - >

    What I try to do is if xEventEnd is less today, displayed no content.

    Thank you

    <$dateCurrent()$>

  • How do you write a VI that changes the letters in a string?

    I need to write a program that changes to each letter of a string with the next letter in the alphabet. ('a' becomes 'b' and so on) Can anyone help? (Labview 14.0)

    Array of strings of bytes to do an array of characters.  Then use a loop FOR (autoindexing) to perform the conversion.  You want a case structure to deal with different z of the default and leave alone punctuation.  AutoIndex the results of the loop and then use Byte Array to the chain.

  • How can you fix error code 57F so microsoft updates can be downloaded? What is the best solution to this problem?

    57F error code

    Windows Update Forum:

    It comes with Vista, upgrade install and activate Forum.

    You will get the best help for any problem of Update/Service Pack in the Windows Update Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon.

    Mick Murphy - Microsoft partner

  • How do you write messages in the hub?

    A notification icon at the top works for most use cases, but if we receive messages via our application, how do ensure us than those appearing in the hub, as well as all the other messages?

    In fact, PIM: e-mail is e-mail CRUD.

    I have just re-read the BB10 notifications what API and its description say it will do just what I asked questions on:

    "The Notification API allows you to create an object of the notification in the universal inbox for BlackBerry 10."

    https://developer.BlackBerry.com/HTML5/APIs/notification.html

    I got confused because it works differently on the PLayBook. I guess the hub is then responsible for adding an icon at the top, then on the home screen icon.

  • How can you fix error code 0F00:113 C that no appropriate disk is present?

    I turned on my computer and a blue screen came up with a window. The window has three options: Test memory Test System and exit. I clicked on the exit and the dell splash screen started to load, then the screen came back to the top. I tested the memory of this time and everything was fine. I then tested the system and the error code came. My computer does not start. I can't even on the desktop.

    It is likely that disk corruption or failure has occurred.

    Use another computer to navigate on the web site of the manufacturer of the computer HD. Download the utility disk, bersion audit bootable. Burn it to CD or DVD. Start the computer to start from that and run disk checks. If the drive fails, replace it. Install your operating system backups or restore or a Windows 7 DVD disc set.

    If the drive passes, and if you have a Windows 7 disc, try a startup repair.

    Tom Ferguson

Maybe you are looking for