A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Load swf in to another swf problem... pls help.

  1. #1
    Senior Member
    Join Date
    Sep 2006
    Posts
    248

    Load swf in to another swf problem... pls help.

    Hi there!
    I am having a problem about loading a swf in to another swf where this last swf must be loaded in a specific frame.
    So far, I can load y.swf into x.swf. But I am trying, without success, to load y.swf into x.swf where y.swf MUST appear in frame, lets say, “end”.

    How could I do that?
    Thanks.
    Leo.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    load y.swf and hide it offstage.
    when you reach your target frame, show the swf -

    // frame#1 - main timeline
    loadMovieNum("y.swf", 1); // loading to a level in this example

    this.onEnterFrame = function(){ // loop until the first frame has loaded into _level 1
    if(_level1){ // an empty level returns false
    _level1._y = 1000; // hide offstage
    _level1.stop(); // stop y.swf
    this.onEnterFrame = null; // end the loop
    }
    };


    // on frame labelled - end
    _level1._y = 0; // show on stage
    _level1.play(); // start y.swf
    Last edited by a_modified_dog; 02-10-2008 at 01:03 PM.

  3. #3
    Senior Member
    Join Date
    Sep 2006
    Posts
    248
    Hi there!
    Thanks for ur reply!
    Didnt understand much, and i think is because i didnt explain the problem very well either.
    Let me try again.. :-)
    Have two swfs. One called x.swf (where there is a button and a area where i pretend to load and display the other swf) and y.swf.
    So, when the button is pressed in x.swf, in the chosen area i will try to load y.swf but in a certain frame. Since y.swf has lots of frames. I am trying to load y.swf in the frame called "end".

    Any idea?
    Thanks again.
    Cheers.
    Leo.

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    ahh.. i think i understand what you mean
    use the MovieClipLoader class -
    PHP Code:
    var mc:MovieClip createEmptyMovieClip("mc"1);
        var 
    mcLoader:MovieClipLoader = new MovieClipLoader();
        var 
    mcListener:Object = new Object();
        
    mcLoader.addListener(mcListener);
     
        
    mcLoader.loadClip("trailer.swf"mc);
        
    mcListener.onLoadInit = function(mc:MovieClip){
        
    mc.gotoAndPlay("end");
        }; 

  5. #5
    Senior Member
    Join Date
    Sep 2006
    Posts
    248
    Yeap!
    Is something like that!
    Gonna try it and will let u know!
    THANKS a lot!!
    Cheers!
    Leo.

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