How can I adjust the placement of this _mc???
Hello,
I'm pretty new at Flash and just reverse engineered this code to fulfill my needs but I have hit a stumbling block, I have a stage that is 780 x 560 px and I want to place a movieclip within a frame on the page. Right now the code tells the movieclip to start at the beggining of the stage and scrolls to the end of the stage and I want it to start like 100px in and end like 100px from the end of the stage, if that makes sense. Here is the code with my dummy notes:
//
// NOTES ABOUT THE GALLERY
// EACH THUMB SHOULD BE 140H x 260W
// EACH THUMB IS RGB, 72dpi, and JPG 7 QUALITY
// EACH IMAGE IS ALSO RGB 72dpi but full res not cropped JPG 7 QUALITY @ 5.75" High
//
import mx.transitions.Tween;
import mx.transitions.easing.*;
this.createEmptyMovieClip("container",1);
// Number of images to show in thumb strip
var imagesNumber:Number = 15;
// Start Scrolling on load = true Scroll after clicking image = false
var scrolling:Boolean = true;
var imagesWidth:Number = 0;
var spacing:Number = 0;
for (i=1; i<=imagesNumber; i++) {
container.attachMovie("thumb"+i,"thumb"+i+"_mc",i) ;
myThumb_mc = container["thumb"+i+"_mc"];
myThumb_mc._x = imagesWidth;
imagesWidth += myThumb_mc._width+spacing;
//myThumb_mc._x = (i-1)*myThumb_mc._width;
//
// Tell thumbstrip to run through the center of stage"/2"
// adjust the divider to change placement
//
myThumb_mc._y = (Stage.height-myThumb_mc._height)/2.5;
// Thumbs open at XXX%
myThumb_mc._alpha = 100;
myThumb_mc.largerImage = i;
// Rolled over thumbs change to XXX%and back with the RollOut function
myThumb_mc.onRollOver = function() {
this._alpha = 100;
};
myThumb_mc.onRollOut = function() {
this._alpha = 100;
};
// After being clicked image chages to XXX% until rolled on again
myThumb_mc.onRelease = function() {
this._alpha=100;
for (i=1; i<=imagesNumber; i++) {
var myClip = container["thumb"+i+"_mc"];
myClip.enabled = false;
}
//
// Tells image to open in the center of the stage"/2"
// adjust the divider to change placement
//
scrolling = false;
_root.attachMovie("image"+this.largerImage,"large_ mc",2);
large_mc._x = 67
large_mc._y = 117
//
// Fade in and fade out functions
// Starts at X to X alpha and at what speed
//
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();
};
};
};
}
//
// Speed of thumbstrip based on x position of the cursor
//
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);
}
}
};
So this is a row of thumbnails that scrolls depending on the placement of the mouse cursor. It loads images and thumbs from the library that were imported to the stage in the flash file. Any help would be really appriciated, thanks!
|