Preloading external SWF
- Started
- Last post
- 9 Responses
- thismanslife
I'm not a complete Flash novice, I've done this before many times, but not in quite the same way.
My problem is, when I use loadMovie, i'm getting a lag before it appears, even if i've loaded it & shown it already in a previous scene (a preloader scene, which I thought should load, and therefore cache, the external file!)...
I was up all night with this... :(
- Fariska0
usa a MovieClipLoader
http://livedocs.macromedia.com/f…
- thismanslife0
I've not seen that before... an alternative to loadMovie... but will it also have a lag?
- Fariska0
with MCloader you can handle bettere the events:
I.E.
onLoadstart: you can specify actions when loading starts
onLoadProgress: actions during the progress (typically loadbar dimensions)
onLoadComplete: when the movie is loaded but not yest placed in the stage
onLoadIniti: when the movie is loaded AND istantiated: you can do evertything at this point (hide, scale, assign actions and so on)
- thismanslife0
Ok cool, I'll have a go, thanks! :)
- thismanslife0
Ok, tried that, still get a lag exactly the same as before
:(
- Rickbass0
The lag might be because of the server you're on? Loading an external movie clip requires a request to the server and, like any page or image, this can take time.
To speed things up, you might consider starting to pre-load external swfs the moment the main timeline swf is loaded - you'll take a bandwidth hit if you load files that the user never sees, but it should give you the instantaneous feel you seem to be after.
- tomkat0
try
file
publish settings
flash
actionscript settings
export frameset that to 2
- thismanslife0
Thanks Rick, yes I realise all that, and I *am* preloading stuff first, it's just that when the same object gets called to load into another container after the preloader, theres a lag before it appears. Preloading doesnt stop that.
I think I need a way of loading items into the library itself, so i'm not "reloading" files in everytime, they perhaps need to be loaded into the library, and thats it, they're in. That'd probably fix it.
That said... I've played with import/export runtime stuff to do exactly that, and there was no lag problem with it, but i was having trouble with my preloader, and strangeness in general... so I gave up. Also doing that didnt allow me to specify with a variable what gets loaded, it's all specified in the library. Not ideal.
Either way i'm struggling :(
- thismanslife0
tomkat : i dont have that exact setting (MX2004) but I do have "Export frame for classes" which i set to 2, made no difference.