2

I have a loader componet and progressbar. I want it fetch image continously. So I am try to Put a setInterval, but it does not works.

 var my_ldr:mx.controls.Loader;        
 var my_pb:mx.controls.ProgressBar;            
 var listener:Object = new Object();         
 my_pb.source = my_ldr;
 my_ldr.autoLoad = true;
 var interval:Number = setInterval(load_image, 2000);
 function load_image() {
   my_ldr.contentPath = ("http://google.example.image.php");
 }
 my_ldr.load(); 

 How can I use Timer to recieve Image  frequently ?
 thanks you
9
  • it only receive one image.. I want it receive continously manner
    – TOM
    Mar 23, 2015 at 7:49
  • 1
    I think that you have to use two Loaders, take a look on my answer of this question.
    – akmozo
    Mar 23, 2015 at 15:41
  • i have seen...but...i am searching for a small with effective program
    – TOM
    Mar 24, 2015 at 4:34
  • What you mean ? It's the same "problem" with the same solution, you have just to copy the code and test it ;)
    – akmozo
    Mar 24, 2015 at 6:16
  • yes.... here what are the both loader name CAN THIS WRITTEN IN AS 3.0 easily than 2.0
    – TOM
    Mar 24, 2015 at 7:47

1 Answer 1

0

You'll need to update the Loader as well as just the content path on interval. So you will need to add the my_ldr.load() inside the load_image function, I think.

3
  • 1
    Check to see if the image has changed somehow? You could have a check to see if the image is the same as the current one (either in your code or online). An alternative would be to use 2 loaders and just switch them out every second, updating one and then the other and hiding them after a second. Mar 23, 2015 at 14:30
  • You would have the same problem and probably produce the same outcome. There are different methods but this is probably the easiest honestly. Mar 24, 2015 at 9:14
  • some how it flickers... so i want to add a gif file .....which is showing at the time of flicker ..... so give me some idea ... about this.....
    – TOM
    Mar 25, 2015 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.