Make it more modular functions

Here's what I have...

for (var i: int = 0; i < numberOfChildren; i ++)
{
nor = new newsItemButtonMC();

NI.x = numLeftPad + ((niWidth*i) + niSpacing);
NI.y = 3;
ni.buttonMode = true;
ni.mouseEnabled = true;
ni.textNumber.text = (i + 1);

ni.addEventListener (MouseEvent.CLICK, showItem1);
ni.addEventListener (MouseEvent.MOUSE_OVER, showTitle1);
ni.addEventListener (MouseEvent.MOUSE_OUT, hideTitle1);
addChild (nor);
}


Without knowing all the ins and outs you can always get the general idea.  I create several buttons, change the title on them, and then add event listeners.

I want to make this as extensible as possible so I need to be able to build 1 function that can handle "showItem.  At the present time, showItem1 that...

function showItem1(e:MouseEvent):void {}
itemNum = 1;
showNext();
}

It is, essentially, the action for "button 1.  I need to be able to do the action for all the buttons so I want to be able to dynamically choose what value of the itemNum to according to what button clicked on it.

How do I do that?

TIA.

You can try something like:

function showItem1(e:MouseEvent):void {}
itemNum = int (e.currentTarget.textNumber.text);
showNext();
}

Tags: Adobe Animate

