Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > Simple Stuff (Newbies)

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-23-2007, 07:13 AM   #1
gammada
Registered User
 
Join Date: Mar 2007
Posts: 7
Default Image slide and bounce fx not working

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;
}
The main AS code is:

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);
};
Thanks in advance for your help!
gammada is offline   Reply With Quote
Old 03-26-2007, 03:59 AM   #2
WhidbeyTomas
The Old Guy
 
Join Date: Oct 2005
Location: Whidbey Island Wa
Posts: 116
Default Removing user control

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
WhidbeyTomas is offline   Reply With Quote
Old 03-26-2007, 04:45 AM   #3
gammada
Registered User
 
Join Date: Mar 2007
Posts: 7
Default

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.
gammada is offline   Reply With Quote
Old 03-26-2007, 05:35 PM   #4
WhidbeyTomas
The Old Guy
 
Join Date: Oct 2005
Location: Whidbey Island Wa
Posts: 116
Default Removing user control.

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
WhidbeyTomas 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

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


All times are GMT. The time now is 10:31 AM.


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