MovieClipLoader problem
- Started
- Last post
- 11 Responses
- ********
thanks rasko for ur help...
i wasn't usng loadMovie because i wanted to have a seperate progress bar for that swf i'm loading - which, from what i've read, is easier if u use MovieClipLoader...
anyway, i can get the swf to load, by using MovieClipLoader or loadMovie, but i can't get that swf to play. The swf i'm loading is like a flash mp3 player, but when i publish, the movie itself loads but 1) the first song isn't cued and 2) even when i select a song and press play the sound doesn't work.
I'm really crap at AS, so this might be something really basic and stupid. Any help? hope i explained myself properly
- ********0
for example, if i use loadMovie, i got this in the root timeline:
loadMovie("audiobutton.swf", "_root.holder");
where holder is an empty movieclip on the stage.
but when i publish, audiobutton.swf shud automatically start the first song. But it doesn't, even when i keep pressing the play button on that swf it doesn't. The swf on its on does work, i've checked it. Just not when loaded into the other swf
- unfittoprint0
the right usage is
_root.holder.loadMovie("audiobut...first: have you checked if audiobutton works alone.
second. test it in your browser. If your working with MX [and not MX 2004] there are some issues with the sound object in the test player.
- ********0
yeah the audiobutton works fine on it's own.
And i'm using 2004 and it doesn't work in my browser either.
It's weird, the loaded swf stops at the first frame without executing any of the actionscript for any of the MC's i got on the stage (a drop down menu, a volume control thingy, and play/stop controller). But even when i select a song and press play in it, no sound plays. It does work perfectly fine on its own.
- unfittoprint0
first. any component that you have [music player, scroll bar, etc... should always function on their own]. One rule is to never use the _root. If you have to access the previous hierarchy use _parent or _parent,._parent instead.
You seem to describe oher components [(a drop down menu, a volume control thingy, and play/stop controller)] as part of the main movie and not the loaded movie... In not, they should be.
Another thing, you probably should check if the component is loaded and only then trigger the st track listening.
- ********0
you could always try Export for Actionscript on your .mp3s and then play and kill_all_sounds in a player. something as such
- ********0
" Another thing, you probably should check if the component is loaded and only then trigger the st track listening."
I'm not trigerring anything, i'm just using: _root.holder.loadMovie("audiobut...
and expecting it to just start the music etc...All the components [(a drop down menu, a volume control thingy, and play/stop controller)] , are in the loaded movie, not the main movie...
I'll describe the audiobutton movie, see if that makes things clearer.
I got a MovieClip on stage (in the audiobutton.swf) called mp3Player. This has all the AS that loads the music, plays it, stops it, next track, pause etc... In the first frame it has this AS:
s = new Sound();
s.attachSound("track1");
_root.menu.list = "Four Tet And They."
if (stopped == true) {
s.stop();
} else {
s.start();
s.setVolume(40);
stopped = false;
}
s.onSoundComplete = function() {
gotoAndStop(2);
};
currentTrack = "track1";
paused = false;I also have a drop-down menu movieclip i made on the root time line of the audiobutton.swf which basically brings up the track listing and when u click on the track it goes to the relevant frame in the mp3Player clip (with the exact same code as above, just different track names). First frame of that is empty, but it has a dynamic text box called "list", which the mp3Player movieclip "writes" track names into (_root.menu.list = "Four Tet And They.")
And then i have a seperate volume controller on the stage which sets the volume for s.sound. Pretty straightforward.
All this works as it shud when on its own. BUT when loading it into another swf, my main one, nothing happens. The "list" box is empty, which suggests mp3Player movieclip hasn't written a name into it, which suggests, the first frame of mp3Player movieclip hasn't executed...
So then i use the "drop down menu" that's within the audiobutton swf (nested in another movie) to execute the first frame of the mp3Player clip (s.attachSound etc..). The button on that has the following script:
on (release) {
gotoAndStop(1);
_root.mp3Player.s.stop();
_root.mp3Player.gotoAndPlay(1);
}This is supposed to stop the curront song that is playing (s.stop) and then got to frame 1 of the mp3Player clip which initialises a new s.attachSound. Again, this works fine when i test the audiobutton.swf on its own, but when nesting in another movie, it does NOTHING.
This leads me to suggest that the first frame in mp3Player clip (on the stage in the audiobutton.swf) isn't happening. In other words, this code isn't doing itself:
s = new Sound();
s.attachSound("track1");
_root.menu.list = "Four Tet And They."
if (stopped == true) {
s.stop();
} else {
s.start();
s.setVolume(40);
stopped = false;
}
s.onSoundComplete = function() {
gotoAndStop(2);
};
currentTrack = "track1";
paused = false;Does that make sense? Do you know what i cud be doing wrong?
- Anarchitect0
got it.
make:
`
s = new Sound()to
s= new Sound(this);
- ********0
yeah Anarchitect
- ********0
Anarchitect, do u want my sister? She's urs! She's really hot and will do ANYTHING u want ;)
In other words, IT WORKS! THANK YOU! I LOVE U!
:-D
- unfittoprint0
Yeah I want your sister.
And your momma too.
- ********0
hehe, ummm, i'm sorry i cant actually deliver on that offer. But u can have me! How about it big bwoy? ;)