Preload a partial list of files to improve bootstrap time
I'm working on a HTML5 canvas project where I'm trying to change the preloading logic to improve bootstrap time.
Say that my project has 6 different assets named A,B,C,D,E,F and the timeline has 2 breakpoints which use the following assets:
Animation 1: 1 to 4s: use assets A,B,C
Animation 2: 4s to 8s: use assets A,D,E,F
The timeline playback stops at the end of every animation so there will be enough time to load the remaining assets.
If I want to start the playback at 1s, the preloading code should preload assets A,B,C, start the timeline, and then load the remaining assets later (D,E,F)
If I want to start the playback at 4s, the preloading code should preload assets A,D,E,F, start the timeline, and then load the remaining assets later (B,C)
When I look at the published Adobe code, I see something like:
lib.properties = {
id: '19F1EE3FEBDA4477AE95339F614A5032',
width: 2732,
height: 2048,
fps: 24,
color: "#FFFFFF",
opacity: 1.00,
manifest: [
{src:"images/background.jpg", id:"background"},
{src:"images/girl_body_2_jpg.png", id:"girl_body_2_jpg"},
{src:"images/girl_body_jpg.png", id:"girl_body_jpg"},
{src:"images/girl_head_2_jpg.png", id:"girl_head_2_jpg"},
{src:"images/girl_head_jpg.png", id:"girl_head_jpg"},
{src:"images/girl_shoe_jpg.png", id:"girl_shoe_jpg"},
{src:"images/girl_sock_bottom_jpg.png", id:"girl_sock_bottom_jpg"},
{src:"images/girl_sock_top_jpg.png", id:"girl_sock_top_jpg"},
{src:"sounds/cartoon_collection_SAMPLE_G.mp3", id:"cartoon_collection_SAMPLE_G"},
{src:"sounds/cartoon_collection_SAMPLE_H.mp3", id:"cartoon_collection_SAMPLE_H"},
{src:"sounds/slide_whistle_SAMPLE_A.mp3", id:"slide_whistle_SAMPLE_A"}
],
preloads: []
};
It looks like there is a list of assets needed for my project, but I'm not sure how to tell *when* they're needed (ie, at what position in the timeline).
Any ideas how to accomplish this?
