A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] making movie play from given frame number when loaded in to another movie

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    165

    [F8] making movie play from given frame number when loaded in to another movie

    Hi ! there,

    can any body help me pls


    There are number of movie sequence movie.swf say movie 1 on frame 1, movie 2 on frame 2 and so on.. and i want a movie 3 on frame 3.

    There is another main.swf which has an action to load movie.swf and to stop at movie3(frame 3 ) so that movie play from that number.
    At present I can load the movie but fail to start movie from frame 3.

    How do I go about it???
    I'm stuck...

    Sabs

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    for [F8] look at the MovieClipLoader class in the Help Files

    make use of the onLoadComplete / onLoadInit event listeners

  3. #3
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    You need to use the MovieClipLoader class. loadMovie() does not have a way of telling when the .swf has fully downloaded and you can't use gotoAndStop(3) until its been fully downloaded.

    A moviecliploader (mcl) is pretty easy. Just create a generic object, assign it functions matching the names of the events you want to react to, make it listen to an mcl instance then just use loadClip() much like you would loadMovie().

    PHP Code:
    //create the generic object to assign loading event functions too
    //common practice to create separate object and moviecliploader instances
    //but since they work together, and since everything in flash technically is
    //an object, I add the functions right to the mcl.
    mcl = new MovieClipLoader();
    //create the function for when loading is inited
    //use onLoadComplete for a finished download, use onLoadInit instead if you
    //need to manipulate the loaded movie right away
    mcl.onLoadInit = function(target){
      
    target.gotoAndPlay(3);
    }
    mcl.addListener(mcl); //add it to itself as a listener
    //load the .swf
    mcl.loadMovie("mySWF.swf"myTargetMovieClip); 

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