gammada
03-23-2007, 07:13 AM
Been animating and doing simple things on Flash for a while but unfortunately I've been unable to catch-up with AS.
So, since I'm struggling to make a flash fx work for me now, I decided to test the ActionScript.org waters to see if someone would be kind enough to tip me off on this...
I'm trying to apply an image slide and bounce effect from this file (http://www.flashkit.com/movies/Effects/Masking/Sliding_-Canthan-10761/index.php)
but it has a couple of sliders that tweak the effect's speed and bounce momentum. My question is, how do I use the code from the sliders so as the movie plays them without any user intervention?
The code for the sliders is this:
onClipEvent (load) {
//Set the following values:
//Set the slider title
slideTitle = _parent.slideTitle
//Set the slider control variable
slideVariable = _parent.slideVariable
//Set the intial value for the slider position and value
_root[slideVariable] = _parent.startScale
//Set the following value according to the scale being used
minScale = _parent.minScale;
maxScale = _parent.maxScale;
//Do not touch!
count = _parent.startScale;
conversionFactor = (maxScale-minScale);
//Set the number of decimal places
decPlaces = _parent.decPlaces;
}
The main AS code is:
//Set the initial position of the clip
_root.xnew = 62;
//Make the movie move and bounce
function move(clipName) {
//xnew is the final destination of the to be moved clip
destination = _root.xnew;
//position is the current location of the to be moved clip
position = clipName._x;
//Make the movie clip bounce!!!
velocity = velocity*_root.bounce+(destination-position)/_root.speed;
clipName._x += velocity;
}
//Instantiate the move function
clip.onEnterFrame = function() {
move(this);
};
Thanks in advance for your help!
So, since I'm struggling to make a flash fx work for me now, I decided to test the ActionScript.org waters to see if someone would be kind enough to tip me off on this...
I'm trying to apply an image slide and bounce effect from this file (http://www.flashkit.com/movies/Effects/Masking/Sliding_-Canthan-10761/index.php)
but it has a couple of sliders that tweak the effect's speed and bounce momentum. My question is, how do I use the code from the sliders so as the movie plays them without any user intervention?
The code for the sliders is this:
onClipEvent (load) {
//Set the following values:
//Set the slider title
slideTitle = _parent.slideTitle
//Set the slider control variable
slideVariable = _parent.slideVariable
//Set the intial value for the slider position and value
_root[slideVariable] = _parent.startScale
//Set the following value according to the scale being used
minScale = _parent.minScale;
maxScale = _parent.maxScale;
//Do not touch!
count = _parent.startScale;
conversionFactor = (maxScale-minScale);
//Set the number of decimal places
decPlaces = _parent.decPlaces;
}
The main AS code is:
//Set the initial position of the clip
_root.xnew = 62;
//Make the movie move and bounce
function move(clipName) {
//xnew is the final destination of the to be moved clip
destination = _root.xnew;
//position is the current location of the to be moved clip
position = clipName._x;
//Make the movie clip bounce!!!
velocity = velocity*_root.bounce+(destination-position)/_root.speed;
clipName._x += velocity;
}
//Instantiate the move function
clip.onEnterFrame = function() {
move(this);
};
Thanks in advance for your help!