Similar Questions

  • Mail question: I want to remove my archived email (10, 000 ~) because I want to clean my iMac and make it more effective. Does anyone know if the removal of archive e-mail will leave my Inbox and saved intact E-mail or anything that doesn't fade too?

    Mail question: I want to remove my archived email (10, 000 ~) because I want to clean my iMac and make it more effective. Does anyone know if the removal of archive e-mail will leave my Inbox and saved intact E-mail or anything that doesn't fade too?

    Who is your e-mail provider?

  • I'm lookng for a product where I can produce a PDF secure for several clients.  When the document is finished, I want to fix it with a password, to make it more difficult to copy, but then I want to record in a secure location, send the link and not

    I'm lookng for a product where I can produce a PDF secure for several clients.  When the document is finished, I want to fix it with a password, to make it more difficult to copy, but then I want to record in a secure location, send the link and the password to the clients.  When customers go to download the PDF, they will have to if they accept the terms and conditions.  If it is accepted, they can download the document.  Working in DocumentCloud PDF services?  Thank you.

    Hi davidc21010281,

    You can try the DC Acrobat Adobe Acrobat download free trial | Acrobat Pro DC. Where you can create a secure PDF file (using Acrobat|) Securing PDF files with passwords) & send them to your customers (send and track online documents |) Tutorials Adobe Acrobat DC), on the other end, customers can download the PDF but they would need the password/certificate in order to open the PDF file.

    See also the FAQ of Adobe Document Cloud.

    Kind regards

    Nicos

  • How to make SQL * more count the comment and blank line numbers?

    Hello

    Parameter
    Value of the parameter
    Oracle versionEnterprise Edition Release 11.2.0.1.0 - 64 bit
    OPERATING SYSTEMLinux Fedora Core 17 (X86_64)

    I would like to know, is it possible to force SQL * Plus to provide the number of the current in the source file line whenever there is an error? I often put in the first line of my script SQLBLANKLINES the VALUE ON that I may be able to put several consecutive blank lines in my code (I do that sometimes, when I find that it is appropriate to make my code more readable or a sequence of instructions which I believe make their logic more comprehensible for the reader of the Group)

    Now the problem is that SQL * Plus will ignore these empty lines and whenever there is an error, the line number in the error message does not match the actual line number in the source file, but it seems to be the last non-empty line in the file.  Consider the following example:

    SET SQLBLANKLINES ON;

    DECLARE
        var PLS_INTEGER := 10;
    BEGIN


       
        var := 20
    END;
    /

    In the code above on line 9 (also counting blank lines), there is an error (no semicolon at the end of the var: = 20) but when I run the script

    SQL * also, here is the error message I get


    SQL > @myscript.sql;

    END;

    *

    ERROR on line 8:

    ORA-06550: line 8, column 1:

    PLS-00103: encountered the symbol "END" when expected in the following way:

    * & = - + ; <>/ is mod remains not rem

    < an exponent (*) > <>or! = or ~ = > = < = <>and like2 or

    like4 likec between | submultiset of type multiset Member

    The symbol ';' was replaced by 'END' continue.


    SQL >


    As you can see the error message indicates that the error was found on line 8, while in the file, it's really on line 9

    As long as the number of lines in the script is limited, this may not be a problem and we can quickly find the actual line number in the code that causes the error, but for a code, including hundreds (or even thousands) of lines and with many comments and blank lines, find line number given by SQL * error message more becomes complicated.

    So my question: is it possible to make SQ * more properly draw the line numbers, as they appear in the source file?

    Thanks in advance,

    Kind regards

    Dariyoosh

    Hi, Dariyoosh,

    The line numbers in error messages are always from the beginning of the statement, but not the file.  The back-end which checks the errors and generates the error message, has no idea if this statement has appeared in your file, even if the statement was in a file at all, or if it comes from multiple files, each with its own line 1.

    You can divide your scripts into parts, so that the long statements, which may lead to error messages, are each in a separate file, so the statement starts on the line 1 of the file.

    For example, you can call a script called fubar.sql, which looks like this:

    SET SQLBLANKLINES ON;
    
    @@fubar_1
    

    Which calls another script, called fubar_1.sql, located on the same directory as fubar.sql, that looks like this

    DECLARE
        var PLS_INTEGER := 10;
    BEGIN
    
        var := 20
    END;
    /
    

    You never call him directly fubar_1.

  • ... should a doubt in xml I use the extract or make my own plsql function...

    I use apex... and retrieving data in xml format...
    Now in plsql... It has functions like the extract that can be used to retrieve the values...
    But I have trouble understanding
    Since then, I find making a function which establish the substring and instr to find the value....
    Wait let me show you an example of XML data...
    <? XML version = "1.0" encoding = "WINDOWS-1252"? >
    < CraftyResponse >
    < address_data_paf_compact >
    < thoroughfare_count > 1 < / thoroughfare_count >
    < artery >
    < delivery_point_count > 5 < / delivery_point_count >
    < delivery_point >
    < organisation_name > THE BAKERY < / organisation_name >
    < department_name / >
    < po_box_number / >
    < building_number > 1 < / building_number >
    < sub_building_name / >
    < building_name / >
    < udprn > 12345678 < / udprn >
    < / delivery_point >
    < delivery_point >
    < organisation_name > MOVIES R US < / organisation_name >
    < department_name / >
    < po_box_number / >
    < building_number > 3 < / building_number >
    < sub_building_name / >
    < building_name / >
    < udprn > 12345679 < / udprn >
    < / delivery_point >
    < delivery_point >
    < organisation_name > FAMILY BUTCHER < / organisation_name >
    < department_name / >
    < po_box_number / >
    < building_number > 7 < / building_number >
    < sub_building_name / >
    < building_name / >
    < udprn > 12345680 < / udprn >
    < / delivery_point >
    < delivery_point >
    < organisation_name / >
    < department_name / >
    < po_box_number / >
    < building_number / >
    < sub_building_name / >
    < building_name > BIG HOUSE < / building_name >
    < udprn > 12345681 < / udprn >
    < / delivery_point >
    < delivery_point >
    < organisation_name / >
    < department_name / >
    < po_box_number / >
    < building_number > 17 < / building_number >
    < sub_building_name / >
    < building_name > LITTLE COTTAGE < / building_name >
    < udprn > 12345682 < / udprn >
    < / delivery_point >
    < dependent_thoroughfare_name / >
    < dependent_thoroughfare_descriptor / >
    < thoroughfare_name > TOP < / thoroughfare_name >
    < thoroughfare_descriptor > STREET < / thoroughfare_descriptor >
    < / artery >
    < double_dependent_locality / >
    < dependent_locality > CRAFTY VALLEY < / dependent_locality >
    < City > BIG CITY < / City >
    < postal_county > COUNTY POSTAL < / postal_county >
    < traditional_county > COUNTY TRADITIONAL < / traditional_county >
    < ZipCode > AA1 1AA < / code >
    < / address_data_paf_compact >
    < / CraftyResponse >

    Now how can I retrieve the values of the city, postal_country building_name,
    I know that we can use extract to get the result... But how exactly to use excerpt here I know endow...
    The other method is an easier method... which is to create your own function that uses... substr and instr
    He shal lsearch for < organisation_name > and find the orgonizatio...

    I don't know which approach is better... I make my own custom function an easier and better way...
    But someone has idea about the function extract... Please let me know...
    DB version is 11g

    All information must be assessed
    Thank you

    susf wrote:
    The version that I am using 11g xe...
    Here is the actual xml code, and... table structure is xml_data_type current column is donnees_xml

    You really should read the documentation, as suggested earlier.
    XML is a hierarchical structure. With your structure, something like the following should work (not testd)

    select x1.org
      from xml_data_type x, xmltable('/CraftyResponse/address_data_paf_compact/thoroughfare/delivery_point' passing x.xml_data
                                                   columns
                                                       org varchar2(500) path 'organisation_name') x1 ;
    
  • How can I make 'No. MORE EVENTS' go?

    I just got a 42MM stainless steel sport and have spent most of the day he set up and exploring. On several faces, including the utility and the faces of Mickey Mouse, there a line of text at the bottom that says 'NO MORE EVENTS'. I can't find any information on what it is or how to make it go away.

    Hello...

    Congratulations on your new Apple Watch!

    Try using the Apple Watch user's Guide...

    Customize your watch face

    and here > on the Faces & features

  • JO HP 6500 has more 'fax function disabeled.

    I have a HP 6500 has JO more I bought several years ago. I used the function of fax for a while because I had a landline. Got rid of the landline so didn't use do not fax on the printer. I don't remember if I've done something somewhere, but now I get a message on the printer when I press the button on the fax that this feature was disabeled and I need to contact the administrator. What does that mean. When I go to EWS also cannot configure Fax Wizard Setup a network connection error message. Check the network and try again. When I go to home button on EWS it says error system, network connection error. Check the network and try again. What I did and is anyway to fix what I can get the features of fax again.

    You check private messages.

  • Can I change color to a dull gray Lake to make it more attractive?

    I understand that we can improve a color (for example, the blue of the sea) by making it more or less strong.

    However, I have a picture that includes a dull grey Lake and I want to lose the grisaille by changing a color like turquoise or blue.

    Is this possible?

    Cliff

    If the image is really gray (in other words, the RGB values are equal) then it is not really a way in Lightroom to make major (and beautiful) changes the color. You can change the color a little, but not enough, in my opinion.

    You can perform this task much better in Photoshop or Photoshop Elements.

  • How can I make the more precise and less smooth pencil tool?

    Ive moved the slider of fidelity to "specific", but the lines are always really smooth. I need a line in stairs with several anchor points, but do not see this option in illustrator CS6. Thank you!

    Hello Jimi,

    Looks like you are using Adobe Illustrator CC and not AICS6. AICC had introduced these controls as stated in your pencil tool dialog box. Please upgrade to the AICC 2014 of Ai version where you could see an additional parameter for more precise controls.

    Take a look at the tools pencil AICC 2014 dialog:

    There are now 5 ticks instead of 4 in fidelity. The leftmost is accurate is the new control added to make things same as in AICS6.

    Thank you

    Dhirendra

  • An email is more fully functional with version 31.0. He worked on all the previous versions.

    My email is 'SmarterMail' and the email provided by DiscountASP.net, my website host. It is my main email account. The homepage (where I can see all my email) is fine, but when I click on a particular email to read and/or reply to it, the next (which is essential) screen appears somehow under contract, do not allow me to do all that it contains. When I try to manually expand the screen, it automatically bounces to tiny every time.

    Same story with v. 31.0 on my Windows XP Home and my Windows 7 computer. The same email problem.

    I can provide two screenshots (one showing correct display, the other, v. display 31.0) if someone can tell me how to include/upload!

    As a temporary workaround solution, try to maximize the window (in Windows, you can double-click on the title bar).

    The seller has a patch for this, but it may take some time to unwind.

    More information: https://support.mozilla.org/questions/1013240

  • Make the change in functionality modules if I put everything: the default configuration values?

    I was wondering if I could clean up my old FF of database/values.

    Can I set all settings by default in: config without any problems with my Add-ons?
    How can I fix: default config?
    Do you have other tips to make my cool FF as new without exporting all my data and then reinstall everything?

    Thank you!

    You can delete the prefs.js file in the Firefox profile folder to reset all default prefs and start from the beginning to make changes.

    • Help > troubleshooting information > profile directory: see file
  • HOW CAN I MAKE PRINTING MORE APPEAR BOLD?

    As a senior, I would prefer a policy of many more "BOLD", with the possibility to expand the script.

    Go to tools | Options | Content

    Click the Advanced button and then uncheck the box 'Allow pages to choose their own fonts... ". »

    Then experiment with your preferences. I downloaded an image for you that might help.

    In addition, you need to update Flash. Check out who and others to Plugin Check

  • More adapted function FFT

    There are a lot of FFT in attached LV function.

    I try to acquisit a short waveform of 5133 and do fft and is s (f).

    Then, it is necessary to calculate F as the joint.

    It's a real-time waveform display and the value of F.

    May I know what method or function I should use, thank you.

    I do not have the necessary drivers and the attached vi is considered to be one vi above the other stack )

    LabVIEW signal processing vi have two FFT phase vi that give real estate complexes and other mag as outputs.  You can use the vi suitable for the next step of the calculations youwould want to do.

    What is the result you would expect in technical terms (not in terms of equation) after the complete processing block.

  • ALT TAB and Windows plus button more TAB functions the two has stopped working

    I have windows vista ultimate and my daughter was playing on the computer. Now the Alt tab function and the windows tab function when you hold the windows key and press tab to scroll through your programs no longer works. I searched through the Control Panel, trying to find where and relight them this setting but can't seem to locate. Anyone know how to activate these functions?

    Hello

    Click Start and type services.msc, and then press . Click on continue in the UAC prompt. Scroll and click on the themes service, and then click Start/restart option in the left column. Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • Make Image more using the Web Service and Ksoap2

    Hey all, I was wondering if someone can help me with a problem. I use a .net web service that grows on a collection of person objects when a person runs a query from the blackberry phone. To implement this I'm using ksoap2. In my service, I'll send in a string as a parameter. I returned the collection of people that contain the firstname, lastname, address, race, sex. I also try to send a picture. Now, I got this works very well when you do not include the image settings.  In my class on the side of .net in person my class, I have 'image' public property which is a string. I get the bytes of the image and convert it to a base 64 string:

    MemoryStream ms = new MemoryStream();

    System.Drawing.Bitmap.bmp = new System.Drawing.Bitmap (imagePath);

    BMP. Record (MS, System.Drawing.Imaging.ImageFormat.Bmp);

    p.Image = Convert.ToBase64String (ms, GetBuffer());

    BMP. Dispose();

    Mrs. Close();

    Note: in my outings, I see the 64Encoding string.

    On the side of blackberry, I have:

    Byte [] imageArray = ((person) personVector.elementAt (i)).image.getBytes ();

    EncodedImage = bitmap

    EncodedImage.createEncodedImage (imageArray, 0, imageArray.length);

    gridMgr.add (new BitmapField (bitmap.getBitmap ());

    Unfortunately, my number of vector appears as empty and I keep get get a parse error. As I mentioned before, if I remove ownership of the Image on both sides, it works like a charm.  I tried to use just about everything. Any ideas on how to overcome the image using ksoap? I tried to make the image property in the two classes as arrays of bytes, but he had no success. My problem when you use the byte array was in the class of person on the side of the blackberry for the PropertyInfo, that I didn't know what to use (for example STRING_CLASS, OBJECT_CLASS, LONG_CLASS); in any case, neither worked. What do you suggest me?

    I was able to do successfully the bytes of the image the device in the following way in my seriealize class.

    In the getProperty method, I use the following:

    info.type = MarshalBase64.BYTE_ARRAY_CLASS;

Maybe you are looking for

  • iTunes iOS 7.1.2 connection problem

    I have iPhone 4 (model: A1332) with iOS installed 7.1.2.  When I try to enter in iTunes app it gives following message and doesn't show anything on the content. What is the problem? I can connect to iTunes with my Apple ID on my iPad 2 with iOS lates

  • Two accounts?

    Hey people, my first time here. My question is this: I recently started a company, and I would like to open a Skype account for purposes of allowing my tech savy customer contact via Skype. I am also an avid player and use Skype constantly. So I was

  • Difference between Intel processors

    Could someone tell me the difference between celeron to intel 2 ghz and processor intel celeron m 380?

  • Microsoft Windows kernel power? Help!

    BODY {font: x-small "Verdana"; margin-right: 1.5em} .b .c {cursor: hand} {color: red; do-family: "Courier New"; make-weight: bold; text-decoration: No} .e {margin-left: 1em; text-indent:-1em; margin-right: 1em} Laurette {margin-left: 1em; text-indent

  • Alureon Rootkit is too strong for me.

    Alureon Rootkit is too strong for me. Apparently, Alureon is with me for a long time and I simply stop using that computer for the last year.  Alureon has survived a full windows (6 trials) format, also survives in a COMPLETE of Ubuntu Linux 11.10(4