Addchild in loop, how to recover X and Y of a specific spawned mc

Hi everyone,
I'm currently trying to program a little tile based game and i have a problem :
I use a double array for placing tiles, with ~240 addchild, when i click on one tile i want the program to save the position of this tile
So this is the concerned part of the code :
function boucleCell3(mapcalque3): void {
       var compteur = 0
       for (var i: int = 0; i < mapHeight; i++) {
            for (var j: int = 0; j < mapWidth; j++) {
                 var cell: MovieClip = new calque3();
                 cell.gotoAndStop(mapcalque3[i][j] + 1);
                 if (i % 2 == 1) {
                      cell.x = tileSide * j - tileSide / 2 - 60;
                      cell.y = (tileSide / 4) * i - 50;
               else {
                      cell.x = tileSide * j - 60;
                      cell.y = (tileSide / 4) * i - 50;
             //cell.name = compteur;
            cell.addEventListener(MouseEvent.CLICK, savePos);
            //trace(name)
            addChild(cell);
            //compteur +=1
            //trace(compteur)
  function savePos(e: MouseEvent): void {
  posXsouris.text= String(cell.x);
  posYsouris.text= String(cell.y);
At first i wanted to simply name every child by "case" + String(compteur), but i realise i can't because trace(name) only return "root1".
Then i tried to use mouse position like this : " If 40<mouse.x<120 and 30<mouse.y<60 but there is 240 tile so i don't really know. (and if the game isn't in fullscreen, everything is fked)
In fact i wanted to have a name for every tile so i can use the tile position like this "spawnCharacter.position = tile54.position" (i don't think .position exist, so it will be spawnCharacter.x = tile54.x ....)
Thanks for reading and even more if you have an idea or a part of solution.

Yeap
But there is still something i don't understand in AS3, you arlready tried to explain me but it's still weird
why the code doesn't wait for execute ?
Why a code like this doesn't work :
var result: int = 0
fonction simpleFonction(){
random calcul / for/if/else
result = 7
simpleFonction()
trace(result)
And we have result = 0
I have the same problem with my code so i tried a new code and to use a while but it seem to be an infinite loop and adobe flash pro crash
var compteur = 0
  function onLoaded3(e: Event): void {
       var maptext: String = e.target.data;
       mapcalque3 = maptext.split("\r\n");
       for (var u: int = 0; u < mapcalque3.lenght; u++) {
            mapcalque3[u] = mapcalque3[u].split(" ");
       for (var i: int = 0; i < mapHeight; i++) {
            for (var j: int = 0; j < mapWidth; j++) {
            var cell: MovieClip = new calque3();
            cell.gotoAndStop(mapcalque3[i][j] + 1);
            if (i % 2 == 1) {
                 cell.x = tileSide * j - tileSide / 2 - 60;
                 cell.y = (tileSide / 4) * i - 50;
            } else {
            cell.x = tileSide * j - 60;
            cell.y = (tileSide / 4) * i - 50;
            cell.name = "case" + String(compteur);
            trace(cell.name);
            addChild(cell);
            listeCase[compteur] = this.getChildByName(cell.name)
            compteur += 1
            trace(compteur);
while (compteur =! 0) { // compteur = 0 here
  mapLoader3.load(new URLRequest("mapcalque3.txt"));
// compteur = 239 here so the loop should be finished not infinite
trace(7+7)

Similar Messages

  • How to recover SMS and phone contact information a...

    How to recover SMS and phone contact information after *#7370# reset of Nokia E71?
    No backup was available.
    Thanks.

    Actually, both the SMS and the phone numbers were gone. I thought that *#7370# was a soft reset without data loss, yet I lost all SMS and phone numbers as said. I did the soft reset because the Nokia E71 was stuck after the PIN password sometimes and I had to try several times to enter. It is a new phone with just a few days of use.
    Anyway, I am most interested on recovering the SMS data if that is possible. I was thinking on something like this:
    How to recover a deleted SMS
    http://www.dekart.com/howto/howto_sim_reader/how_to_recover_a_deleted_sms
    So, the question seems to be: does *#7370# on the Nokia E71 deletes the SMS data, or does it only mark them as deleted? It the latter, it should be possible to recover them. And then, how?
    Thanks again.

  • How to Recover Contacts and Text message from iPhone 6/6 Plus

    I am asking for help to recover my iPhone Contacts and Text Message,my iPhone jailbreak failed by myself.lead to my iPhone data was lost,I want to get back my contacts and text message.it is very important for me to recover them.Whether have you any method to help me to regain my contacts and text message from my iPhone device.thank you
    Best regards
    SimileSky

    selenafromshenzhen wrote:
    If you have backed up your iPhone before the jailbreaking, then you can recover contacts and text messages by restoring your iPhone with the iTunes or iCloud backup file. Read the guides: iCloud: Restore or set up your iOS device from iCloud & Use iTunes to restore your iOS device to factory settings - Apple Support
    i tried to update with new iOS, in between strucked my iphone, after that there is no data in my phone,
    can you help me how can i retrive it, Also i dont have backup (itunes / icluod)
    is there any possibilities to recover those my datas.
    Any softwares are available ???
    iPhone 6

  • How to recover contacts and messages after restoring?

    I plan on restoring my iPhone and I want to know how to recover my contacts and messages before doing so. Can you tell me the step-by-step process on recovering my contacts and messages before I restore? Thanks for all your answers.

    selenafromshenzhen wrote:
    If you have backed up your iPhone before the jailbreaking, then you can recover contacts and text messages by restoring your iPhone with the iTunes or iCloud backup file. Read the guides: iCloud: Restore or set up your iOS device from iCloud & Use iTunes to restore your iOS device to factory settings - Apple Support
    i tried to update with new iOS, in between strucked my iphone, after that there is no data in my phone,
    can you help me how can i retrive it, Also i dont have backup (itunes / icluod)
    is there any possibilities to recover those my datas.
    Any softwares are available ???
    iPhone 6

  • How to recover Mail and Mail Downloads when you can't use Migration Assistant

    I have a MacBook 2.4gHz that had a 750GB HD that crashed yesterday. Disk Utility said "This Hard Drive has failed, recover or backup what you can, then reformat." So, I removed the 750GB HD and replaced the original 160GB HD and reinstalled OS 10.7 on that Drive. I put the 750GB HD in an external case and hooked it up by USB (only available hookup with my external case). I can see all my content and tried to use Migration Assistant, but it hangs up at "preparing content to transfer." So, I decided I would have to drag all the old content onto my new user on the internal HD. I moved Movies, Pictures, Desktop, Documents, Music, and Downloads. However, I can't move any of the parts of the hidden User Library, primarily because I can't find or see it.
    My question is how to access the User Library in a non-bootable (although having OS 10.7 installed) External HD. I've tried the ~/Library/ in Go>Go to Folder, but it goes to the running HD User folder, not the external. Can anyone tell me how to crack into this folder? I'd like to retrieve preferences, mailboxes, address book, etc.
    I realize it could be lost, but literally everything else is still present. FYI: I plan to hang onto the 750 until the replacement HD arrives, so I can be reminded what Applications I had installed. There isn't room for all of those on the smaller HD.
    Thanks,
    Ronda

    Update: I managed to get Migration Assistant to move something, but it didn't work out as I expected. Because I've already installed the OS and some applications that I need, as well as copying over most of the user files except the library, there wasn't much room left on the smaller disk. I purchased the firewire 9pin to 6pin cable that would allow me to use the firewire port on the external drive and selected the main user. There wasn't enough room to move all of the user, so I selected only the "Other Files" folder (about 2 GB), not all the items I had already copied. I set that to install last night at 9:32pm. At 4:00am it said there was still 10 hrs and 29 minutes to go. My husband checked it at 6:45am and it said 19 more minutes. When he arrived home at 4:30pm, it was finished. When I arrived home and logged out of the administrator and in to the main user, immediately it showed my desktop with all the folders that I had placed in the sidebar of the Finder window and everything looked exactly like it had on Monday before the crash, then the beachball started spinning and when it finally came up for air, all those folders were gone, my dock appearance was gone and everything was back to the bland new user settings that Mac OS starts with.
    My mail file did get moved over with its thousands of messages, but not mail uploads nor the desktop appearance settings and it doesn't appear that any other settings have migrated either. It's difficult to tell, since I can't install my applications on the smaller drive.
    The replacement drive from WD arrived, but it is a 2TB "upgrade" and it doesn't even fit in my MacBook, so I have to send that back and wait longer.
    I'm still trying to recover my appearance, and combine the various users into one. If anyone has suggestions on how to get the mail uploads folder, preferences, etc. I'd love to hear them.

  • How to recover passwords, and favorites from Windows.old

    I had to install Windows 7 over Windows 7 due to an error I had. I need to recover my passwords/favorites in some way or another. The reason I had this put under Sync is because I had my computer synced to my phone.
    First off is it possible to recover the data from the Windows.old file? (Any way how to)
    -Ive tried the way I found on google that did not work.
    Secondly, when I am in the process of syncing to my phone it gives 3 options on the advanced options, I obviously hit the "Replace all data on this computer with my Sync data".
    It says I have 88 bookmarks, but it says that they are on the computer. So that obviously means that they should be able to be recovered without syncing. How would I go about recovering them without replacing everything on my computer with my phone.
    Third off, if it is possible to recover my passwords from the Windows.old then please let me know. Thats the most important thing to me.

    Hello! It would be nice to have a migration script in Bridge too...
    In the past, there were folders you could copy, but given the database changes, I'm not sure, I need to check first with the team.
    On a Mac, it is in the collections folders in ~Library/ApplicationSupport/Adobe/Bridge CS5/Collections/
    PC(XP): C:Documents and Settings\user\Application Data\Adobe\Bridge CS5\collections
    VIsta/7: user/app data/roaming/Adobe/Bridge CS5/Collections
    Hope this helps

  • How to recover data and log

    Hello, everyone
    I re-installed my windows XP due to virus with the maxdb data and log files left. After that I reinstalled maxdb 7.6 again. How can I recover the db with the existed data and log ? I did not backup the db. I can not figure out a way. Please help me.
    Chu

    Hi Chu,
    creating a MaxDB instance from the data- and logvolumes is not difficult, but some requirements have to be fullfilled:
    - you still have the parameter file left
    - you still know the password of the database manager operator (DBM in OpenSource or CONTROL for SAP instances)
    That given, all you've to do is to re-register the database, via the db_create command:
    dbmcli -R "
    So, let's go for an example.
    I've a database called DB77, the dbm operator is called control, password is also control.
    I'll drop the database but keep the files (just like you have it ... hopefully) and re-register the database afterwards:
    >dbmcli db_enum
    OK
    DB77    C:sapdbdb77db                        7.7.02.16       fast    offline
    DB77    C:sapdbdb77db                        7.7.02.16       slow    offline
    >dir c:sapdbdataconfig
    Datenträger in Laufwerk C: ist Boot
    Volumeseriennummer: 08C7-EC59
    Verzeichnis von c:sapdbdataconfig
    24.03.2008  13:37    <DIR>          .
    24.03.2008  13:37    <DIR>          ..
    25.10.2007  14:11            12.739 .M770216
    25.10.2007  14:11            97.900 .M770216.pah
    25.10.2007  14:11             1.536 .M770216.upc
    14.02.2008  02:21            20.579 .M770323
    14.02.2008  02:21           201.850 .M770323.pah
    14.02.2008  02:21             1.536 .M770323.upc
    14.03.2008  02:23            20.795 .UMDB
    14.02.2008  02:24            20.795 .UMDB.01
    25.10.2007  14:24            20.795 .UMDB.02
    14.03.2008  02:23                26 .UMDB.cfg
    14.02.2008  02:24           207.625 .UMDB.pah
    25.10.2007  14:24             2.048 .UMDB.upc
    14.03.2008  09:23            13.405 DB77  
    13.03.2008  23:51            13.405 DB77.01
    11.03.2008  20:10            13.405 DB77.02
    14.02.2008  02:21            13.405 DB77.03
    14.02.2008  02:17            13.405 DB77.04
    24.01.2008  19:06            13.405 DB77.05
    11.01.2008  18:57            13.405 DB77.06
    31.12.2007  01:40            13.405 DB77.07
    26.12.2007  14:40            13.404 DB77.08
    26.12.2007  14:20            13.181 DB77.09
    26.12.2007  14:01            13.181 DB77.10
    14.03.2008  09:23                75 DB77.cfg
    02.12.2007  18:24               648 DB77.mmm
    11.03.2008  20:16           343.475 DB77.pah
    24.03.2008  13:37             2.048 DB77.upc
    14.02.2008  02:20    <DIR>          install
                  27 Datei(en)      1.101.476 Bytes
                   3 Verzeichnis(se), 20.064.083.968 Bytes frei
    Ok, the database is currently correctly registered and the parameter file is present. Now let's drop the database:
    >dbmcli -d db77 -u control,control db_drop withoutfiles
    OK
    >dir c:sapdbdataconfig
    Datenträger in Laufwerk C: ist Boot
    Volumeseriennummer: 08C7-EC59
    Verzeichnis von c:sapdbdataconfig
    24.03.2008  13:37    <DIR>          .
    24.03.2008  13:37    <DIR>          ..
    25.10.2007  14:11            12.739 .M770216
    25.10.2007  14:11            97.900 .M770216.pah
    25.10.2007  14:11             1.536 .M770216.upc
    14.02.2008  02:21            20.579 .M770323
    14.02.2008  02:21           201.850 .M770323.pah
    14.02.2008  02:21             1.536 .M770323.upc
    14.03.2008  02:23            20.795 .UMDB
    14.02.2008  02:24            20.795 .UMDB.01
    25.10.2007  14:24            20.795 .UMDB.02
    14.03.2008  02:23                26 .UMDB.cfg
    14.02.2008  02:24           207.625 .UMDB.pah
    25.10.2007  14:24             2.048 .UMDB.upc
    14.03.2008  09:23            13.405 DB77
    13.03.2008  23:51            13.405 DB77.01
    11.03.2008  20:10            13.405 DB77.02
    14.02.2008  02:21            13.405 DB77.03
    14.02.2008  02:17            13.405 DB77.04
    24.01.2008  19:06            13.405 DB77.05
    11.01.2008  18:57            13.405 DB77.06
    31.12.2007  01:40            13.405 DB77.07
    26.12.2007  14:40            13.404 DB77.08
    26.12.2007  14:20            13.181 DB77.09
    26.12.2007  14:01            13.181 DB77.10
    14.03.2008  09:23                75 DB77.cfg
    02.12.2007  18:24               648 DB77.mmm
    11.03.2008  20:16           343.475 DB77.pah
    24.03.2008  13:37             2.048 DB77.upc
    14.02.2008  02:20    <DIR>          install
                  27 Datei(en)      1.101.476 Bytes
                   3 Verzeichnis(se), 20.064.083.968 Bytes frei
    >dbmcli db_enum
    OK
    As we see, the database is gone - but  due to the withoutfiles flag all files are left in place. Therefore we can reregister the database rightaway:
    >dbmcli -R C:sapdbdb77db db_create DB77 control,control
    OK
    >dbmcli db_enum
    OK
    DB77    C:sapdbdb77db                        7.7.02.16       fast    offline
    DB77    C:sapdbdb77db                        7.7.02.16       slow    offline
    >dir c:sapdbdataconfig
    Datenträger in Laufwerk C: ist Boot
    Volumeseriennummer: 08C7-EC59
    Verzeichnis von c:sapdbdataconfig
    24.03.2008  13:42    <DIR>          .
    24.03.2008  13:42    <DIR>          ..
    25.10.2007  14:11            12.739 .M770216
    25.10.2007  14:11            97.900 .M770216.pah
    25.10.2007  14:11             1.536 .M770216.upc
    14.02.2008  02:21            20.579 .M770323
    14.02.2008  02:21           201.850 .M770323.pah
    14.02.2008  02:21             1.536 .M770323.upc
    14.03.2008  02:23            20.795 .UMDB
    14.02.2008  02:24            20.795 .UMDB.01
    25.10.2007  14:24            20.795 .UMDB.02
    14.03.2008  02:23                26 .UMDB.cfg
    14.02.2008  02:24           207.625 .UMDB.pah
    25.10.2007  14:24             2.048 .UMDB.upc
    14.03.2008  09:23            13.405 DB77
    13.03.2008  23:51            13.405 DB77.01
    11.03.2008  20:10            13.405 DB77.02
    14.02.2008  02:21            13.405 DB77.03
    14.02.2008  02:17            13.405 DB77.04
    24.01.2008  19:06            13.405 DB77.05
    11.01.2008  18:57            13.405 DB77.06
    31.12.2007  01:40            13.405 DB77.07
    26.12.2007  14:40            13.404 DB77.08
    26.12.2007  14:20            13.181 DB77.09
    26.12.2007  14:01            13.181 DB77.10
    14.03.2008  09:23                75 DB77.cfg
    02.12.2007  18:24               648 DB77.mmm
    11.03.2008  20:16           343.475 DB77.pah
    24.03.2008  13:42             2.048 DB77.upc
    14.02.2008  02:20    <DIR>          install
                  27 Datei(en)      1.101.476 Bytes
                   3 Verzeichnis(se), 20.064.083.968 Bytes frei
    >dbmcli -d db77 -u control,control db_online
    OK
    Database reregistered, all files are OK, database online. We're done.
    Anyhow, you should in any case perform a backup before you reinstall your machine the next time. I don't know if you've still got all the files I mentioned, but if not - it's not possible to get your database back easily - if at all.
    Hope that helps,
    Lars

  • My Vista system crashed due to a corrupted windows file. When I reformatted C:/ & reloaded firefox & tbird, my bookmarks were gone. I have an image of the drive , but I don't know how to recover them and get the data back where I can access it.

    Vista system crashed due to a corrupted system file. The C drive was reformatted, and windows reloaded, along with the rest of my programs.
    Before the drive was reformatted, an image was made of it on a USB drive to save all the data. Now I need to know how to get the Bookmarks back for Firefox, and the Address Book back for Thunderbird.
    Thanks

    Thanks for the quick response. It worked very well, for both Firefox and Tbird.
    One hitch, until I remembered: those are all hidden files, in hidden folders. I had a devil of a time finding the "roaming" folder, until I found out how to unhide everything. In years past, I used DOS for that kind of thing. Explorer is much less user-friendly. Now that I know how to do it, it's simple.
    Thanks again for the guidance

  • How to recover data and system in MacBook Pro?

    I have a MacBook Pro. I have now problem about booting the system. The GRAY logo comes with blinking by a "Stop" logo and the system can not open. When I use the Mac Installation DVD (Snow Leopard) all my data goes to be erased after installing a fresh one.
    Shall I recover my Mac?
    If I couldn't recover and was forced to install a fresh OS, is it possible to recover data after having the fresh installation?
    Thank you
    Diako

    diakomacdiako wrote:
    If I couldn't recover and was forced to install a fresh OS, is it possible to recover data after having the fresh installation?
    Not much, but you can install OS X on a extenral drive, boot from it and recover files, then do the erase and install.
    Create a data recovery/undelete external boot drive

  • How to recover tabs and bookmarks and settings from hard drive after computer dies?

    computer's motherboard died, and I am going to move all the browsing info to a new computer.
    When my computer died I had 20 something tabs open and I haven't saved them to bookmark yet and I need to get them back, along with the whole histories too.
    I also used to be able to recover the bookmarks but I haven't done it for a while and maybe firefox 4.0 does it differently this time?

    See:
    * https://support.mozilla.com/kb/Recovering+important+data+from+an+old+profile
    * http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

  • After reinstalling Elements 8 how to recover tags and catalogues?

    Had to reinstal
    Elements  8 and resynched names in Albums but it did not restore any of the many tags that I had.  Of course none of the picture thumbnails were restored but I do have a set of disks from a Catalogue save from last year.  What sequence should I use to attempt to have Elements 8 recognize my images, which, fortunately, were on an external hard drive and are intact?

    Yes, I had to reformat the hard drive.  I had backed up my catalog  about a
    year ago and decided to restore it.  The restoration went OK  although it
    was not currant for the last year but at least I salvaged a  lot.
    During the restoration, I was required to make a choice as to restore to 
    the original location or to a new one.  I chose the latter not knowing if  it
    meant overwriting the original image files themselves.  Do you know what 
    the consequences would have been had I chosen to restore to the "original" 
    site?
    Thank you,
    Jay

  • How to recover photos and contacts from iPhone?

    Is there any possibilities to recover data from iPhone runnig any version of ios

    Use third party software to extract from your Device backup folder:
    iPhone Backup Extractor, you can download a free version with limited capability or a paid Registered version:
    http://www.iphonebackupextractor.com/
    Location of your backup folder
    Win7 - C:\Users\<username>\AppData\Roaming\Apple Computer\Mobile Sync\Backup

  • HT1751 how to recover music and photos to my new iphone 5

    I just purchased a new iphone 5 but can not get the photos, apps and music synched from my iphone 3?

    Everything should be on your computer.
    Sync it from the computer to your iphone just as you did from the original.

  • On an iMac backing up with Time Capsule -- several Firefox windows open w/tabs -- Firefox froze -- had to force quit. In the past the various windows and tabs reappeared on restarted Firefox. Not this time. How to recover windows and tabs.?

    I think what I have written (above) sums up my problem. I can't think of anything to add.

    When a new bookmark is added to one "device", Sync immediately sends that change to the Sync Server. And if you are watching a different "device" you should see the newly saved bookmark almost immediately. ''At least I have seen it happen that fast when Syncing between two Profiles on my desktop PC and I had both Profiles running and Tiled vertically, with the Bookmarks Sidebar open.''
    Keep in mind that internet congestion and Sync Serve load may slow then seemingly "immediate" action down a bit.
    As far as '''Tab''' Sync goes, open Tabs are Sync'd to the Server as Firefox is closed. I'm not sure, but I believe '''Tab History''' is Sync'd to the Server as each tab is closed.
    I'm not sure if a complete Tab History is Sync'd to a tablet device, or if like on a mobile phone the last 25 or so URL's are sync'd as "history" to the mobile device.
    Sorry, I can't advise you on whether to purge your data or to create another Sync account, I have never used those features. I am surprised that you don't have another email account to use to set up a 2nd account; it isn't that hard to create another email account at Gmail.

  • How to recover Equium A100-147 without Toshiba specific software

    Hi
    I've just formatted my laptop to get rip of all the dross but want to start with a Windows XP without the Toshiba fancy network stuf (configfree etc).
    The techies at work are always moaning that they aren't familiar with it and I can never follow the standard instructions for Windows because the Toshiba Recovery bins the standard Windows functions in favour of the Tosh ones.
    Is it possible to recover my Laptop with the necessary drivers for all the bits (eg WiFi, mousepad, sound etc) without all of the other dross?
    John

    Hi
    At first I have to say that a Toshiba Recovery DVD or CD contains an image file.
    This image files is a package and it contains the OS, Toshiba driver, tools and additional software like ConfigFree ;)
    So if you use the Toshiba Recovery CD and recover the notebook then all these software parts will be installed on the HDD and you cannot choose what should be installed or what is not needed
    You can remove the software which is not important for you after the recovery procedure.
    At the other hand you could also install the OS using the clean Windows OS and then you could download and could install the Toshiba drivers.
    Bye

Maybe you are looking for

  • Solaris 10 Install CD Not Found...

    Hello, i'm trying to evaluate solaris 10 11/06. I'm using a Tyan Tiger K8SSA (S3870G2NR-RS) motherboard, and an Areca ARC1110 SATA2 PCI-X 4-Port RAID Controller. I have... 1 sata drive plugged into the onboard sata controller 3 hard drives plugged in

  • Can I copy part of a PDF from iBooks?

    I emailed a PDF to my iPad. Then opened it in iBooks. Now I want to copy part or all of the document into a Pages document. I can't find a way to get a Select or Copy menu to come up. I've tried tapping, double tapping, and holding my finger on the p

  • RFC Sender registration is lost after a while

    Hi Experts, I'm facing a strange problem with the RFC Sender adapter. Everything is well configured, and communications works well. But... If I do not use the communication channel for a while, the program registration in backend system is lost. It d

  • Cannot switch between WPA2 and WPA Enterprise locations.

    Hello Everyone, I have two Wifi locations I use, a WPA2 and a WPA Enterprise. When I switch locations from one to the other it seems that the Airport express seems to reset but does not let go of the active location. I have to manually turn airport o

  • Data Slice

    I have a planning layout with a function which has attribute "Execute Function before Layout Display". I want to be able to VIEW the data even if it is locked by a Data Slice. When you try to access the layout the function gets executed first. This c