AS2 Photo Gallery size an action Issue

Hi there,

I’m a newbie with AS2…and i wanted to learn to create a photo gallery that scrolls right or left, and that when you click on the photo it becomes bigger.
Well I found a tutorial from a site. The only thing is that… when I built it and applied it to my project it does not work:
The issue is that it takes over the main page, even though is in its own swf file…(It’s part of a flash website, where each page is loaded separately…in this case this AS is in one page (portfolio) and when it gets loaded in the main page…the AS acts upon the “root”…I really don’t know how to change the script to only act upon the native swf file. I’m using a loader component to load the external pages…not sure if this is what’s causing the issue? :roll:
Also, aside from all the photos appearing across the entire horizontal part of the page(they do get to scroll), but when you click on the photo …it does enlarge but it freezes the whole page. I would like for this action to only be constrain to the size of the page, which is a different size than the one of main page, and to be able to be clickable…I know this might sound confusing… but if anyone can help I can supply a url…to explain things better! In the mean time here is the code…



import mx.transitions.Tween;
import mx.transitions.easing.*;

this.createEmptyMovieClip("container",1);
var imagesNumber:Number = 39;
var scrolling:Boolean = true;

for (i=1; i<=imagesNumber; i++) {
    container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);
    myThumb_mc = container["thumb"+i+"_mc"];
    myThumb_mc._x = (i-1)*myThumb_mc._width;
    myThumb_mc._y = (Stage.height-myThumb_mc._height)/2;
    myThumb_mc._alpha = 50;
    myThumb_mc.largerImage = i;
    myThumb_mc.onRollOver = function() {
        this._alpha = 100;
    };
    myThumb_mc.onRollOut = function() {
        this._alpha = 50;
    };
    myThumb_mc.onRelease = function() {
        this._alpha = 50;
        for (i=1; i<=imagesNumber; i++) {
            var myClip = container["thumb"+i+"_mc"];
            myClip.enabled = false;
        }
        scrolling = false;
        _root.attachMovie("image"+this.largerImage,"large_mc",2);
        large_mc._x = (Stage.width-large_mc._width)/2;
        large_mc._y = (Stage.height-large_mc._height)/2;
        new Tween(large_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
        new Tween(container, "_alpha", Strong.easeOut, 100, 50, 0.5, true);
        large_mc.onRelease = function() {
            this.enabled = false;
            scrolling = true;
            var myFadeOut = new Tween(large_mc, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
            new Tween(container, "_alpha", Strong.easeOut, 50, 100, 0.5, true);
            myFadeOut.onMotionFinished = function() {
                for (i=1; i<=imagesNumber; i++) {
                    var myClip = container["thumb"+i+"_mc"];
                    myClip.enabled = true;
                }
                large_mc.removeMovieClip();
            };
        };
    };
}
container.onEnterFrame = function() {
    if (scrolling) {
        this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*15;
        if (this._x>0) {
            this._x = 0;
        }
        if (-this._x>(this._width-Stage.width)) {
            this._x = -(this._width-Stage.width);
        }
    }
};

Please help…I would be greatly appreciative!!!
Thanks in advance!
Sue