Moving from C (not C++) to AS3

I'm moving some of my older C code (see below) to AS3, and
have a couple of areas which I am researching how to convert, and
wonder if anyone can assist?
To give some context to the code below, "appearances" are
when actors (game objects) are introduced into a game level, and an
appearance is defined by an actor number, plus an X and Y position.
A game level can be a title screen, the main game, game-over
screen etc.
For each level in the array levelAppearancesInfo, there is a
pointer to another array containing details of the actual
appearances, plus the number of appearances in that level.
So in a nutshell, I'm looking to find out how to convert to
AS3, from C, the following:
(1) arrays of structs
(2) an array containing a pointer to another array
I do know that references will be replacing the pointers, and
that classes will take the place of structs.
I'm working on this right now, and any insights would be most
appreciated.
The original C code is below that I wish to convert to AS3:

With my second question, it seems that something like:
var array1:Array = new Array(1, 2, 3, 4, 5);
var array2:Array = new Array(6, 7, 8);
var array3:Array = [array1, array1.length, array2,
array2.length];
is on the way towards a solution, but I wonder if there is
anything more elegant.
I could even split it into two parallel arrays - one array
containing references to the arrays, and another array containing
their lengths.
If anybody has any advice regarding my two questions in the
first post, any help would still be most appreciated.

