PDA

View Full Version : Image slide and bounce fx not working


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!

WhidbeyTomas
03-26-2007, 03:59 AM
Simple solution: remove the controls. In this movie, the controlls serve to change the initial value of a setting. So removing the sliders simple removes any ability to change values.

Does this answer your question?

gammada
03-26-2007, 04:45 AM
Nope, it doesn't work.

That's the first thing I tried but it doesn't work. I've also turned the controls to an alpha value of 0% so as to keep them on the stage but it doesn't work either.

Removing them on the original movie produces the same results.

WhidbeyTomas
03-26-2007, 05:35 PM
I looked at the movie and the reason removing the controls does not work is that the initial values are set within those controls. You can capture the code from those controls and move them to the root level, or you can simply set the stage height to 440px. This puts the controls off the stage and out of reach of the user.

I tried it, it works.