2 Replies Latest reply on Jul 22, 2009 8:01 PM by dmfsantacruz

    blinking reload

    dmfsantacruz

      Hi, I have this funky reload script to pull fresh data from a mysql database connector.

      Some people mentioned using a push command but I have no idea how to implement that. If anyone could take a look that would be great!

       

      thanks

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"layout="absolute" width="1920" height="1080"

      creationComplete="dbTimer()" borderColor="#797979" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#636363, #9A9A9A]" color="#F3F3F3">

       

      <mx:Script>

      <![CDATA[

      import mx.controls.Text;

      import mx.controls.Label;

      import mx.collections.ArrayCollection;

      import mx.rpc.events.ResultEvent;

      [Bindable]

      private var omArray:ArrayCollection

      private function resultHandler(event:ResultEvent):void

      {

      omArray = event.result.response.data.row;

       

      }

       

      import flash.utils.Timer

      import flash.events.TimerEvent

      import flash.display.Sprite

       

      private function dbTimer():void

      {

      inventoryService.send();

      var mTimer:Timer=new Timer(1000,10)

      mTimer.addEventListener(TimerEvent.TIMER_COMPLETE,Comple);

      mTimer.start();

      }

       

      private function Comple(e:TimerEvent):void

      {

      inventoryService.send();

      dbTimer();

       

      }

       

      ]]>

      </mx:Script>

       

        • 1. Re: blinking reload
          AKloft Level 2

          I'm not at work right now, so I hope this isn't a pressing matter, but maybe I will dig this post up to the top for other people to help you.  I'll be of more assistance once I get to work tomorrow, but just wanted to mention a styling thing:

           

          It's widely accepted to import everything at the top of your script.  This makes code more readable, and can help with organization.  However, your way is certainly acceptable as well.

           

          I'll answer your question (hopefully) later tomorrow.

          • 2. Re: blinking reload
            dmfsantacruz Level 1

            Thanks!

             

            I can rearrange those import commands no problem.