A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] [F8 - AS2] Loop makes Flash Player to run slowly... Need help!

  1. #1
    Member
    Join Date
    Jul 2008
    Location
    Čakovec, Croatia
    Posts
    34

    resolved [RESOLVED] [F8 - AS2] Loop makes Flash Player to run slowly... Need help!

    I've created several functions which choose random number in given range and then choose four new numbers according to given rules (same number of digits as the first chosen number with first three digits the same or different number of digits than first chosen number with first three digits the same). These functions also include the function which create the number word for each chosen number...

    I know that probably there are too many conditions in while loop (when choosing random numbers) and perhaps the random number range is rather big (up to 99 milliards) but I don't know how to fix it! The Flash Player runs slowly and force to abort the script...

    I'm trying to create a Flash game for my math students (matching number and number word) and this makes me rather frustrated because I don't know where exactly is the bug within my script...

    If anyone can have a look at the script (see attachment) and give me some advice....

    INTERESTING THING! When all these functions are in a separate file the script is little slower in execution but it works! On the other hand when I integrate it into my game - the Flash Player forces to abort the script because it runs slowly...

    Thanks for any tip!

    Alex
    Attached Files Attached Files
    Last edited by avukovi4; 11-07-2012 at 05:43 PM.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    First file has the publishing settings set to AS1, second file has it set to AS2.

  3. #3
    Member
    Join Date
    Jul 2008
    Location
    Čakovec, Croatia
    Posts
    34
    THANK YOU MILLION TIMES!!!!!

    I really feel like a Flash freshman and a bit ashamed of the fact that the solution was so obvious...

    The "...my_game.fla" is one of my really old games that I created in AS1 years ago and now I wanted to reuse it for a new number matching game and I've totally forgotten that it was done in AS1...

    I can't thank you enough because I really thought that I made some errors in AS2 script...

    Best regards,

    Alex

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center