dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: random movie clip

  1. #1
    Member
    Join Date
    Jan 2003
    Location
    Moara cu Noroc
    Posts
    37

    Question random movie clip

    Hey,

    Im trying to load random from the library 10 mc's. Which is not a problem.
    But once the loaded movie finishes playing would like to unload it and to load another random another movie and so on.

    Any ideas that i can apply?
    -------------------------------
    Mai presus
    De mariri, de caderi, de cuvant

  2. #2
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    Just test to see if

    Code:
    clip._currentframe ==clip._totalframes;
    Hope that helps!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  3. #3
    Member
    Join Date
    Jan 2003
    Location
    Moara cu Noroc
    Posts
    37
    arr_movies=['yup1','yup2','yup3','yup4'];
    play_random=function(d){
    this.attachMovie(arr_movies[random(arr_movies.length)],'yup',d);
    };
    play_random(55);

    this is as far as I got.

    no idea how to integrate your code flashpipe...
    -------------------------------
    Mai presus
    De mariri, de caderi, de cuvant

  4. #4
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    Try something like this:

    Code:
    arr_movies = ['yup1', 'yup2', 'yup3', 'yup4'];
    play_random = function (d) {
    	this.attachMovie(arr_movies[random(arr_movies.length)],'yup',d);
    	yup.onEnterFrame = function() {
    		if (this._currentframe == this._totalframes) {
    			play_random(55);
    		}
    	};
    };
    play_random(55);

    Hope that helps!!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  5. #5
    Member
    Join Date
    Jan 2003
    Location
    Moara cu Noroc
    Posts
    37
    Dear sir,
    I bow in front of ja!
    -------------------------------
    Mai presus
    De mariri, de caderi, de cuvant

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center