About preloading a .swf?

ok !

i got an animation of a door closing, when the door is closed
a script on “frame 10” says:

ClipCache.loadMovie(“history.swf”);

and then on “frame 11” i got a script saying:

function preload (MyCache) {
if (!MyCache.doneLoading) {
if (MyCache._framesloaded>0 && MyCache._framesloaded == MyCache._totalframes) {
MyCache.doneLoading = true;
}
}
}
stop ();

i also have a cache with the following script:

onClipEvent (enterFrame) {

if (this._url != _root._url) {
_root.preload(this);
}

}

now the thing i wanna know is : what and were do you type in
a script that says: when .swf is loaded go “to frame 30” (that is “frame 30” in the door animation timeline, not the preloaded .swf)??

i also would like to know how you unload the .swf that are in the cache ? what is the script for unloading it (like when i press a button the :swf in the cache should be unloaded)?

hope u guys know this cos i need to know it bad

hmm,

there’s a number of things here i’m not familiar with. i did a little testing …

if you call loadMovie as a method of a movie, it will replace that movie on the stage - in your case “ClipCache”. did you create that movie?

the script in frame 11 is declaring a function. it doesn’t actually do anything, it just sets up a series of commands for later (usually repeated) use. i usually put all my functions in _root, frame one, on their own layer - just to keep things tidy. then i reference them always with _root. prepended.

it seems to be misnamed as it’s more checking to see if it’s finished loading rather than actually preloading anything. the loading of the movie happens in the onClipEvent(enterFrame) event.

if you add return=“true”; to the innermost if statement of the preload() function, then you can write in the onClipEvent(enterFrame) event:

if(_root.preload(this)){
_root.gotoAndPlay(30);
}

that’s assuming the door movie is _root, otherwise, edit accordingly.

the cache with the script, this is “ClipCache”, right? if not, you may want to name it that.

hi again beener :slight_smile:

do u have icq ? if so is my #85796121
we could talk about this and i could explain alil and show u
stuff that i took the script from etc etc…

cos talking over this forum takes ages and i need to solve this dilemma asap…

sorry, no icq, or any of that … but send me an email (by clicking on my name to the left, then following the link on the top right) and we’ll probably correspond a little swifter.

include the fla and then we’ll all be on the same page, maybe zip it first.

oh, include your email address in the text so i can reply directly (it comes from [email protected]).

cheers

ok i have sent u an mail… in case u dont get it by any reasons is my mail [email protected] just send me a mess so i can get back to u with all the goodies ^^

i mailed you but haven’t received a response, it didn’t bounce back. did you get it?

maybe this worm is mucking things up.