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 6948103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:46:44+00:00 2026-05-27T13:46:44+00:00

I have an as3 app which utilises an sqlite db to save metrics data.

  • 0

I have an as3 app which utilises an sqlite db to save metrics data. It is well known that as3 is single threaded, so when I save to this db, the Stage Video I am playing becomes jumpy! I have heard that saving db data in batches can speed up this process so I save in a loop:

for (var i:int=0; i < metricsObject.metricsComponentData.length; i++){
    switch (metricsObject.metricsComponentData[i].mouseType) {
        case MetricsCollator.MOUSE_OVER:
            this._query_txt = "INSERT INTO " + this._tablePath[0] + " VALUES (null, " + this._sessionID + 
                                                                    ", " + metricsObject.metricsComponentData[i].timeStamp + 
                                                                    ", '" + metricsObject.metricsComponentData[i].component + "'" + ")";
                    break;
        case MetricsCollator.MOUSE_OUT:
            this._query_txt = "INSERT INTO " + this._tablePath[1] + " VALUES (null, " + this._sessionID + 
                                                                    ", " + metricsObject.metricsComponentData[i].timeStamp + 
                                                                    ", '" + metricsObject.metricsComponentData[i].component + "'" + ")";
                    break;
       } // end switch
    executeQuery(this._query_txt);
} // end loop

I have looked into pseudo threading examples but they all require a sprite or stage instance, the class I am executing this code in, is not a display class, I don’t really want to pass an instance of the stage into this class, seems dirty! 😉

Anyone have any ideas?

  • 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-27T13:46:45+00:00Added an answer on May 27, 2026 at 1:46 pm

    Most examples of pseudo threading use a display object and an enter frame listener, but you can just as well use a Timer, or if your application has some kind of update loop that works too.

    Here’s a simple example using a Timer:

    package {
        import flash.display.Sprite;
        import flash.events.TimerEvent;
        import flash.utils.Timer;
    
        public class PseudoThreadExample extends Sprite {
    
            private var _timer:Timer;
    
            public function PseudoThreadExample(){
                // create a timer that runs with a low interval
                // tweak this to fit your needs!
                _timer = new Timer(30, 0);
                _timer.addEventListener(TimerEvent.TIMER, handleTick);
            }
    
            public function startWorking():void {
                // put work to be done in list here
                // in your case that will probably mean making an array of SQL-
                // statements to run later
                _timer.start();
            }
    
            public function handleTick(event:TimerEvent):void {
                // pop a thing off the list and do it.
                // if list is empty, stop the timer
                _timer.stop();
            }
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a AS3 swf [1] that is loading another AS2 swf [2] which
I have an XML object in AS3 that is formatted as follows: <data> <nodes>
Here's one for the maths demons out there! I have an as3 app that
I have a very simple AS3 app that draws few circles using drawing api
I have a Pure AS3 app that I'm deploying to both iOS and Android.
I have created AS3 APP that works with http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html The application works fine on
I have a Adobe Air app (AS3, not Flex) that has 2 windows. When
I'm writing a web based flash app that's written entirely in AS3. I have
In AS3 you have a function on a string with this signature: function replace(pattern:*,
I'm building a social media app in Flash (AS3) that is tightly integrated with

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.