Trying to make a variable with for loop

Trying to pick up a movieClip  instance from my library and set it on stage and make it clickable, (dropdown/dropup) menu). 
Can anyone help with what I am doing wrong?
var MenuItem1:Array = new Array("text1", "text2", "text3","text4");
CreateM(MenuItem1.length);
function CreateM(Menu1:Number):void
for(var i:Number=0;i<MenuItem1.length; i++)
      var this["M1"+i]:TextField = new TextField();
      var this["M2"+i]:takki = new takki();
      this["M2"+i].y = this["M2"+i].y-(i*50)+(stage.stageHeight-this["M2"+i].height);
      this["M1"+i].text = MenuItem1[i];
      this["M1"+i].y = this["M1"+i].y-(i*20)+(stage.stageHeight-this["M1"+i].height);
      addChild(this["M2"+i]);
      addChild(this["M1"+i]);
      this["M2"+i].addEventListener(MouseEvent.MOUSE_OVER,clicking);
function clicking(event:MouseEvent):void
trace("I am clicking button"&&this["M2"]);

Try something like this:
var MenuItem1:Array = new Array("text1", "text2", "text3","text4");
CreateM(MenuItem1.length);
function CreateM(Menu1:Number):void
for(var i:Number=0;i<Menu1; i++) { 
    this["M1"+i] = new TextField();
    this["M2"+i] = new takki();
    this["M2"+i].y = this["M2"+i].y-(i*50)+(stage.stageHeight-this["M2"+i].height);
    this["M1"+i].text = MenuItem1[i];
    this["M1"+i].y = this["M1"+i].y-(i*20)+(stage.stageHeight-this["M1"+i].height);
    addChild(this["M2"+i]);
    addChild(this["M1"+i]);
    this["M2"+i].addEventListener(MouseEvent.CLICK,clicking);
function clicking(event:MouseEvent):void{
trace("I am clicking button" && event.target.name);
Be aware, that you have to work with the positioning, and that the TextFields are overlapping the takkis, so that the clicking is only possible in a minor fraction of the takkis.

Similar Messages

  • I've been trying to make an account with iTunes n everytime I get to the part of the credit card that's as far as I get because I dnt have one, how can I make an iTunes account without a credit card??

    I've been trying to make an account with iTunes n everytime I get to the part of the credit card that's as far as I get because I dnt have one, how can I make an iTunes account without a credit card??

    Where are you located?
    Just go and buy an iTunes gift card at any store in your country.
    Then follow all the steps you did, but when it asks you for the credit card number, there shoujld be a GIFT CARD option which will let you load your account witht eh funds form the gift card without providing a credit/debit card #.

  • Trying to make a higscore chart for applet

    hey im trying to make an highscore applet for a mathquiz applet and i need it to save the users score possibly as a cookie ryte now i am using:
    PrintWriter out
    = new PrintWriter (new BufferedWriter (new FileWriter ("file.txt")));
    But this only works on the HSA console, Also if anyone knows how to make an exit button exit the internet explorer that would help to. Thanks alot

    Sorry Sabre. Just trying to be a little realistic is
    all.I fealt you were a little too dogmatic and negative about the problems the OP might encounter.
    >
    Setting aside the server-side (servlet) problems,
    here are two questions I have about saving the high
    scores as a cookie
    1. (How) are you going to save the cookie? Normally,
    web browsers receive cookie updates and store them
    automatically. But since you'll be connecting through
    java, that won't happen. If that doesn't happen, how
    does the client know (aside from kludging the applet)
    what cookie to send along with its request?This link shows exactly how to do it (without the need for WebServer involvement).
    http://www.wildtangent.com/developer/howtos/JSCookiesHowTo/
    >
    2. A year or so ago I spent a good deal of time
    trying to fix up URLs and URLConnections so that I
    could save and return cookies, since this is not
    default functionality. I found that it was EXTREMELY
    difficult to both extract the cookie and to add it to
    the request. Perhaps you or others have had better
    luck with this.
    Right. Applets don't commonly allow you accessto
    the
    local file system. You can either report thescores
    to the server (assuming you can put a servletthere)
    or you can sign your jar file.
    You're never going to get this to work either.Why won't the OP get this to work either? One can
    easily self sign an Applet jar file and then allthe
    user has to do is to agree to allow the Applet to
    write the file!Again, sorry. My thought was that the work involved
    in learning and implementing either the servlet or
    local file system solution is going to take at least
    as much time as everything else combined. It is true
    that my experience with jarsigner and self-created
    certicates is limited, but the times I have gone
    through the process, it's just taken me forever.When the signing process is understood this is easy - even doing it manually. If one understand how to use Apache Ant then this is trivial to automate. If you would like to see a sample Ant script then I will post one (actually I use two scripts).

  • Ive tried to make a purchase with my other apple id but i keep getting prompted to purchase this app again....i want to continue in the game im working on but i dont want to wait the 30 days until i can use my new prepaid credit card(mastercard)....both i

    Ive tried to make a purchase with my other apple id but i keep getting prompted to purchase this app again....i want to continue in the game im working on but i dont want to wait the 30 days until i can use my new prepaid credit card(mastercard)....both ids are linked to my facebook does that help?

    Ive tried to make a purchase with my other apple id but i keep getting prompted to purchase this app again....i want to continue in the game im working on but i dont want to wait the 30 days until i can use my new prepaid credit card(mastercard)....both ids are linked to my facebook does that help?

  • Help on changing array elements with For loop

    Hi,
    I'm wondering if anyone can help me with this problem.  I'd like to be able to modify elements of an array with For loop.  In the attached VI, my goal is to have an array of [0 1 2 3 4 5], but instead what I've got is [2 2 2 2 4 5].  I initialized the array with a value of 2 to help me identify which elements are changing.  Can anyone help me pointing where my mistake is?  Thanks.
    Peter
    Attachments:
    Array test.vi ‏19 KB

    It's a classic issue for LV newbies. In this case you HAVE to use a
    shift register otherwise the modifications of previous cicles are lost.
    It's all easier than it's seems, see attached vi.
    bye,
    manga
    Attachments:
    Array test 2.vi ‏19 KB

  • I'm trying to make a "Submit" button for my existing UIPickerView. Help!

    Hi there! I’ve been tearing my hair out and searching the web high and low for an answer to a question I have about UIPickerView. I was hoping that perhaps you could help me out!
    I’m trying to make a “Submit” button for my existing UIPickerView.
    I’ve coded a 3 column UIPickerView into my app, and it works great. However I’d like to add a “Submit” button and connect it to my pickerview, so that once a user makes their selections and clicks “Submit,” the app searches an existing array for the user’s selected values.
    Any help would be appreciated! I hope I explained that okay, lol.
    Thanks,
    Brittany

    Check this one.
    http://support.apple.com/kb/HT2731

  • I'm trying to make a timelapse with 900 pictures converted into 30 fps to get a 30 seconds video but after exporting my movie why is my video length 15 minutes?

    So, I downloaded a slideshow templates and I'm trying to make a timelapse with 900 pictures converted into 30 fps to get a 30 seconds video but after exporting my movie why is my video length 15 minutes?

    What settings are you using to export the video with?  I think 29.97fps is the only one that works with LR 5:
    http://lightroom-blog.com/2013/09/17/timelapse-again-in-lightroom-5-2/
    http://lrbplugins.com/shop/presets/lrb-timelapse-presetstemplates/

  • I'm trying to make a ring to for iPhone and about 20 sec into the playing of the song it fades out and goes silent. What am I doing wrong? Thanks

    I'm trying to make a ring to for iPhone and about 20 sec into the playing of the song it fades out and goes silent. What am I doing wrong? Thanks

    Im not sure what garage band is, but i can tell you the way apple recommends making ringtones. Highlight a song in iTunes, right click and select get info. Goto the options tab and youll see the time lengths (write down the ending time) for the start time type in where you want the ringtone to start, ringtones can only be 30 sec long so make the ending time 30 sec later. Exit it out of the info and while song highlighted goto the "advanced" tab at the top of iTunes where you will see an option that says "create aac version". after creating the aac version you will have a duplicate song in your iTunes, change the original back to the correct time length. Take the 30 sec aac version and drag it to your desktop, right click the icon and click "preferences" You will then be able to change the name of the file which will be somethign to the effect of "songnamehere.m4a" you just change the m4a to m4r. you now have a ringtone, drag the new file to iTunes where it will pop up in a new tab labled ringtones. If you cannot change the name of the file when it is on your desktop let me know and i will give you instuctions how to be able to change it. Once you get it figured out you can use any song you have on iTunes to make a ringtone.

  • HT5622 I tried to make a purchase with a credit card to I have been using with I Tunes for 2 years.  Now it's saying my security code is wrong??????

    Tried to make a purchase thru Itunes with a credit card I have been using for years.  Now it wants my security code which I entered three times and it said it was wrong (I know the correct) number.  Then I changed to another credit card, and it is still denying by purchase.  I was prompted to go to this website so here I am.  Can you please help me out
    Thank yyou

    whenever you attempt to put a card on itunes it puts a temporary $1 authorization hold for 24 hours - 48 hours depending on your bank - since you attempted so many times that is why that $1 is showing up so often - are you using a debit card? because if you are then if even the authorization hold doesn't go through like it should it will show a "ghost" charge that will drop off soon - it isn't fraud though - make sure your billing address is correct - if that doesn't work contact itunes store at getsupport.apple.com - click itunes - itunes store and follow the prompts and you can chat or email them.

  • Issue with FOR loop in Nested BEGIN and END terminals

    Hi All,
    I am trying to fetch row by row using FOR loop on CURSOR.An i am getting Error attached screen shot:
    Below is the logic:
    Create Procedure TEST1() LANGUAGE SQLSCRIPT AS
    BEGIN
    AN01 = Select * from AN.View;
    AN02 = SELECT DISTINCT F1,F2,F3 from :AN01 GROUP BY F1,F2,F3;
    BEGIN
    DECLARE CURSOR ITEM_RULE FOR select F1,F2,F3 from :AN02;
    FOR V_ITEM_RULE AS ITEM_RULE DO
    SELECT * from TABLE1 where F1 = V_ITEM_RULE.F1;
    END FOR;
    END;
    END;
    Here i an getting data from AN01..Then finding the Distinct in AN02.
    On AN02 i am applying CURSOR...and for each row i wanted to find an entry in TABLE1 and do a calculation further.
    -- But when i am using a FOR loop in the Nested BEGIN i am getting below Error.
    -- I tried to Activate successful without FOR Loop.
    Any Suggestion on the above issue.
    Thanks
    kalyan

    Hi Kalyan,
    Your procedure is incomplete.
    Why are you looping to make a select that you do not use? What is the target for ITEM_RULE_GDS selection?
    Also, like it is currently exposed a JOIN is highly recommended.
    Are you just playing around with procedure or you really have a scope to do ?
    Regards, Fernando Da Rós

  • Initializing variables inside for-loop?

    Dear all,
    It's been a while since I last programmed in Java, and my skills seem to be a bit rusty.
    I have a question for you here: suppose I need to initialize n (let's say 10) different integers, I suppose I couldn't use something like this:
    for(int i = 0; i < 10; i++){
      int <&iquest;VALUE?> = i;
    }Is there a way to dynamically initialize <VALUE>, for instance something like ("integer" + i)? (integer0=0, integer1=1, integer2=2, etc.)
    Thank you,
    Maarten

    You need to declare the arrays in a context outside of the for loop, the for loop context will end and so will all of your locally declared variables. Now there is a way around that:
    Make an ArrayList, in a "Global context" to your loop, and initialize your variables in the for loop, then add them to the ArrayList, once you are out of the loop, then the ArrayList will hold your references to your variables and keep them from being disposed. When you are done with them, then just remove them from the ArrayList.
    ArrayList<myNodes> al = new ArrayList<myNodes>(); //in a "global context"
    for(int i=0; i<iSomeNumber; i++){
      MyNode n = new myNode();
      //do what ever
      al.add(n);
    }If you need key values to look up your nodes by, then you a Map of some type instead of an ArrayList.

  • Trying to make a DVD with an old/non-existent version of iDVD!

    Ladies and Gentlemen,
    Please could you help me?
    I work at a school in the UK, and have recently been able to purchase an external Lacie DVD drive, as the school’s computer (currently an iBook G4 with OSX 10.3.2 and a 1GHZ Power PC Processor – 640 MB Memory and a 40 GB HD) wasn’t shipped with one – however, I have a problem…
    Trying to make a DVD that will play in a stand-alone DVD player – I followed the advice in iMovie Help – but was stopped suddenly on finding that I do not have the relevant version of iDVD (which version (if any – I can’t see it anywhere!) was shipped with iMovie 4.0?). Is it possible to download a copy of iDVD 3 or later from anywhere compatible with OSX 10.3.2 and iMovie 4.0?
    The iMovie Help has an additional option to ‘export your movie in a format appropriate for DVD authoring’ which has let me burn the movie as a (name).DV file – but this is not compatible with any DVD player I have tried. I noticed a while ago on this forum that someone was talking about Toast but I do not have this, but I do have Roxio Easy Media Creator 7, which was bundled with the burner – but is only compatible with a PC – would I be able to build a project in iMovie, transfer it to a PC, and use REMC7 to do what toast would?
    Finally, I was wondering if anyone has any experience of using Avid’s free DV software – and if they would recommend it (and also if I would be able to make DVDs with it?).
    Well thanks for reading if you got this far – and I’d appreciate it if you could offer any advice (I know I’ve not been very concise)…
    Kevin.
    iBook G4   Mac OS X (10.3.2)  

    Thanks for the welcome Karsten! I’ve checked the installer disks – which appear to have all the main pieces of software, but not iDVD. If you or anyone knows where it might be hidden that would be great. Thanks for all the other info too!
    Thanks Lennart – I don’t think my computer could support iLife ’05 as it is running Mac OSX 10.3.2 and I’ve just been looking at its system requirements which state it requires 10.3.4 minimum – if you know differently, please let me know. As an alternative I have considered getting iLife ’04, but your comment about iLife ’05 being the first version to support external drives worried me (“iDVD 5 is the first iDVD version that officially supports external burners“ does this mean there is an unofficial option for iLife ‘04? Perhaps a patch similar to the one mentioned by Karsten), does that mean iLife ’04 would not support an external Lacie DVD writer?
    What is the earliest version of Toast I’d be able to use (as a money saving option!)?
    Thank you both, and apoligies for my amateurish questions…
    Kevin.

  • I am trying to make a main menu for my project but I don't know where IDVD is located?

    I am trying to make a main menu but I read some info. and said I have to do it through IDVD and I tried it but can not find IDVD anywhere so I wanted to know if I have to purchase it or something and I also wanted to know how to create a main menu?

    depends on how old your Mac is ...
    newer machines do not come along with a pre-installed  iDVD (.. and iWeb ..) anymore; you have to purchase a boxed version of iLife11.
    if somehow iDVD is installed on your Mac, you should find it in your Apps-folder
    (or use Spotlight, search for iDVD) ...-

  • ? on How to Load Variable Within For Loop

    Hello,
    I'm a PL/SQL newbee so I apologize up front if this is a basic question. In summary, I'm trying to build a field name within a FOR LOOP and also load this field with it's associated data from an input record and finally load the data to the output record and pipe the row. I can successfully build the field name but don't know how to load it with data from the input record.
    Here is a sample from the code.
    The input table is shown with the 6 different Fnma codes. Instead of checking each code for data, I want to build the field name, load this field name with data from the input record and move the data to the output record.
    CURSOR cur_loan(prod_date_in IN DATE) IS
    Select
    Ln.Ln_No,
    Ln.Prod_Date,
    Ln.Ln_Fnma_Ftr1_Cd,
    Ln.Ln_Fnma_Ftr2_Cd,
    Ln.Ln_Fnma_Ftr3_Cd,
    Ln.Ln_Fnma_Ftr4_Cd,
    Ln.Ln_Fnma_Ftr5_Cd,
    Ln.Ln_Fnma_Ftr6_Cd,
    from LOAN Ln
    where PROD_DATE = '16-FEB-11';
    Here is the FOR LOOP that successfully builds the field name in l_feat_code_name. Then I "assume" by moving this field to l_output that l_output will contain the actual data, not the field name. However, it appears to contain the field name instead of the data.
    FOR l_To IN 1 .. 6
    LOOP
    l_feat_code_name := ('l_loan_rec.ln_fnma_ftr'||l_to||'_cd');
    l_output := l_feat_code_name;
    IF (l_output is not null or
    l_output <> ' ') THEN
    l_out_rec.Inv_Type := l_Fnma_Cd;
    l_out_rec.feat_code := l_output;
    l_out_rec.Src_Delete_Flag := l_src_delete_flag_n;
    PIPE ROW(l_svc_ln_rec);
    END IF;
    END LOOP;
    How can I move the data itself into the l_out_rec.feat_code output record? Thanks in advance.

    Hi,
    l_output is defined as follows:
    l_output varchar2(20) ;
    I appreciate your example.
    Again, after I build l_feat_code_name it contains the column name from the input record, Ln_Fnma_Ftr1_Cd, ....Ftr2...., .....Ftr3..... and so on up to Ftr6. However, I also need the **data value** of Ln_Fnma_Ftr1_Cd, ....Ftr2...., .....Ftr3..... and so on up to Ftr6. My question is how to get the data value. You see below when I move l_feat_code_name to l_output I'm expecting l_output to contain the **data value**. Instead, when I display it in DBMS_output, it shows the column name.
    CURSOR cur_loan(prod_date_in IN DATE) IS
    Select
    Ln.Ln_No,
    Ln.Prod_Date,
    Ln.Ln_Fnma_Ftr1_Cd,
    Ln.Ln_Fnma_Ftr2_Cd,
    Ln.Ln_Fnma_Ftr3_Cd,
    Ln.Ln_Fnma_Ftr4_Cd,
    Ln.Ln_Fnma_Ftr5_Cd,
    Ln.Ln_Fnma_Ftr6_Cd,
    from LOAN Ln
    where PROD_DATE = '16-FEB-11';
    Here is the FOR LOOP that successfully builds the field name in l_feat_code_name. Then I "assume" by moving this field to l_output that l_output will contain the actual data, not the field name. However, it appears to contain the field name instead of the data.
    FOR l_To IN 1 .. 6
    LOOP
    l_feat_code_name := ('l_loan_rec.ln_fnma_ftr'||l_to||'_cd');
    l_output := l_feat_code_name;
    IF (l_output is not null or
    l_output ' ') THEN
    l_out_rec.Inv_Type := l_Fnma_Cd;
    l_out_rec.feat_code := l_output;
    l_out_rec.Src_Delete_Flag := l_src_delete_flag_n;
    PIPE ROW(l_svc_ln_rec);
    END IF;
    END LOOP;

  • Trying to make a button with a drop zone

    Since I can't find any of the template buttons that look the way I want, I want to make a simple button that includes a drop zone for an asset, a label, and a highlight. I am trying to make a chapter index menu. I can do it using the automated method and using a customized template - but I cannot find buttons that look the way I want. All I want is a simple rectangle, with the label underneath, and a highlight line under the label. There is one like that in which the asset is black and white (RectRoundEdgesBlue.pox), but I want one that is in color. Is there any way to do this?? I have studied some of the Photoshop tutorials, but I am missing how you put a drop zone in.

    Hi,
    Below is the AS3 code to navigate to adobe.com upon button(whose instance name is 'myButton') click
    myButton.addEventListener(MouseEvent.CLICK, gotoPageFunction);
    function gotoPageFunction(event: MouseEvent) {
    var request:URLRequest = new URLRequest("http://www.adobe.com");
    navigateToURL(request, '_blank');
    Thanks!
    ps: please mark this post as Answered if this is of help to you

Maybe you are looking for

  • Error while executing FSG under R12.0.4

    Dear All, I have installed Oracle APPS R12.0.4 on Windows 2003 Server with Visual Studio 2008 and cygwin. When i run a FSG(Reports) i get the error. When i check the log i get the following error: (Extract of the Log File is given below) e:\oracle\VI

  • Change logs for Cost Center

    Hi Friends Can any one help me how to get Changes made to Cost Center????.. Infact, in one Cost Center, prices for activity type has been changed. Because of that we could find difference of actual costs recorded. Later on corrected to original one. 

  • Mounting drives on the desktop for all users

    Hi Is there a way of mounting drives ( like USB pens) on the desktop for all users please? It's a causing a lot of confusion here... you think the USB drives aren't working when you can't see them being mounted in front of you. I do realise you can s

  • WWSAPI - Cannot connect to web service via SSL and HTTP proxy authentication with NTLM, errorCode 0x803d0016, HTTP status 407

    Hi, I built a web service client using WWSAPI. The connection works via SSL (without HTTP proxy) and it works with SSL and proxy with basic authentication as well. When I try to connect using a proxy with NTLM authentication, then I get the errorCode

  • Can anyone explain this icon

    Can anyone help me identify the icon on the lower two entries in my workgroup manager, they are augmented records but i can't work out what it means and can't find anything in white papers please see the image shared on mobile me below https://files.