Announcement

Collapse
No announcement yet.

The program gets stuck When the code works In the Timer page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • The program gets stuck When the code works In the Timer page

    the stuck is for some second Every few seconds. can i open a new thread in AMS??? for this code.

    page: on show
    Page.StartTimer(3000, 10);


    page: on timer
    connected = HTTP.TestConnection("http://www.jfunc.com", 20, 80, nil, nil);

    if connected then
    Image.Load("Image1", "AutoPlay\\Images\\Bullet-001.png");
    else
    Image.Load("Image1", "AutoPlay\\Images\\Bullet-003.png");
    end

  • #2
    You can't have a thread per say but you can use a Lane to stop the GUI being blocked, just modify the FileFind function to be an OnTimer function and your background will change without any noticeable issues.

    Comment


    • #3
      It really really really really complex for me :-(
      I use AMS because of the ease of development but it's really not easy. I did not understand anything. :-)
      Is there an example for more understandable and easy???

      Comment


      • #4
        If you export your project and post a link then I dont mind adding the Lanes stuff to it.

        Comment


        • #5
          I got the images from the default folder so here is a working example:

          Lanes Example.apz

          You'll need to do an On Close event to stop the timer and give it a sec for any lane that might be running to finish otherwise you might get an error on exit/page jump although on testing I never.

          Comment


          • #6
            Thank you, I really would love

            Thank you, I really would love
            Attached Files

            Comment


            • #7
              It's here

              Lanes Example.apz

              Didn't need your project after all.

              Comment


              • #8
                Thank you for your excellent work but when I copy the code to my project I get the error "Lanes not Loaded".
                I saw code in three places. On Show, On Timer and Global Function. Maybe I missed something????
                It is important to say your project works great and even I copy your code to a new project it gives me this error.

                Comment


                • #9
                  There is two dependencies:

                  lanes
                  lua51-lanes.dll

                  in the cd root, you need to copy them to your project making sure they go in cd root.

                  Comment


                  • #10
                    Works great thanks. I hope that the new version of AMS will include functions like this And drag and drop files Like you helped me A few days. thanks!!!

                    Comment


                    • #11
                      I would use lua socket module to test internet connection rather the AMS Http.TestConnection function, because it's 100x faster. I wrote an example on this forum long ago

                      Comment

                      Working...
                      X