bit of flash help...
- Started
- Last post
- 5 Responses
- kezza_2
hi...
Ive build a flash movie with all the content in it. In to a blank movie clip in the movie, I am loading another movie clip that contains images.
The loader for the image movie works fine on its own, but when its loaded into the main movie the loader doesnt work.... make sense?
the script for the loader is:
bytesloaded = Number(getBytesLoaded());
bytestotal = Number(getBytesTotal());if (bytesloaded>=bytestotal) {
gotoAndPlay(3);
}per = bytesloaded/bytestotal*100;
setProperty("_root.bar", _xscale, per);
percent_t = math.round(per)+"%";I also have exactly the same loader on the main movie too...
thanks :)
- UndoUndo0
when you load a movie clip into another it either goes into a level or another mc. so you need to change the 'per = bytesloaded/bytestot al*100;
setProperty("_root.b ar", _xscale, per);
percent_t = math.round(per)+"%"; to whatever the level or MC is.ie. _level1.bar or _root.myMC.bar
ye get me?
- kezza_20
thanks undo...
I got that bit. the movie is loading in, its the loader thats not working....
http://www.blueskydreamer.co.uk/…
the loader works on the main movie but not the movie loading in...
make sense?
- Bottlerocket0
Kezza, what version of flash are you using? Here's a link to a really basic MX flash preloader
http://www.kirupa.com/developer/…I don't really use onClip() events and you're much better off creating a loader object or depending on what version of flash you are using, the inBuilt preloaders for the MovieClip class.
- sktII0
Undo was correct..
The preloader code is referencing items on the root timeline. As they are being loaded into a movie on the root, the items are not on the root themselves. You need to reference them like so.
_root.MovieName.ItemName.
rather than
_root.ItemName.
- UndoUndo0
sktII put it a bit more elegantly than I did. put yr code into http://www.pastebin.se
and Ill show you what I mean