SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sequential swf files

    Hi all,

    I was quite happily following a tutorial for loading external swf files sequentially into a main swf file. I got to the end of the tutorial and all was fine and working.

    However, me being the idiot I am broke the script and now I cant get it working again, and to top it all I can't remember where the original tutorial is.

    I was wondering if someone knew how to get the following script working.

    Basically I have a main.swf, in which, on layer ne frame is am empty movieclip called container and it sits in the middle of the page.

    In the same frame one is the following actionscript 2 script

    Code:
    var _currentMovieNum:Number = 0;
    
    var _movies:Array = ["1.swf", "2.swf"];
    
    var mcl:MovieClipLoader = new MovieClipLoader();
    var list:Object = new Obejct();
    mcl.addListener(list);
    
    list.onLoadInit = function(mcl:MovieClip){
    trace("current swf is: " + _movies[_currentMovieNum])
    }
    
    mcl.loadClip(_movies[_currentMovieNum], container);
    
    this.onEnterFrame = function(){
    
    if(_currentMovieNum != _movies.length-1){
    
    if(container._currentFrame == container._totalFrames){
    
    _currentMovieNum ++
    
    mcl.loadClip(_movies[_currentMovieNum], container);
    
    }
    
    } else {
    
    _currentMovieNum = 0;
    
    mcl.loadClip(_movies[_currentMovieNum], container);
    
    }
    
    }

    I would be grateful if someone could get it working for me.

    Many thanks

  2. #2
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well you can try this

    Code:
    var _currentMovieNum:Number = 0;
    
    var _movies:Array = ["1.swf", "2.swf"];
    
    var mcl:MovieClipLoader = new MovieClipLoader();
    var list:Object = new Obejct();
    mcl.addListener(list);
    
    list.onLoadInit = function(mcl:MovieClip){
    trace("current swf is: " + _movies[_currentMovieNum]);
    playMovie();
    }
    
    loadSWF(){
    mcl.loadClip(_movies[_currentMovieNum], container);
    }
    
    function playMovie(){
    this.onEnterFrame=function(){
    if(container._currentframe>=container.totalframes){
    _currentMovieNum = 1;
    loadSWF();
    delete this.onEnterFrame;
    }
    
    }
    }
    
    loadSWF();
    Just look for the syntax as it has been a while since I have moved to AS3 and did anything in AS2.
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.


Bookmarks

Posting Permissions

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