MovieClipLoader problem

Out of context: Reply #6

  • Started
  • Last post
  • 11 Responses
  • ********
    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?

View thread