Similar Messages

  • Form button does not work when a program is moved from Windows 8.2 to Windows 7

    Hi,
    I have a few Excel programs which use the ODBC to get data from Access and which have macros which writes data to an external program, MYOB.
    When the macros tries to write the data to MYOB it fails if I am not running the program in administrator mode.   It seems that Windows 8.2 has a different level of security than Windows 7 and must be run in administrator mode for the ODBC to work. 
    I have had issues after running the program in administrator mode (testing) if I simply do a save (in administrator mode) and then send it to the customer.   The issue is that it just will not work on the customer's site.   I have gotten
    around this in the past by saving any changes, going back out of excel, loading the program again (not in administrator mode) and saving it - before sending it to the customer.   This worked until now.
    For some unknown reason, the last time I sent a program to the customer and carried out the above process, the program stopped working.   Originally I thought that the macro just wouldn't work on windows 7, but eventually found that it is the form button
    that will no longer work when the program is moved from 8.2 to 7.
    Does anyone know why there is an incompatibility between 8.2 and Windows 7 and what I should be doing to ensure that my programs work in my customers environment(windows7)?
    In the meanwhile, I have changed the form button to an activex button and the program works fine in both environments.
    Thanking you in advance,

    there is some OP report after Windows update Dec 2014 macro stop responding ( I cant confirm if this is also related to your issue) its because security update for Office maybe conflict with the active-x that you are installed
    try to
    Close Excel
    Start Windows Explorer.
    Select your system drive (usually C:)
    Use the Search box to search for *.exd
    Delete all the files it finds.
    Start Excel again
    Open that file and save it, and try open at Windows 7
    to get more detail about this issue, I suggest also contact Office forum
    this case also will be solve installing kb3025036
    good luck

  • HT4101 Once pictures are moved from your camera to your iPad (using the camera connection kit), how do you get the photos off of the iPad? They do not show up in my photo stream or my iCloud.

    Once pictures are moved from your camera to your iPad (using the camera connection kit), how do you get the photos off of the iPad? They do not show up in my photo stream or my iCloud. I am able to see any photo I took on the iPad using the iPad camera (in iTunes, photo stream, or when I open windows explorer and browse the iPad director), however I cannot see any photos transfered from my camera to the iPad. The camera connection kit must have put my photos in a directory I cannot get to and cannot sync.

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • Mac desktop. 10.6.8. Text edit. Not locked. Read and write. Still, documents are locking when they are moved from desktop to another folder on the server. Techies can't figure it out here. What am I not doing?

    Mac desktop. 10.6.8. Text edit. Not locked. Read and write, not read only. Documents are locking when they are moved from desktop to another folder or saved directly into that folder on the server. Not happening with anyone else but me and the boss's computer so has to be in the properties for my text edit software. Techies can't figure it out after trying for two weeks. Boss can do a cut and paste and put into a new document, but that's starting to become a problem.

    Mac desktop. 10.6.8. Text edit. Not locked. Read and write, not read only. Documents are locking when they are moved from desktop to another folder or saved directly into that folder on the server. Not happening with anyone else but me and the boss's computer so has to be in the properties for my text edit software. Techies can't figure it out after trying for two weeks. Boss can do a cut and paste and put into a new document, but that's starting to become a problem.

  • I have moved from the US to Norway, and want to change my apple ID to the Norwegian appstore. However, I am not allowed ot change from the US store before I use up my balance, which is 0.17 dollar. The problem is that nothing costs 0.17 dollar.Please help

    I have moved from the US to Norway, and want to change my apple ID to the Norwegian appstore. However, I am not allowed ot change from the US store before I use up my balance, which is 0.17 dollar. The problem is that nothing costs 0.17 dollar and I do no longer have an american visa card, only Norwegian. Is there any way I can erase the credit on my account so I can change the appstore country? Or osmething I can use this credit on? Thank you very much

    Try contacting the store support staff at: http://www.apple.com/emea/support/itunes/contact.html they are usually pretty good at sorting out these issues.

  • After moving from Canada to the US, getting a new iPhone 5C, and restoring my backup from iCloud, I can't update my apps. I get an error message that my account is not valid in the Canadian App store and I must change to the US store. How do I do that?

    After moving from Canada to the US, getting a new iPhone 5C, and restoring my backup from iCloud, I can't update my apps. I get an error message that my account is not valid in the Canadian App store and I must change to the US store. How do I do that?

    Change here:
    Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
    You must have a verified billing address & be located in the country whose store you are trying to use.

  • HT1766 i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5 but the apps do not appear to have come across, have I done something wrong?  Please can someone tell me how to move my apps

    i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5, but the apps do not appear to have come across.  Have I done something wrong?  Please can someone tell me how to move my apps across?

    After you Restore from backup, sync the iPhone.

  • I moved from the UK to Sweden. My trial expired in the UK but I was not able to purchase CC in Sweden for some reason. I was told to create a new account in Sweden with a new Adobe ID. When I did, the trial downloads did not work and I could not purchase

    I moved from the UK to Sweden. My trial expired in the UK but I was not able to purchase CC in Sweden for some reason. I was told to create a new account in Sweden with a new Adobe ID. When I did, the trial downloads did not work and I could not purchase the CC at discount price.

    Moving this discussion to the Adobe Creative Cloud forum.
    Kriskristferson if you are facing difficulties with your order then please contact our support team directly at Contact Customer Care.

  • Proxy settings moved from User to Machine not removing user settings.

    Hi All,
    I have recently moved our company's proxy settings from User based to Machine based as we were having issues after moving from an internal proxy to a hosted external proxy.  What we found was after turning off the internal some users were no longer
    getting external internet. 
    After some investigation we found they were still getting old proxy settings on login and after a GPupdate.exe or normal gpupdate from the server the correct settings would apply. (happened to users logging on for the 1st time) To prevent this from happening
    I moved the proxy settings to the Computer GPO and it all appeared to work in the test GPO and in live.  But a few days later we got some calls logged to our help desk stating they don't get external internet.  After some more
    investigation we found that they are still getting the user policy applied to them even though it has all been removed from the User GPO. 
    I found if I remove the proxy settings it doesn't always apply to users but if I add info in it always updates to the user.  What can be causing this?  Some of these users have local admin rights and I thought at first it might be something they
    did but now we are getting non admin users with these issues.
    We are using IE 10 and have set the original Proxy settings using the GUI internet control panel and are now applying the proxy settings via Registry updates in the Computer GPO and enabled "Make Proxy settings per-machine" object.  Our SOE
    is Win 7 ent x64 with IE 10 (1500 units) and Win 8.1 ent x64 IE11 (100 units) And some XP SP3 that are in the process of migrating to Win7.
    Any help on this would be much appreciated.
    Cheers,
    Nat

    Hi Nat,
    you wrote: I found if I remove the proxy settings it doesn't always apply to users but if I add info in it always updates to the user. 
    Does that also happen für new users now after you changed your settings to the computer settings?
    I guess you used group policy preferences; that worked as "one time settings", so as long as the policy exists it will be merged with the Settings on the users computer. Please find a detailed description on
    http://technet.microsoft.com/en-us/library/dn581922.aspx
    So you now have 2 configuration items: your policy as well as the users registry. So to remove that you already moved the Settings from the user configuration to your Computers configuration (that worked as you described) while the Settings
    in their HKCU are still there - you Need to either implement another  policy to remove that, or you can set it empty.
    Don't set it to "not configured" as that will keep your old setting deployed before.
    Sometimes I found in more easy to implement another user preference that removed the Registry key with the Registry keys to remove a Setting instead of Publishing a "remove Setting" configuration.
    Regards,
    Martin

  • After moving from my home country (Poland) to the Middle East (UAE) with the same computer I can not get connected to Apple Store and iTunes Store.

    After moving from my home country (Poland) to the Middle East (UAE) with the same computer I can not get connected to Apple Store and iTunes Store. Any clue why?
    Regards,
    Maciek

    Click the round flag icon bottom right corner of the App Store window.

  • I have moved from the UK to New Zealand and Itunes will not accept my new Zealand bank details, as a result nothing will work on my phone and I cant access emails!

    I have moved from the UK to New Zealand and Itunes will not accept my new Zealand bank details, I am trying to change my details on the Iphone 4s

    Do you have a new Apple ID to use in NZ? If not open iTunes Store. Log out of your old Apple ID, then try to login. Select Create Apple ID from the dialog that appears. Make a new Apple ID for NZ with a NZ email address. Once that is approved and verified, log into the iTunes Store with the new Apple ID. This should fix all other issues.
    Change iTunes Store Country on an iDevice
    1. Tap Settings;
    2. Tap iTunes & App Stores;
    3. Tap View Apple ID;
    4. Enter your user name and password;
    5. Tap Country/Region;
    6. Tap Change Country/Region;
    7. Select the region where you will be located;
    8. Tap Done.
    Also, see How to Change Your iTunes Store Account Location | eHow.com.

  • Not updating Prompts when report is moved from Dev to Prod

    Hi,
    I have a report In development which uses a Prompt ( Dynamic Lov) pointed to an existing prompt group.
    When this report is moved to production the prompt does not give any values as the it is not pointed to any prompt group.
    Could any one help me why the prompt is not being updated when it is moved from DEV to PROD.
    Thank you..!!

    Need more info...
    What version and are you using BOE or CRS?
    Thank you
    Don

  • HT5622 i moved from Egypt to Canada, changed my info on app and still can't get some app because " item not available in the Egyptian store"

    i moved from country to another, changed my info in app ID and still can't get some apps because  item not available in the home country's store? any idea?

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

  • I'm having problem with my printer the carriage is not moving from si

    My printer carriage is not moving from side to side, It's like something not connecting and the light is blinking.

    Please review this post and then post some details.  What printer model?  What operating system?  How is the printer connected?  Are there any error messages?
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Contacts not moving from phonebook in my blackberry after removing from my contacts google contacts

    contacts in my addressbook in my blackberry are not getting updated properly via automatic sync by gmail. 
    contacts are not getting deleted from phonebook when they are removed from "my contacts" in Google contacts, but new additions and deletions are getting synced.
    when i tried to delete the contacts from my handheld after they have been moved from "my contacts", they got deleted all together. please help.
    additional info : BB 9360, OS 7.1
    when we pray God responds us by providing “Opportunities”

    I've spent the better part of an afternooon trying to get my Outlook contacts transfered to my E5 phone. After several attempts I was able to get the OVI software to install (Windows Vista OS). I Now when I go th sync my Outlook contacts, the "sync now" button is greyed out. Any suggestions?

Maybe you are looking for