Sorry to be so vague Carl.
The technical side of things is getting in the way of my art for the project. Greensock though is a god send, what a product.
I tried the no cache and indeed now the image refreshes whoppee.
Basically the work is for a school, I wish to have several buttons along the bottom of the screen. Each that will load up a different image from around the world. The images are web cam that the addresses don't change and the file names stay the same. It is a matter of clicking a button and the image appears. I would love it to be work like this. If the user clicks one of the buttons then the appropriate image loads and refreshes. If however the image is loaded and left running then after 5 minutes the image is automatically refreshed anyway. This way if the children leave it alone then the image will be current all day. I'm sure doing this will take me days and if someone has some similar code that I could cobble together then please do speak up it would make y life a lot easier at this point in time .
To add more complexity I wish to have an image appear if for some reason the image not exits. Also is there a way to monitor if a file does not load for individual files? Say if an italian web cam fails I can put up an italian flag, german fails german flag etc? I'm sure once I have this loading principle cracked then I can apply it to any asset loading into a project.
It's a lot of question and I would appreciate the help.
Many thanks
Ade
Code I used so far loading a single image. It does however now refresh using the noCache:1 as instructed.
--
Frame 1
import com.greensock.*;
import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;
//create a LoaderMax named "mainQueue" and set up onProgress, onComplete and onError listeners
var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
//append several loaders
//queue.append( new XMLLoader("xml/data.xml", {name:"xmlDoc"}) );
queue.append( new ImageLoader("http://www.campaniameteo.it/webcam/mercogliano/current.jpg", {name:"photo1", estimatedBytes:2400, container:this, alpha:0, noCache:1, width:640, height:480, scaleMode:"proportionalInside"}) );
//queue.append( new SWFLoader("swf/child.swf", {name:"childClip", estimatedBytes:3000, container:this, x:250, autoPlay:false}) );
//queue.append( new MP3Loader("mp3/audio.mp3", {name:"audio", repeat:2, autoPlay:true}) );
//prioritize the loader named "photo1"
LoaderMax.prioritize("photo1"); //same as LoaderMax.getLoader("photo1").prioritize();
//start loading
queue.load();
function progressHandler(event:LoaderEvent):void {
trace("progress: " + event.target.progress);
}
var image:ContentDisplay = LoaderMax.getContent("photo1");
function completeHandler(event:LoaderEvent):void {
TweenLite.to(image, 1, {alpha:1, y:0});
trace(event.target + " is complete!");
}
function errorHandler(event:LoaderEvent):void {
trace("error occured with " + event.target + ": " + event.text);
}
Frame 30
//PAUSE TIMER TO GO BEHIND VISUAL TIMER
stop();
trace("paused");
var millis_NATURECAM3:Number=30000;
var Tim_NATURECAM3:Timer = new Timer(millis_NATURECAM3, 1);
Tim_NATURECAM3.addEventListener(TimerEvent.TIMER, playit_NATURECAM3);
function playit_NATURECAM3(e:TimerEvent):void {
play();
}
Tim_NATURECAM3.start();
//Timer End
trace("play");
Frame 35
LoaderMax.getContent("photo1").loader.unload();
Frame 40
gotoAndPlay(1);