Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6999823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:35:29+00:00 2026-05-27T20:35:29+00:00

I am creating a game, in AS3, in Flash CS4, with Adobe AIR. The

  • 0

I am creating a game, in AS3, in Flash CS4, with Adobe AIR. The game has gotten too large and complex for me to share the full thing on here, but I will try to explain my problem.

The background of my game is animated water, and it is a symbol separate of the game character and the other entities in the game. When the character performs certain tasks, the water animation needs to jump to a certain frame. This should be really easy:

water_background.gotoAndPlay(the_frame);

However, this for some reason is causing a lot of lag, regardless of the machine I use it on. Right when the gotoAndPlay fires off, there is about a 700 millisecond delay where everything freezes up, and then when it comes out of it, all the animations already have completed and the water is playing from the appropriate frame, however the user misses all the pretty animation because the game freezes during it.

I’ve been trying to figure this out for hours. I’ve googled everything I could think of and have yet to find an answer.

I am a little concerned it might be because my symbol has a large number of frames… it is 850 frames.

Can anyone shed some light on this for me?

Here is the relevant code. This is run in response to a keyboard action by the user:

//the nearest frame to jump to in FRONT of the current frame, when something is succesfully eaten.
var nearest_clear_frame:int = 1; 
var curr_frame = water_background.currentFrame;
var i;
var skipped_frames:int = 0;
for(i = 0; i < clear_frames.length -1; i++) {


        var new_delta = (clear_frames[i]-curr_frame);
        var old_delta = (nearest_clear_frame-curr_frame);

        if((new_delta<old_delta || old_delta<0)&& new_delta >= 1){

            nearest_clear_frame = clear_frames[i];
            skipped_frames = nearest_clear_frame -curr_frame;

        }

}

water_background.gotoAndPlay(nearest_clear_frame);              

water_background is the movieClip of the water background t hat is about a 30 second looping video.

clear_frames is defined like so:

public var clear_frames:Array = [1, 109, 272, 413, 529, 690, 830];

clear_frames is defined in a separate class, but the class that the main code is in is an extension of that separate class, so I believe I should have full access to it

Any help is greatly appreciated, thank you.

EDIT


gotoAndPlay(1) functions perfectly smooth, but some of the other frames don’t, even if I type them in manually instead of using the array.

Here is the size report for the thing:

turtle_game.swf Movie Report
-----------------------------

Metadata
--------
Bytes    Value
-----    -----
 1290    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/"> <xmp:CreatorTool>Adobe Flash CS4 Professional</xmp:CreatorTool> <xmp:CreateDate>2011-11-14T14:28:55-08:00</xmp:CreateDate> <xmp:MetadataDate>2011-12-31T12:34:19-08:00</xmp:MetadataDate> <xmp:ModifyDate>2011-12-31T12:34:19-08:00</xmp:ModifyDate> </rdf:Description> <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"> <xmpMM:InstanceID>xmp.iid:DCA89ABBEE33E1119D5DF3032563A207</xmpMM:InstanceID> <xmpMM:DocumentID>xmp.did:DCA89ABBEE33E1119D5DF3032563A207</xmpMM:DocumentID> <xmpMM:OriginalDocumentID>xmp.did:2F1CC129100FE111B280DE374C2F22D4</xmpMM:OriginalDocumentID> <xmpMM:DerivedFrom rdf:parseType="Resource"> <stRef:instanceID>xmp.iid:B51A6ED0190FE111B280DE374C2F22D4</stRef:instanceID> <stRef:documentID>xmp.did:B51A6ED0190FE111B280DE374C2F22D4</stRef:documentID> <stRef:originalDocumentID>xmp.did:2F1CC129100FE111B280DE374C2F22D4</stRef:originalDocumentID> </xmpMM:DerivedFrom> </rdf:Description> <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:format>application/x-shockwave-flash</dc:format> </rdf:Description> </rdf:RDF> 

Frame #    Frame Bytes    Total Bytes    Scene
-------    -----------    -----------    ----------------
      1        7792727        7792727    Scene 1 (AS 3.0 Classes Export Frame)
      2              2        7792729    
      3              2        7792731    
      4              2        7792733    
      5              2        7792735    
      6              2        7792737    

      ... i checked all of these and they are roughly identical ...

    837              2        7794399    
    838              2        7794401    
    839              2        7794403    
    840              2        7794405    

Scene                        Shape Bytes    Text Bytes    ActionScript Bytes
-------------------------    -----------    ----------    ------------------
Scene 1                                0             0                 49218

