Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-21-2012, 08:53 PM   #1
systemoverload
Registered User
 
Join Date: Jul 2012
Posts: 2
Default 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!
systemoverload is offline   Reply With Quote
Old 07-22-2012, 06:53 PM   #2
systemoverload
Registered User
 
Join Date: Jul 2012
Posts: 2
Default will this help more?

Hello all,

I am pretty new at flash and using action script and I really like this tutorial on creating a scrolling gallery, my question is how do I adjust the placement of it, left to right. I would want it to start say 20px in and end 20px before the edge of the screen leaving a boarder away from the edges, makes sense? I have attached the file to see if you can give me any insight I really appreciate it and I had to remove the large images to reduce the file size so if you click on an image it will just freeze but i'm not worried about the large images, thanks!
Attached Files
File Type: zip Tutorial WIP.zip (61.2 KB, 9 views)
systemoverload is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:02 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.