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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:29:47+00:00 2026-05-24T10:29:47+00:00

I’m trying to get my local sqlite db to display the next record on

  • 0

I’m trying to get my local sqlite db to display the next record on the click of a button.

I’ve looked at posts like Getting next record in SQLite database for mobile application, but their code has offered little solution for me. Here is a sample of my code:

AS3:

    private function getNext():void
        {
            nextRecordId = targetRecordId + 1;

            selectStmt = new SQLStatement();
            selectStmt.sqlConnection = conn;
            var sql:String = "SELECT [Index], Title, CAST(Picture AS ByteArray) AS Picture FROM Data WHERE [Index] = 1" ;
            /*  selectStmt.parameters[@nextRecordId] = nextRecordId;  */ // Id of next record
            selectStmt.text = sql;
            selectStmt.addEventListener(SQLEvent.RESULT, selectResult2);
            selectStmt.addEventListener(SQLErrorEvent.ERROR, selectError2);
            selectStmt.execute();

        }

        private function selectResult2(event:SQLEvent):void
        {
            selectStmt.removeEventListener(SQLEvent.RESULT, selectResult2);
            selectStmt.removeEventListener(SQLErrorEvent.ERROR, selectError2);

            var result2:SQLResult = selectStmt.getResult(); 

            dataField2 = new ArrayCollection(result2.data);
            dp2 = ArrayCollection(dataField);  

            if (result2.data != null) 
            {
                pngIndex = result2.data[0].Index;
                pngTitle = result2.data[0].Title;
                pngByteArray = result2.data[0].Picture; 
                displayPic.source = pngByteArray;
            }   
        }

UI MXML:

    <s:Scroller interactionMode="touch"
            width="640"
            height="830">   
        <s:Group>
            <s:Image id="displayPic"
                     x="0" y="16" 
                     width="640" 
                     scaleMode="stretch" 
                     smooth="true" smoothingQuality="high"
                     />
            <!--<s:TextArea x="9" y="731" text="@{pngTitle}"/>-->
    </s:Group>
</s:Scroller>

Thanks a lot for the help/advice

  • 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-24T10:29:47+00:00Added an answer on May 24, 2026 at 10:29 am

    I don’t see where you’re having problems with this. Have you tried this thing called google?

    selectStmt = new SQLStatement();
    selectStmt.sqlConnection = conn;
    selectStmt.text = "SELECT Title, CAST(Picture AS ByteArray) AS Picture FROM Data WHERE id=@index LIMIT 1";
    selectStmt.parameters['@index'] = index++;
    selectStmt.execute();
    

    As long as you keep that index variable as a class var set at 0 for default, you should be fine until it runs out of rows. Of course, there are other ways of doing this, like getting an array of all rows and have actionscript manage it. This is easier if you don’t have a very large database of information.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.