Symbol                       Shape Bytes    Text Bytes    ActionScript Bytes
-------------------------    -----------    ----------    ------------------
water_background2                      0             0                     0
water_background                       0             0                     0
background                             0             0                     0
gauge                                  0             0                     0
stage_mask                             0             0                     0
lose_screen                            0            68                     0
win_screen                             0            66                     0
gauge_mask                            38             0                     0
gauge                                  0             0                     0
gauge_shell                            0             0                     0
main_turtle2                           0             0                     0
Floating Turtle Frames 2               0             0                     0
Floating Turtle Frames                 0             0                     0
Floating Turtle Tweens                 0             0                     0
Floating Turtle Frames3                0             0                     0
item                                   0             0                     0
blf                                    0             0                     0
brf                                    0             0                     0
tlf                                    0             0                     0
trf                                    0             0                     0
body                                   0             0                     0
Tween 1                                0             0                     0
Tween 2                                0             0                     0
main_turtle                            0             0                     0

Font Name                 Bytes        Characters    
----------------------    ---------    --------------
TimesNewRomanPSMT              1633     !LWYnostu

ActionScript Bytes    Location
------------------    --------
             49218    Scene 1:Frame 1

Bitmap                     Compressed    Compression
-----------------------    ----------  --------  -----------
jelly.png                       4546      133056   JPEG Quality=80
bag.png                         6289      176148   JPEG Quality=80
6pack.png                       4730       57936   JPEG Quality=80
turtle.png                     40215     2743296   JPEG Quality=80
back left flipper               3524       56144   JPEG Quality=80
back right flipper              4664       63448   JPEG Quality=80
top left flipper                6228      123300   JPEG Quality=80
top right flipper               4407       69552   JPEG Quality=80
body                           18132      242740   JPEG Quality=80
Gauge-shell.png                10399      236160   JPEG Quality=80
portal.png                    215640     8294400   JPEG Quality=80
Outside Template              140809     7542720   JPEG Quality=80
Finish                          3510       39432   JPEG Quality=80
Start                           3303       39008   JPEG Quality=80
Shark A                         6454      115320   JPEG Quality=80
Shark B                         6360       96672   JPEG Quality=80
Shark C                         6275       96672   JPEG Quality=80
Red Boat                       10781      226872   JPEG Quality=80
Green Boat                     11601      241664   JPEG Quality=80
Yellow Boat                    12305      245504   JPEG Quality=80
Green Leatherback               3755       38352   JPEG Quality=80
Globe                         248169     5607360   JPEG Quality=80
Shadow                        507039     8294400   JPEG Quality=80
Dimpled Aluminum              489466     8294400   JPEG Quality=80
progress_meter.jpg             17398      558112   Imported JPEG=102

Video                       Compressed
------------------------    ----------
background.flv                  5933617
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:35:30+00:00Added an answer on May 27, 2026 at 8:35 pm

    It doesn’t look like anything in your code is a problem. It sounds like you have some pretty heavy imagery getting loaded on some frames, or else there is some actionscript that is creating objects on certain frames. It is difficult to share the FLA, but is there an online example that you can show?

    Regardless, if you have not already done this, in “Publish Settings”, check the box “Generate Size Report”. This option produces an text file in the same directory as your FLA (or as the SWF, maybe?). There is a wealth of data in that report, and it breaks down frames, objects, time, etc.

    Also, don’t declare variables in the for-loop. Also, give all your variables a type. This is just good practice.


    EDIT:
    Ok, looking at the report, you have a huge load (7792727 bytes) in frame 1, and nothing in the others. This looks mostly like the background.flv video, as well as a bunch of other PNG images. You can try to reduce the size of the PNGs, but I think the big culprit is the FLV video. You are probably seeking within and SWF to seek within an FLV. This should be a quick process, but you might try removing the FLV for testing.

    If this is not the solution, then you might want to re-check the embedding on progress_meter.jpg.

    Beyond that, I would have to see the AS3 code. What you are looking for is object instantiation, object removals, and remote loading of objects (URLLoader, etc.). Those will be the biggest time consumers.


    Edit: I think I would have to see the file to understand it. You can email to a garbage account I created: testdee@yahoo.com.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a game in Flash CS4 and using Actionscript 3.0. I'm adding all
I am creating a side scrolling game in Flash (as3) and trying to keep
Iam creating a Flash AS3 based Poker game for my company. Some like zynga
im creating a game that has multiple levels and the levels contain multiple textures
i am creating a game which has a HUD layer on top showing scores
I'm creating a game in which I have a somewhat complex method for creating
I am creating a game and have gotten to the point where I have
Im creating flash game that have the functionality to capture/record its gameplay that can
I am developing a game for the Android platform using flash cs5 and AS3.
Im creating a game in Flash and I have a class that have some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.