Adapting the SWF Transitions tute for MCs

Hi all,

I’m trying to adapt this tutorial for use with MovieClips in the library, instead of with external SWF (my MCs are small files sizes). I’ve set the MCs up as per this tute, and done a bit of adaptation to the button MC scripting to use the attachMovie method (I’ll explain why in a sec). I have my main FLA set up with my main navigation on the root timelife (one layer per button), and an empty MC on a layer below for my library MCs to get loaded into an empty MC from the navigation. Most of my AS is on an external file, which is as follows:


// ActionScript file for idx.fla/.swf
// Logo and navigation definitions are global throughout the site

//import com.mosesSupposes.fuse.*;
//ZigoEngine.simpleSetup(Shortcuts,PennerEasing,Fuse);

/* Begin stage resizing code */

// Stage paramaters
Stage.scaleMode = "noScale";
Stage.align = "TL";

// Logo positioning | stationary
logo._x = 40;
logo._y = 40;

// Resize function stage listener for the background
 var sListen:Object = new Object();
sListen.onResize = function():Void  {
    rePosition(bgPhotos);
};

// Resize function for the background
Stage.addListener(sListen);
function rePosition(bgPhotos):Void {
    if (Stage.width/Stage.height>bgPhotos._width/bgPhotos._height) {
        bgPhotos._width = Stage.width;
        bgPhotos._yscale = bgPhotos._xscale;
    } else {
        bgPhotos._height = Stage.height;
        bgPhotos._xscale = bgPhotos._yscale;
    }
    bgPhotos._x = 0;
    bgPhotos._y = 0;
}

contentMonitor = new Object();
contentMonitor.onResize = function() {
    _root.contentLoader.newsMC._x = (Stage.width-_root.contentLoader.newsMC._width)-40;
    _root.contentLoader.newsMC._y = (Stage.height-364.5)-50;
}

Stage.addListener(contentMonitor);
contentMonitor.onResize();

// Resize function call
_root.bgPhotos.onLoad = function(){
    setSize(Stage.width,Stage.height);
    bgPhotos.my_ssp.loadImageNumber("0");
}

// Main navigation
frontTrigger.onRelease = function() {
    bgPhotos.my_ssp.loadImageNumber("0");
}

profileTrigger.onRelease = function() {
    bgPhotos.my_ssp.loadImageNumber("1");
}

worksTrigger.onRelease = function() {
    bgPhotos.my_ssp.loadImageNumber("2");
}

detailsTrigger.onRelease = function() {
    bgPhotos.my_ssp.loadImageNumber("3");

I’ve also got actions attach to the MCs I’m using for buttons in the main nav. One example is:


on (rollOver) {
    _root.frontMC.gotoAndPlay(2);
}

on (rollOut) {
    _root.frontMC.gotoAndPlay(12);
}

on (release) {
    if (_root.contentLoader.currMovie == undefined) {
        _root.contentLoader.currMovie = "newsMC";
        _root.contentLoader.attachMovie("newsMC", "newsMC", 0);
        _root.contentLoader.newsMC._x = (Stage.width-_root.contentLoader.newsMC._width)-40;
        _root.contentLoader.newsMC._y = (Stage.height-364.5)-50;
    }
    else if (_root.contentLoader.currMovie != "newsMC") {
        if (_root.contentLoader._currentframe >=contentLoader.midframe) {
            _root.contentLoader.currMovie = "newsMC"
            _root.contentLoader.currMovie.play();
        }
    }
}

Now, the reason I’m using the attachMovie method is because of an earlier issue I was having with my dynamic slideshow in the bgPhotos movieclip and the alignment of the MCs I want to call with transitions. Because those MCs aren’t aligned top-left (in fact, they’re bottom-right), the attachMovie method was the only one I tried that finally succeeded in accomplishing the repositioning on browser resize.

Anyway, the problem is this: clicking on the nav links will call whatever MC it is and place it correctly on the stage inside its empty movieclip. However, that’s where it stops. clicking another link won’t advance the clip’s animation past the mid-frame, thus loading up the next one. At first I thought it was a path issue, but all attempts to play with paths turned up nil.

Any ideas on what I could be doing wrong?

On a side note, I find that when I do load up one of those MCs, the animations are pretty slow, despite the fact I have the FLA set to 30 fraps. Is it because something is getting cached and not being unloaded? Any thoughts on a solution to that would be appreciated, too.

Cheers!