Arrays are my friends, right?

Okay, I've used arrays in the past, but I'm still very leery
of screwing things up. The code below is my usual long-way-around
the barn approach. I know that putting the buttons in an array is a
first step, but then how to get it to advance to the next numeric
frame is where I get nervous (every button points to a frame
starting on two, so button two points to frame 3, and so on). I
know I can use keyframes/labels but I don't want to have to repeat
the AS for each new keyframe on my AS layer. Any help would be
appreciated. Thanks!

hey Mr.A! :) ok let see what we have here ... you just want
the button to advance one frame from it's 'number'. Guess I'm
wondering why you don't have them numbered in relation to the
frame, that would make it a little easier, ... but anywho lol!!
doesn't matter :) yes, put them in an array, then use a loop to
assign the handlers and the frame number using the loop index, but
we have to something a little 'tricky' here, because of the nature
of the incremented var in the loop, we need to store a reference of
the number at that point in the iteration. so to do so, I've
assigned a new property to the 'button' instance called 'frame'
then you'd use that property value as the correct frame number, I
also add 2 to the number of the increment to find the correct frame
number, because the array index begins at zero and the button's
number sequence begins at 1. that should do it!

Similar Messages

  • Arrays are passed by reference or value ?

    Hi peoples,
    I have something interesting here which I need to know. Look into the following classes :
         public class example1 {
         int i[] = {0};
         public static void main(String args[]) {
         int i[] = {1};
         change_i(i);
         System.out.println(i[0]);
         public static void change_i(int i[]) {
         i[0] = 2;
         i[0] *= 2;
         public class example2 {
         int i[] = {0};
         public static void main(String args[]) {
         int i[] = {1};
         change_i(i);
         System.out.println(i[0]);
         public static void change_i(int i[]) {
         int j[] = {2};
         i = j;
    Among the above classes, the class named 'example1' returns the value 4 whereas, the class named 'example2' returns the value 1.
    Any explanations to this one please....
    Cheers,
    Rasmeet

    minglu, you are not doing right.
    i just don't get it why you have i[] as instance variable but never use it ( i[] is declared in every method so each i you refer to in the method is a local varable not member variable that can be shared for the object ).
    your first solution work. but that i = j line is not needed because it has no effect you still cannot change the referrence of i to other int[]. your first soultion just need to be
    public static int[] change_i(int i[]) {
    int j[] = {2};
    return j;
    }anyway, using this solution, the method name will be misleading because the method didnot change i in anyway. i is changed because you assign the return array (j) to i.
    for that second solution also, you didn't use your member variable i at all. what you change is the content of i you pass so the result is correct. but then how is this method different from the first method the original poster posted?
    moreover, java never pass argument to the method by reference it ALWAYS pass by copy.i suppose you define passing by reference in the same way C++ does. all object variable in java is a refernce to Object so passing the variable to method is surely passing the reference to the method but that's not passing by reference. it's passing by copy because what is passed is the copy of the reference to the object, not the reference to the reference to Object. if it is really passing by refernce, then you will be able to change your reference to object to point anywhere because you have the access the address of the reference. but since you don't (you only know where the passed reference is pointing to (you have the COPY of value of reference) but you don't know where the refernce store its value) you can only change the content of the pointed object but not changing the pointed object.
    let me restate this, java always pass by reference.

  • What Are You Playing Right Now Thread

    Hey guys!
    Let's start a good conversation! Thread topic is very simple which is...
    What Are You Playing Right Now?
    > Give a short overview about the game you are playing or is hooked right now.
    > Give your recommendations to other members (good and bad or both are accepted)
    > Likes and Dislikes
    > Keep it clean and use English please
    Shall we start?
    Right now I am playing Final Fantasy X... yes.. an old game..... it's taking a long time to complete it. Before it, I played Mass Effect 3. Very nice game! Love the story! A lot of action and drama too. Recommend it to FPS and RPG gamers! Love the graphics too! Lady characters are very sexy! I think I'm in love with Miranda :p I'm also playing a little BF3 from time to time. I'm planning to go back playing MMO but can't decide what to play yet. I played Dragon Nest but got tired of it...

    Quote from: Taskmaster;1295
    we don't have FB in mainland...
    and everything is more expensive in here.
    I'd love to play HOTS thou
    Yeah StarCraft 2 looks awesome. I think I did play the first installment before I started working. I would like to finish the story. Been a fan of it since the first StarCraft... I'm kinda in a need of advice right now. I'm tired of playing single-player games right now like Final Fantasy, ME3.. I still have Alan Wake and Max Payne 3 that I haven't touched yet.. I feel like going back to MMOs.. any good suggestions? I feel like playing Guild Wars 2 but I'm reluctant since it's kinda old now and getting on top of the ranks should be harder for anybody entering the game right now.. Hmmm.. any other suggestions?

  • Are not the right ones for the icloud account. How can I find out what these are?

    I have downloaded icloud onto my PC. When I try to access my account I am told that although my Apple ID and password are correct they are not the right ones for the icloud account.How can I find out what these are?

    Christine Helen wrote:
    I can't find any way of creating an icloud ID. I only have a PC. no Mac product except an iPod classic.
    Oh, then you can't unless you know someone with a Mac you could use for a moment or 2. (Like at the Apple Store)

  • My photos are not printing right with adobe manages color but works when i use printer manages color. never had any issues untill a week ago.

    my photos are not printing right with adobe manages color but works when i use printer manages color. never had any issues untill a week ago.

    We use CS6, yes we calibrate using x-rite. I have always had adobe manage colors when printing. This problem just occurred, all my settings are the same as they have been for years. The only thing we did lately is do an update to CS6. We thought it might be our printer but when we use the printer manages color it works fine, The problem with adobe manages color is it is not blending the light highlights like on top of the cheeks with the colors around the cheeks  and its putting a faint red between the two it just does not have a smooth transition. I printed a photo that I had printed 4 months ago with no issue, and this time it had the issue that I am dealing with now. Somehow the photo shop manages color is not getting the right info to my printer.  
    I set paper type
    set quality
    no color adjustment
    set my profile
    Teri

  • Video-gaming: What are you playing right now?

    Hey guys,
    Continuing our mini gaming discussion series, today we thought it might be fun to talk about current games we're playing. At the moment, I'm playing The Witcher 3 and it is taking up far too much of my free time
    boxden.com
    What are you playing right now? How are you finding it?

    Marjo wrote:
    I'm playing Final Fantasy XIV (MMORPG) at the moment. Just reached level 50 and got the long-awaited access to the extension that just came out! I'd say the story in this one is probably one of the best I've ever come across! (not kidding) @Toby finish your Witcher quickly so you can start FFXIV!  @Cleoriff There are some very handsome characters in this game by the way. Probably not identical to Mr. Depp, but a joy to look at nonetheless. I may take a look...Oh just thought...is this PS4  ? If so I am sorry...we are part of the Xbox One clan......... *Stands back*...

  • My audio unit manager has gone, i cant scan it and all the components are in the right place, i just cant access my au manager at all in logic

    my audio unit manager has gone, i cant scan it and all the components are in the right place, i just cant access my au manager at all in logic
    any help please im going out my mind
    regards james

    Thanks for getting back to me, The AU manger was there, just when you treid to click on it, it just wasn't responding.
    But i had a scan thourgh google and found the answer, i removed the audio units cache and restarted it and all was good. I was really starting to get stressed over the matter but however i got to the bottom of it.
    Again thanks for replying
    Regards James

  • Number of connection to this computer limited and all connections are in use right now

    I have Lenovo ThinkPad T520 (i7, NVIDIA 4200TM) with dock station and two monitors. Sometimes when I close notebook and undock it from dock station. Then I cannot login to my notebook because of error "Number of connection to this computer limited and
    all connections are in use right now". This is screenshot of my laptop  http://i.imgur.com/6MXnQKf.jpg
    Laptop is not in domain and does not have remote desktop connections. It was just turned in sleep mode and late turned on. 
    This happen pretty often one from 10..20 times of undock.  It did not happen with Windows 7 before. 

    The network does not work properly after you resume the computer. This kind of issues are cuased by the network device driver. Download the latess Windows 8 driver from Lenovo website and install it.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • Since upgrade 5 everytime the search bar and fox logo are on the right and not central

    This has only come about since my upgrade to 5 the logo and search bar are on the right and not central. The only way to get a normal screen is to click bottom right. This is anoying

    What do I do to get back my normal screen.

  • I get the "This is a legacy conversation message" But i am updated and so are my friends.

    This is a legacy conversation from an old Skype client. Sending messages is not supported.  But I am updated and so are my friends! This has been very stressful for me.. I have updated skype to it's latest client but can only limit me to so much. Not sure what I am doing wrong but I need help. 

    I have got the same issue, it also started yesterday for me. I also cannot join group calls.

  • HT1171 I have the apple wireless key board.  There is only one delete key and it deletes all data to the  left side of the cursor.  Where is the delete function for deleting letters that are on the RIGHT side of the cursor?

    I have a new wireless apple keyboard. I can only delete items that are to the left of the cursor using the delete key.  What key do I use to delete items that are to the right side of the cursor?  I have only one delete key.
    My old apple wired keyboard has 2 delete keys that enabled me to easly delete data on either side of the cursor.
    Thanks

    Fn + Delete

  • I cant take a photo on my i phone and send it what am i doing wrong are my seettings right

    i cant take a photo on my i phone and send it what am i doing wrong are my settings right ???

    You are going to have to provide more information than this. Are you trying to MMS or email? Why do you say you cannot send it, are you getting an error of some type, and if so what is it?

  • Divs are not working Right for me

    Hello all hoping some one can help me on this one
    I am trying to get this site up and running but from some reson the dives keep braking apart nomater what browser I look in any ideas what it culd be?
    http://ol.helpmetechteam.com/
    Thanks Aaron Dye
    below is the css and html
    #bg {
    background-attachment: fixed;
    background-image: url(../images/bg.jpg);
    background-repeat: no-repeat;
    padding-top: 25px;
    padding-bottom: 25px;
    margin: 0px;
    padding-right: 0px;
    padding-left: 0px;
    #contact_us {
    background-color: #EEEEF0;
    height: 27px;
    width: 182px;
    font-family: Calibri;
    font-size: 16pt;
    font-weight: normal;
    color: #000;
    margin: 0px;
    padding: 0px;
    #adress {
    background-color: #EEEEF0;
    height: 56px;
    width: 244px;
    margin: 0px;
    padding: 0px;
    #phone_Number {
    font-family: Calibri;
    font-size: 24px;
    color: #01ADDB;
    background-color: #EEEEF0;
    height: 31px;
    width: 182px;
    font-weight: bold;
    margin: 0px;
    padding: 0px;
    #nav_bar {
    background-color: #EEEEF0;
    height: 35px;
    width: 863px;
    margin: 0px;
    padding: 0px;
    #ad_1 {
    background-color: #FFF;
    height: 64px;
    width: 697px;
    font-family: Calibri;
    font-size: 24pt;
    margin: 0px;
    padding: 0px;
    #ad_2 {
    background-color: #FFF;
    height: 73px;
    width: 697px;
    font-family: Calibri;
    font-size: 24pt;
    text-align: right;
    margin: 0px;
    padding: 0px;
    #main_text_body {
    background-color: #EEEEF0;
    height: auto;
    width: 1024px;
    background-image: url(../images/main_body_slice.jpg);
    background-repeat: repeat-y;
    padding: 0px;
    margin: 0px;
    #btm_left_corn {
    background-image: url(../images/btm_left.jpg);
    background-repeat: no-repeat;
    height: 77px;
    width: 206px;
    margin: 0px;
    padding: 0px;
    #footer {
    background-color: #EEEEF0;
    height: 40px;
    width: 612px;
    font-family: Calibri;
    font-size: 10px;
    vertical-align: middle;
    text-align: center;
    margin: 0px;
    padding: 0px;
    #below_main_text {
    background-color: #FFF;
    width: 1023px;
    height: auto;
    margin: 0px;
    padding: 0px;
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <head>
    <title>hmtt_5-26-11</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="css/main_layout.css" rel="stylesheet" type="text/css">
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <!-- Save for Web Slices (hmtt_5-26-11.psd - Slices: 04, 07, 09, 10, 11, 16, 210-822-8817, 25, 903_austin_highway_san_antonio_tx_78209, Big_Picture, Clearly_Mag_Glass, Help_me_tech_team_logo, ad_1, ad_2, btm, btm_left, btm_main_body, btm_nav, btm_right, contactus_icon, footer, main_text_body, nav_bar, top_main_body, top_mid)
    -->
    <div id="Main_body">
    <div id="bg">
    <table width="1024" height="862" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
    <tr>
    <td width="1" height="340" rowspan="9">
    <img src="images/spacer.gif" width="1" height="340" alt=""></td>
    <td colspan="3" rowspan="5">
    <img src="images/Help_me_tech_team_logo.jpg" width="341" height="158" alt=""></td>
    <td rowspan="5">
    <img src="images/top_mid.jpg" width="415" height="158" alt=""></td>
    <td>
    <img src="images/temp_04.jpg" width="62" height="24" alt=""></td>
    <td colspan="3">
    <img src="images/210-822-8817.jpg" width="205" height="24" alt=""></td>
    </tr>
    <tr>
    <td rowspan="2">
    <img src="images/contactus_icon.jpg" width="62" height="58" alt=""></td>
    <td colspan="2"><div id="contact_us">Contact Us</div></td>
    <td>
    <img src="images/210-822-8817-08.jpg" width="23" height="27" alt=""></td>
    </tr>
    <tr>
    <td colspan="2" bgcolor="#EEEEF0"><div id="210-822-8817">
    <div id="phone_Number">210.822.8817</div>
    </div></td>
    <td>
    <img src="images/temp_10.jpg" width="23" height="31" alt=""></td>
    </tr>
    <tr>
    <td colspan="3"><div id="adress">903 Austin Highway<br>
    San Antonio, TX 78209</div></td>
    <td rowspan="2">
    <img src="images/903_austin_highway_san_antonio_tx_78209.jpg" width="23" height="76" alt=""></td>
    </tr>
    <tr>
    <td colspan="3">
    <img src="images/903_austin_highway_san_antonio_tx_78209-13.jpg" width="244" height="20" alt=""></td>
    </tr>
    <tr>
    <td rowspan="4">
    <a href="#"
    onmouseover="window.status='Clearly You are in the right Place'; return true;"
    onmouseout="window.status=''; return true;">
    <img src="images/Clearly_Mag_Glass.jpg" width="137" height="182" border="0" alt=""></a></td>
    <td colspan="6"><div id="nav_bar">
    <ul id="MenuBar1" class="MenuBarHorizontal">
    <li><a href="#">Home</a> </li>
    <li><a href="#" class="MenuBarItemSubmenu">Services</a>
    <ul>
    <li><a href="#">Equipment as a Service</a></li>
    <li><a href="#">Computer Repair</a></li>
    <li><a href="#">Networking</a></li>
    <li><a href="#">Managed Services</a></li>
    <li><a href="#">Managed Services</a></li>
    <li><a href="#">Security &amp; CCTV</a></li>
    <li><a href="#">Point of Sale</a></li>
    <li><a href="#">EMR &amp; Practice Management</a></li>
    <li><a href="#">Voice / Data Cabling</a></li>
    </ul>
    </li>
    <li><a href="#" class="MenuBarItemSubmenu">Who We Serve</a>
    <ul>
    <li><a href="#">Testimonials</a></li>
    <li><a href="#">Our Specialty</a></li>
    <li><a href="#">Clients We Serve</a></li>
    </ul>
    </li>
    <li><a class="MenuBarItemSubmenu" href="#">About Us</a>
    <ul>
    <li><a href="#">Our Story</a> </li>
    <li><a href="#">Our Promise</a></li>
    <li><a href="#">Partners &amp; Certifications</a></li>
    <li><a href="#">Why choose us?</a></li>
    <li><a href="#">In The News</a></li>
    </ul>
    </li>
    <li><a href="#" class="MenuBarItemSubmenu">Resources</a>
    <ul>
    <li><a href="#">Newsletter</a></li>
    <li><a href="#">White Papers</a></li>
    <li><a href="#">Techspert Blog</a></li>
    <li><a href="#">Guest Voices</a></li>
    </ul>
    </li>
    </ul>
    </div></td>
    <td>
    <img src="images/temp_16.jpg" width="23" height="35" alt=""></td>
    </tr>
    <tr>
    <td colspan="5">
    <img src="images/btm_nav.jpg" width="697" height="10" alt=""></td>
    <td colspan="2" rowspan="3">
    <img src="images/Big_Picture.jpg" width="189" height="147" alt=""></td>
    </tr>
    <tr>
    <td colspan="5"><div id="ad_1">you are in the right place</div></td>
    </tr>
    <tr>
    <td colspan="5"><div id="ad_2">Because as Systems Integrators we see the </div></td>
    </tr>
    <tr>
    <td height="11" colspan="9">
    <img src="images/top_main_body.jpg" width="1024" height="11" alt=""></td>
    </tr>
    <tr>
    <td height="363" colspan="9"><div id="main_text_body">
    <div id="main_text">
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    </div>
    </div></td>
    </tr>
    <tr>
    <td width="1" height="114" rowspan="4">
    <img src="images/spacer.gif" width="1" height="114" alt=""></td>
    <td colspan="8"><img src="images/btm_main_body.jpg" width="1023" height="11" alt=""></td>
    </tr>
    <tr>
    <td colspan="8"><div id="abuve_footer">
    <div id="below_main_text">
    <p> </p>
    <p> </p>
    </div>
    </div></td>
    </tr>
    <tr>
    <td colspan="2" rowspan="2"><div id="btm_left_corn"></div></td>
    <td colspan="3"><div id="footer">Copyright &copy; 2010 Help Me!!&reg; Tech Team, a dba of HELP ME!!&reg; Computers, LLC All Rights Reserved. Contact us at [email protected] <br>
    903 Austin Highway San Antonio, Texas 78209 | Phone: (210) 822-8817 | Fax: (210) 832-0670 <br>
    </div></td>
    <td colspan="3" rowspan="2">
    <img src="images/btm_right.jpg" width="205" height="77" alt=""></td>
    </tr>
    <tr>
    <td colspan="3">
    <img src="images/btm.jpg" width="612" height="37" alt=""></td>
    </tr>
    <tr>
    <td>
    <img src="images/spacer.gif" width="1" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="137" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="69" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="135" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="415" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="62" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="16" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="166" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="23" height="1" alt=""></td>
    </tr>
    </table>
    </div>
    </div>
    <!-- End Save for Web Slices -->
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>

    You have HTML and CSS errors:
    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fol.helpmetechteam.com%2F
    http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=http%3A%2F%2Fol.h elpmetechteam.com%2F
    Address those and see how it works out.

  • Stalling a form from loading until the initial javascript arrays are loaded

    I am looking for a way to get a form to be hidden based on the onload event. I would like to call a javascript function to initially populate some select boxes based on javascript arrays, but I would like this to happen before the page loads or at least stall displaying the select boxes until they are populated.
    The way it is setup now, when the page loads, the select boxes try to load first and then the rest of the form loads. I would like to know if there is a way to load the select boxes from the javascript arrays, then have the select boxes and other form elements show up at the same time. I have tried putting a <div> around the entire form and within the javascript populate function I first use "document.formname.div_id.style.visibility=hidden" then at the end of the select box population within the function, I use "document.formname.div_id.style.visiblity=visible". I tried this and the select boxes appear blank; it is as if the populate function doesn't work at all.
    I realize this is a very long question, but I will award you Duke Dollars if you help me out!!!

    right now, I have it set up where I click on a link which is a jsp page which forwards me to the jsp page that has all the html in it. That page is where I initially try to populate the select boxes with the javscript arrays...I also have a number of javascript functions which change the contents of the select boxes based on another select box in the form. Will i have access to those "java" arrays, [instead of using the javascript arrays], that you are suggesting in the javascript code? I do need to use whatever arrays I create in javascript functions.

  • Problem with slideshow in iPhoto. Photos look like they are all the right way up but when in slideshow action some are sideways.

    even though all photos look like they are the right way up, when the slideshow commences, some of them display sideways. I have tried re-rotating them - and still have same problem. Help please - need it for Saturday night !

    What version of iPhoto are you using?  Are you creating the slideshow directly from an album or are you using the slideshow mode?
    As a test launch iPhoto with the Option key held down and create a new, test library.  Import some photos and test to see if the same problem persists. Does it?
    OT

Maybe you are looking for