How Do You Create An Easing Out Effect With Actionscript
I am creating a dynamic nav bar for a site and would like to create the ease out effect that you would normally use motion tweening for, with actionscript instead. I have gotten it work somewhat but my problem is that I need my object to reach a certain destination and I can't figure out how to gradually decrease my speed over the length of a distance. Right now my object is not reaching it's end point ...something to do with speed vs. friction, etc. Sorry I don't know physics well. Here is the current code I have placed in my moving object. Can you help?
onClipEvent(load){
currentSpeed = 45;
friction = 3.25;
startPoint = 0;
endPoint = 500;
this._x = startPoint;
}
onClipEvent(enterFrame){
if(currentSpeed > 0){
currentspeed -= friction;
this._x += currentSpeed;
}
}
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-18-2002, 01:23 PM
View Complete Forum Thread with Replies
Sponsored Links:
Actionscript To Create Motion Effect
does anyone know the actionscript i would need to make the moving block (in the fla i attached which is mx 2004) appear to be moving in slow motion, by this i mean as the box moves, it leaves a short trail of itself behind that fades. anyone know how to do this? ps, ive just tried to create the effect manually... it dident work..
View Replies !
View Related
How Can I Create Effect For Text By Actionscript?
Hi everyone,
This is my situation:
In the past, when I want to create a flying text, I alway have to create many symbol <every character is a symbol> then I put them in stage and create motion effect for them by frame by frame. It's too hard, boring and cannot modify content.
How can we do it with action script? And can I change the content of movie by changing the value of variable ?
Please help me!
Thank you so much,
Best regards,
View Replies !
View Related
Create A Real Time Shadow Effect With Actionscript
yuuu hi,
I want to attach a shadow to any MC dynamically with actionscript. Not only for regular shaped clips (rectangles and circles) but also for irregular ones.
The shadow should also be able to follow if the original MC resizes or moves around the stage. Aditionally, the shadow should be able to move and resize in such a way that the MC appears to gain or loose altitude (the effect of separation from the stage, or lifing effect). Of course the latter must be coordinated with proper MC scaling.
here is my mind draft for the simplest approach:
- duplicate target_mc as shadow_mc
- place shadow_mc right below target_mc (with DepthManager)
- apply a color Transform to shadow_mc and make it totally black
- shadow_mc._alpha = 30 or whatever
- offset shadow_mc's position by some pixels
- add a listener to onEnterFrame that coordinates scaling and position between the two clips
- to create the lifing effect, the relation of scaling and position offset must be changed by a factor... and shadow_mc._alpha must be changed inversely to it's scale.
Now, this technique should work out quite well. It does, actually. But there is one BIG problem with it:
Some of my target_mc's are not easily duplicated. They are complex components that have aquired their appearance through a series of processes. They have moving parts or sections, for example. Or they have members that appear and dissapear (like a context menu with sub menus).
Now, the ideal solution would be to trace the target_mc's shape and draw a filled outline with the drawing API, repeating the process on every frame. This is obviously a heavy process... and, how on earth can I trace an MCs boundaries? Maybe by creating a small clip, make it go through the whole area over the movie clip and check for collisions...?
Well, I'm just thinking out loud now...
ActionScript Gamers, please comment!!
I'm sure someone on this planet has this figured out...
I am working on it and your ideas are more than welcome!!
View Replies !
View Related
How To Create An EASING Rotation?
Hi.
I've got a button which when clicked, it rotates a movie clip called 'arrow' by 90 degrees (arrow movie clip is initially of an arrow pointing to the right). I use the very simple code below in my button Actions.
on (rollOver)
{
_root.arrow._rotation = 90;
}
Can anyone help me to create an easing effect on this, so that the arrow movie doesn't just snap from a right arrow to a down arrow?? Bear in mind I'm only using Flash 5 (if that makes any difference).
Thanks for any help.
View Replies !
View Related
Easing Scroll Bar With Create Textfield
I am having trouble applying a easing scroll bar to dynamic content.
Can some help with this?
I have included the fla with my files.
Edit...just comment out mc_tween.as if you dont have the .as. I have removed the tweening script.
Code:
stop ();
#include "mc_tween2.as"
//
var lv_buyingWorks:LoadVars = new LoadVars ();
lv_buyingWorks.onData = function (stateData) {
this.buyingWorks.htmlText = stateData;
};
//
this.createTextField ("buyingWorks", 10, 200, 110, 400, 400);
buyingWorks._alpha = 0;
buyingWorks.embedFonts = true;
buyingWorks.multiline = true;
buyingWorks.wordWrap = true;
buyingWorks.html = true;
buyingWorks.setNewTextFormat (mf);
var lvArticleContent:LoadVars = new LoadVars ();
lvArticleContent.onData = function (sHTMLData:String):Void {
buyingWorks.htmlText = sHTMLData;
};
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.onLoad = function ():Void {
buyingWorks.styleSheet = this;
lvArticleContent.load ("vars/buyingWorks.html");
bottom = buyingWorks._y+mask_mc._height-buyingWorks._height-space;
};
cssStyles.load ("styles/buying_rentingWorks.css");
buyingWorks.alphaTo (100, 2, "linear");
//
fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
y = dragger._y;
top = main._y;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
} else {
this._parent.dragger._y = this._parent._ymouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
} else {
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-buyingWorks._y)/speed)*friction);
buyingWorks._y += dy;
};
};
View Replies !
View Related
Easing Effect
hi,
well i have seen over internet an example of what i want, but i dont remember where and i dont find it.
thats why i ask for your help.
well i want to make an effect, where i have a grid of elements for exameple 5 x 5 squares (25 in total) and where i pass the mouse i have an effect like the mac menu effect.
hope you can help me
thanks
View Replies !
View Related
Easing Effect Problem
Hi there, I doing an easing effect to scale a movieclip from the current size to a targeted size say 50pixel width. The problem is the number is always exceed the targeted size when it's moving, therefore i cant delete my onEnterFrame. anybody out there know the way to solve please let me know.
function moveMe(){
var boxHeight:Number=box_mc._height;
var boxWidth:Number=box_mc._width;
var speed:Number=5;
box_mc._width+=(boxTargetWidth-boxWidth)/speed;
boxWidth=box_mc._width;
trace(boxWidth);
if (boxWidth==boxTargetWidth){
delete box_mc.onEnterFrame;
}
}
thanks
ks
View Replies !
View Related
Cancel An Easing Effect
Hello people !!!
I was trying to make a cartoon men that follow the mouse (as a mouse trailer). I did it and working like I want. When the cartoon are so far from the mouse he runing faster, but when are close to the mouse, he walk.
All this working right, as you can see here, but when the cartoon stop walking he look flying to the last _x position that the easing effect calculate.
Do you figure out a way to cancel the easing, to add to my AS that stop the walking effect. I want to stop the easing when the cartoon stop walking.
Thank you for any help !!!
View Replies !
View Related
How Added EASING Effect? In This
hello, i view the nice tutorial of the simple scroller in kirupa:
http://www.kirupa.com/developer/flash8/scrollbar.htm
now, how can added the EASING efect to this scroller???
the code in:
http://www.kirupa.com/developer/flash8/scrollbar3.htm
somebody can help me!
Pamela.
View Replies !
View Related
Easing Navigation Effect.. Help
cover.onEnterFrame = function ()
{
if (this.hitTest(_root._xmouse, _root._ymouse) == false)
{
destY = 91;
} // end if
};
gal1_btn.onRollOver = function()
{
destY = this._y;
};
gal2_btn.onRollOver = function()
{
destY = this._y;
};
gal3_btn.onRollOver = function()
{
destY = this._y;
};
gal4_btn.onRollOver = function()
{
destY = this._y;
};
gal5_btn.onRollOver = function()
{
destY = this._y;
};
gal6_btn.onRollOver = function()
{
destY = this._y;
};
gal7_btn.onRollOver = function()
{
destY = this._y;
};
arrow_mc.onEnterFrame = function ()
{
this._y = this._y + (destY - this._y) / 10;
};
ok everything is ok. arrow eases and goes where you rolledover. once you leave the hitest it goes back to 91. the original spot. But I want it so that when you click on a button. the arrow now eases back towards the section you just clicked making it the default.
see what I mean? i've tried but im not any good.
thanks.
View Replies !
View Related
Easing Of Scrolling Landscape - 3D Effect
Hi all!
I have this script on each of 3 movieclips (background, trees and gras). The values of some variables of the script below (on the other two movieclips) are a bit different of course, but further they're the same.
I would like to extend this script a bit: when the mouse pointer is in the _ymouse area from 0-50 the landscape scrolls fine. But when the mouse pointer is below 50 px, the scrolling SUDDENLY stops of course. This isn't a nice sight. So I'm trying to decellerate the scrolling (to zero) of the landscape when the user moves the mouse pointer from the 'hit area' to the rest of the stage (y below 50 px).
Anyone know how the code should be modified to achive this effect?
Many thanks!!
The code of 1 of 3 images:
onClipEvent (enterFrame) {
if (_ymouse<50) {
if (_root.mainVar == 0) {
homeX = (-_root._xmouse)+700;
} else {
homeX = (-_root.mainVar)+700;
}
thisX = _x;
diffX = homeX-thisX;
if (_root.mainVar == 0) {
moveX = diffX/30;
} else {
moveX = diffX/5;
}
_x = thisX+moveX;
}
}
View Replies !
View Related
Help With An Expanding And Easing 'rectacle' Effect...
Hi guys,
Before I overcook this spaghetti code, I thought I would ask here if anyone had a simpler way of gaining the effect I'm looking for. I'm designing a shooting game, and I want the 'rectacle' to expand and contract with the movement of the mouse so as to simulate aiming difficulty. The effect I have right now has several problems, but the first one is that the animation is jumpy and moves much too fast.. but for the life of me I cannot see how to approach the problem any other way that the way I've written it. Could someone could take a look at what I have so far, and at least tell me if I'm going in the wrong direction?
Thanks in advance...
david
Code:
stage.frameRate = 32;
var shortLine:Sprite = new Sprite();
var crossRadiusOriginal:int = 5;
var crossRadius:int = crossRadiusOriginal;
var crossLength:int = 20;
var mouseMovePunishFactor:int = 2;
var mousePosThenX = 0;
var mousePosThenY = 0;
var mousePosNowX = 0;
var mousePosNowY = 0;
var mousePosChangeX = 0;
var mousePosChangeY = 0;
var mousePosChangeXAndY = 0;
stage.addEventListener(MouseEvent.MOUSE_MOVE, drawCrosshairs);
function drawCrosshairs(MouseEvent:Event):void
{
Mouse.hide();
mousePosChangeX = Math.abs(mouseX - mousePosThenX);
mousePosChangeY = Math.abs(mouseY - mousePosThenY);
mousePosChangeXAndY = (mousePosChangeX+1)+(mousePosChangeY+1);
mousePosThenX = mouseX;
mousePosThenY = mouseY;
crossRadius += mousePosChangeXAndY * mouseMovePunishFactor;
this.addChild(shortLine);
shortLine.graphics.clear();
shortLine.graphics.lineStyle(2, 0x00AA00, .80);
shortLine.graphics.moveTo(mouseX - crossRadius, mouseY - crossRadius);
shortLine.graphics.lineTo(mouseX - (crossLength + crossRadius), mouseY - (crossLength + crossRadius));
shortLine.graphics.moveTo(mouseX + crossRadius, mouseY + crossRadius);
shortLine.graphics.lineTo(mouseX + (crossLength + crossRadius), mouseY + (crossLength + crossRadius));
shortLine.graphics.moveTo(mouseX - crossRadius, mouseY + crossRadius);
shortLine.graphics.lineTo(mouseX - (crossLength + crossRadius), mouseY + (crossLength + crossRadius));
shortLine.graphics.moveTo(mouseX + crossRadius, mouseY - crossRadius);
shortLine.graphics.lineTo(mouseX + (crossLength + crossRadius), mouseY - (crossLength + crossRadius));
crossRadius = crossRadiusOriginal;
}
View Replies !
View Related
Increasing Easing Effect Beyond Standards?
Greetings all!
Does any of you guys know how I can increase the easing effect for a shape or motion tween beyond the limit in the menu?
It won't go beyond the standard +100 or -100.. but I've seen plenty examples around the net where the easing effect is way more exagerated than the puny +/- 100 you can do via the menu..
So, how do I do this? Will it require that I do the entire movement by actionscripting? Or is there some other way (an easy one) to accomplish this?
hmmm...
View Replies !
View Related
Simple Easing Effect Not Working, And I Don't Know Why
Here's my situation. I have a movie clip called mainClip. Within it is another movie clip called subClip. I am moving the mainClip along the y axis; when it reaches a certain point, then the subClip moves along the x axis.
Here's the basic code:
ActionScript Code:
myButton.onRelease = function() { onEnterFrame = function () { mainClip._y += 10; if (mainClip._y>=100) { mainClip._y = 100; mainClip.subClip._x += 100; if (mainClip.subClip._x>=100) { mainClip.subClip._x = 100; } } };};
But the motions are too abrupt for my taste. So, I'm using a simple easing in script:
ActionScript Code:
endY = 100;endX = 100;speed = 5;myButton.onRelease = function() { onEnterFrame = function () { mainClip._y += (endY-mainClip._y)/speed; if (mainClip._y>=endY) { mainClip._y = endY; mainClip.subClip._x += (endX-mainClip.subClip._x)/speed; if (mainClip.subClip._x>=endX) { mainClip.subClip._x = endX; } } };};
The problem is, the mainClip moves just fine, but the subClip won't move at all. Anyone have any ideas as to why the second script won't work?
View Replies !
View Related
Easing Rollover Effect For Menu
Hi. I'm not all that great with actionscript, so I'll just ask all ya' kirupians.
For my menu, I have a white image that I want to ease into the button on rollover, so it goes from the bottom, where it's not seen, and it eases to fill the button, then the same ease out when the mouse is off of the button. I have no idea how to code this, and I don't want to make movie clips, to keep the file size down.
Help would be greatly appreciated. Thanks.
GBP
View Replies !
View Related
Increasing Easing Effect Beyond Standards?
Greetings all!
Does any of you guys know how I can increase the easing effect for a shape or motion tween beyond the limit in the menu?
It won't go beyond the standard +100 or -100.. but I've seen plenty examples around the net where the easing effect is way more exagerated than the puny +/- 100 you can do via the menu..
So, how do I do this? Will it require that I do the entire movement by actionscripting? Or is there some other way (an easy one) to accomplish this?
hmmm...
View Replies !
View Related
Dynamic Text With Easing Effect?
Hello there,
can anybody show me how to make scroller with easing effect and dynamicly loaded text. I've tried to do it maybe 2-3 days, but ...nothing happens. If anybody have idea, or ready to use code and there is no problem to post it here... please, post it.
10x a lot
View Replies !
View Related
Changing Y Position Of A Movie Clip With An Easing Effect
Hi everybody
I have 6 buttons which are supposed to control the movement of a MC; on each button I set a variable for the y position, ie:
on (press) {
firstvar = -427;
}
My MC has 3 frames, and that´s how the code looks like on each:
1) fri = .1;
2) dify = _root.firstvar-fou._y;
speedy = dify*fri;
fou._y = fou._y + (speedy*1,5);
3) call ("2");
The problem is it just don´t work at all. Is there any way to solve it, or can this be achieved some other way?
Thanks!
View Replies !
View Related
Short Script Notation Multiple Movieclips With Same Effect/easing
Hello,
I'm having a piece of actionscript written for 63 of the same movieclips. All of them start at _alpha = 0 and then one at a time fade in on screen. I've made myself a working actionscript but it's waaaaaay to long.
Now I'm looking for a short script notation for the following code:
PHP Code:
overlap.ovl01._alpha = 0;
overlap.ovl02._alpha = 0;
overlap.ovl03._alpha = 0;
...
overlap.ovl60._alpha = 0;
overlap.ovl61._alpha = 0;
overlap.ovl62._alpha = 0;
// Overlap A + B
overlap.alphaTo(100, 1, "lineair", 2.2)
overlap.ovl01.alphaTo(100, 1, "lineair", 2.2)
overlap.ovl02.alphaTo(100, 1, "lineair", 2.3)
...
overlap.ovl61.alphaTo(100, 1, "lineair", 9.5)
overlap.ovl62.alphaTo(100, 1, "lineair", 9.6)
overlap.ovl63.alphaTo(100, 1, "lineair", 9.7)
I found a script but I can't get it to work.
PHP Code:
//use a for loop to reduce repetition of the code
for(i=1;i<63;i++){
theOverlap=_root.overlap["ovl"+i];
//this variable stores what number button it is
theOverlap.thisNum=i;
theOverlap.onEnterFrame=function() {
this._alpha= 0;
}
}
Can someone help me out?
thanx
View Replies !
View Related
Easing With Actionscript
i want to create an easing effect with actionscript to conincide with an on mouse event action. i've tried using frame labels with motion tweening but that doesn't seem to work. any help would be greatly appreciated!
View Replies !
View Related
Easing Using Actionscript
hello again,
this is what i have:
a movie composed of 4 draggable movie clips "pictures". i can shuffle these pictures around and when i click on each individual one it moves to the front. "like pictures on a table top"
what i need...please
i need a button that arranges these 4 pictures into a grid. each one moving to a predefined _x and _y location. i need the transition of this to be animated, so it isnt just jumping from scattered to arranged. because the pictures could be at any location i dont know how to do this.
thanks for you help
View Replies !
View Related
Easing Actionscript.
I have this code (below) and and it does what it needs to do, but i need it to do it smoothly. At the moment it checks the text length, and then moves the black bar from left to right and makes it the correct length fo the text.
Then the text fades in.
However it needs to ease out and then in. Can anyone doctor the code, or point me in the rght direction?
Code:
var targetBarX:Number
var barMoving:Boolean = false
var greetingText:String
initialise();
function initialise(){
// set up an interval to move the bar. **** about with the number to determine the speed you want
barTweenInterval = setInterval(moveBar,10)
_root.dynatext._alpha=0
getText();
}
myData = new LoadVars();
myData.onLoad = function() {
dynatext.text = this.homeContent;
getTextWidth()
};
myData.load("homecontent.txt");
function getTextWidth(){
// get text from php script here.
// when loaded start the bar moving to correct location
targetBarX = blackBar_mc._x + 60 + _root.dynatext.textWidth
barMoving = true;
}
function moveBar(){
if(barMoving){
blackBar_mc._x += 5
if(blackBar_mc._x>targetBarX){
blackBar_mc._x=targetBarX
barMoving = false
clearInterval(barTweenInterval)
// set up an interval to fade up the text
fadeInterval = setInterval(fadeUpText,20)
}
}
}
function fadeUpText(){
_root.dynatext._alpha+=5
if(_root.dynatext._alpha==100){
clearInterval(fadeInterval)
}
}
View Replies !
View Related
Actionscript Easing
this is some code that I have got offf this website regarding an easing navigation
I think I understand the basics...it moves the MC by an amount that gets samller and smaller until it stops
but there are some things in this scipt that confuse me..
what does the backslash and colon do on the second line
anyway i have commented this code so if you can check it and let me know if im on the right track
starty = getProperty(_root.mc1, _x);
// starty is given the current position of the movie clip
moved = /:targety-starty;
// moved is given the difference between the mc current position and where it wants to be
setProperty(_root.mc1, _x, starty+(moved/15));
// the movie clip is moved by an amount decreasingly smaller until it reaches the position
does that sound about right
cheers
Col
View Replies !
View Related
Easing Via Actionscript?
I'm attempting to make my links move pages of a website that I've created across the viewing area, from left to right, in somewhat of a train. I have it working so that the button plays the file until it reaches a certain keyframe, and stops.
What I want to add is the easing effect between moves, but since the amount of frames in the tween are dynamic, I figured I'd have to try to incorporate more actionscript into it. Any ideas on the best way to go about getting this effect? I want the tween to ease in, get faster as pages pass while it searches for the correct keyframe, and ease out as it reaches the correct keyframe. Any takers?
edi0t@msn.com
t0ide = AIM
View Replies !
View Related
CAN YOU ADJUST EASING THROUGH ACTIONSCRIPT?
I am animating a bunch of individual symbols or graphics for a website. I am trying to go as low as I can on the memory this will require. I have a file that shows the letters moving with the alpha changing and also with easing from -100 to 100. I wish I could attach the file somehow on here for people to look at. Basically, I need to know if it's possible to actionscript an action that has a letter fading in and moving to the left and then moving back to the right with easing all in one frame or whatever takes the least amount of memory possible. You can email me at jakesdesign@hotmail.com to let me know if you could be of any help!
Thanks
View Replies !
View Related
Actionscript Movement With Easing
Okay, I have a fla with an array on the main timeline that contians values for the _x position of a movieclip on the stage. I have buttons that I want the user to click on that will then check the _x of the movieclip and move it to a new value from the array. So the actionscript first needs to know if it needs to move left or right then needs to do the math to move that movie clip across the stage. Can someone help me with the script for this? I also want the movie clip to slow as it nears it's stopping point.
Thanks
View Replies !
View Related
Actionscript Movement + Easing
peepz,
i have seen a script on flash kit about how to move a movieclip to a desired position and ease it out, this in 10 linenumbers...
it's with a onEnterFrame code whitin it...
can someone rewrite or give the URL to me?
thnx already!
View Replies !
View Related
Actionscript Easing Needed
I'm fairly new to Actionscript...I'm trying to make buttons within a movie clip that will make the whole movie clip move, but I want it to ease, not just jump to the correct spot. I'm coding from the first scene....Please help. Thanks! (I use Flash 8, but i've converted the file to MX2004)
View Replies !
View Related
Easing - On(Release) Help With This Actionscript Please.
My goal is to beable to click a button and have a movieclip EASE down 100pixels and stop, and if you click the same button again, the same movie clip will ease down another 100pixels, to scroll through thumbnails. Scroll to a maxium of say 1000pixels down.
I have created a movieclip called "mover"
And then 2 buttons, upbutton downbutton.
upbutton.onRelease = function() {
mover._y-=100;
};
downbutton.onRelease = function() {
mover._y+=100;
};
So the 2 buttons above will move the movie clip up and down, but I want it to ease, not jump to that spot.
Can someone help me with this? Do I need an external control clip that the "mover" clip plays off? is it totally simple, like..
mover._y-100/speed 10;
Thanks for your time!
Dale
View Replies !
View Related
[F8] How To Actionscript Easing For Scrollbar
Hi, I hope someone can help me with this.
I need help with using actionscript to ease/add inertia to scrolling of a movie clip that is controleld by a scroll bar. I hope this could prove more fruitful than other posts on this because I have the scroll bar working, it just works like a normal scrollbar and doesn't ease.
You can view my testing page here
The actionscript basically produces a number which the main content is moved by. It really isn't a complicated setup but I will post my source if someone needs it.
I was previously told setInterval might work but I haven't had any success with that.
Thanks
View Replies !
View Related
Easing My Scrolling Actionscript
i have put together a scene and it works just how i want it to except i would like the movment to ease... i guess what im saying is instead of it being so precise with the mouse movment, id like it to be smooth...
here is the actionscript i am using.
Code:
stop();
var targetx:Number = 2;
onEnterFrame = function () {
targetx = -(((bgplane._width - Stage.width) / Stage.width) * _xmouse);
var dx = targetx - bgplane._x;
bgplane._x = targetx;
}
View Replies !
View Related
Easing Tutorial On Actionscript.org
http://www.actionscript.org/tutorial...em/index.shtml
So i've read the tutorial through several times, tried to do my own but it doesn't work.
So then ive tried looking at the .fla source file and there are some differences in presentation but for some very odd reason i cannot find where the author placed its actionscript, its not anywhere
can anyone help me make understand the easing system and tell me where the actionscript should be?
at the moment when I click on the buttons of my own system it doens't work and an error msg appears:
Symbol=content, Layer=actions, Frame=1: Line 1: Clip events are permitted only for movie clip instances
onClipEvent (load) {
Symbol=content, Layer=actions, Frame=1: Line 7: Clip events are permitted only for movie clip instances
onClipEvent (enterFrame) {
thx
View Replies !
View Related
Rotational Easing Using Actionscript
HELLO
I have alot of faith in you guys please don't let me down.
Does anyone know if how i would go about making a move clip rotate using actionscripted movement. So that when a the mouse moves over it, it moves from its current angle lets say -20 degrees to 0 degrees slowly.
I have tried using the actionscripted motion codes that i understand but am having issues that the motion goes to its rotation and then starts again spinning the object in circles
At the moment I have two buttons progressing the movie to frames which specify the properties.
I know that this isn't probably how to approach this but here is how i started.
onClipEvent (load) {
div = 1.5;
_rotation = 25;
}
onClipEvent (enterFrame) {
_rotation += (endrotation-_rotation)/div;
if (_currentframe=2) {
endrotation = 200;
}
if (_currentframe=3) {
endrotation = 250;
}
}
Does anybody have any advice? please help
View Replies !
View Related
Actionscript Animation With Easing
Hi,
i need to create a var that contains animation instructions that can be called up and applied to a movie clip when a button is pressed.
At the moment i have a movieclip called 'mover' that moves down 54 px when a button is pressed (see below command), but i need it to animate 54px in 1 second with +100 easing, i have had a search on the web but it is not entirely clear how to apply actionscripted animation.
on (release){
mover._y += 54;
}
Cheers for any help.
Rob.
View Replies !
View Related
Easing Movement Using Actionscript
I just followed this tutorial and I did get how it all worked.. and i got my movie clip flying arround the stage.
Then when i tried to apply it to a little project i'm working on, i couldn't get it working.
I have a movie clip called mc_main and when i click a button I want it to move - using easing - to a new position on the stage.
In the first frame of my timeline i have put this AS:
Code:
stop();
/*IMPORTS EASING FUNCTION*/
import mx.transitions.Tween;
import mx.transitions.easing.*;
var MoveHome:Tween = new Tween(mc_main, "_x", Regular.easeInOut, 245, 140, 3, true);
Where I am a bit stuck is how to make that ease happen when i click on the button, not when the movie loads...
Also, as I am bound to get stuck on this later; the movie clip mc_main is not always going to start in the same position. So it has to find its current position first, and then move to the new one...
Any help with this would be great.
View Replies !
View Related
Relative Easing In Actionscript?
So Im wondering if there is an equation for easing to a position relative to its native position using AS. For example, if i want a Symbol to move 100 pixels up from it original position. Is there a way to do this without knowing the Symbols original position?
Heres what I know:
The"non-relative" easing equation in AS is:
Code:
myClip._y += (-100-myClip._y)/speed;
This is all well and good, but it assumes myClip is located at 0
Here's what I tried to do:
Code:
myClip._y += ((myClip._y-100)-myClip._y)/speed;
This did not work at all. It just started going up forever.
So, is there a way to ease something without knowing the Symbols original position?
I know Im missing something. Any help would be great
Thanks!!
View Replies !
View Related
Tweening/easing With Actionscript
i tried to find the answer to this in the forums, and found some helpful stuff, but i still need more clarification. i want to click a button, and move a target movieclip (say, a horizontal line) to a specified y coordinate with easing. what i found so far was:
_x += (target - _x)/speed;
but where do i plug this in? in the button? does target mean the movieclip or the position i want it to go to? sorry if this is elementary, i'm new to animating with actionscript. if someone could give me an example i can understand, i would really appreciate it!!
thanks!
View Replies !
View Related
Actionscript Easing Question About Boxes
I found a question posted on another discussion board about easing and wanted to ask if this is possible...
Is there actionscript I can use to make a box rise to a certain Y value on a button click and descend to a certain Y value when you click the same button?
I'm trying to create a menu with this effect, and I thought it might be better to use actionscript instead of tweening or masking, but I'm not quite sure what is the best way?
View Replies !
View Related
Smooth Scrolling Help (actionscript Easing)
I'm trying to achieve a smooth scrolling effect on my thumbnail navigation.
At the moment when you move your mouse to the edges it scrolls in whichever direction your on, thats all cool, but I'm wondering how hard it would be the make the scroll smooth, such as easing out as you get to one side...
Here's the code for the scroller...
Code:
function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 5;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
Any help would be great, thanks in advance...
View Replies !
View Related
|