| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Mar 2007
Posts: 7
|
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 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: Code:
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;
}
Code:
//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);
};
|
|
|
|
|
|
#2 |
|
The Old Guy
Join Date: Oct 2005
Location: Whidbey Island Wa
Posts: 116
|
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?
__________________
Thomas |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Mar 2007
Posts: 7
|
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. |
|
|
|
|
|
#4 |
|
The Old Guy
Join Date: Oct 2005
Location: Whidbey Island Wa
Posts: 116
|
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.
__________________
Thomas |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I make a photo slide across with easing | mountaindew | Simple Stuff (Newbies) | 3 | 06-28-2004 02:44 AM |
| elastic bounce | mindsplit | ActionScript 1.0 (and below) | 2 | 07-17-2002 04:07 PM |