-
Hi Everyone
Im trying to animate using actionscripting, not through tweening.
For example:
On press
Make mymovieclip goto posotion x.y.
It's easy to do it by tweening, but how would i do it in actionscripting???
Also, was wondering how many people use flash and 3D (not swift, i mean real 3D like Maya or softimage)
Just curious!
thanks all!
-
Actually people use Swift 3D alot, however, not for the program, but because of the conversion factor. You can convert 3D Max and other files to SWF and then import them into Flash.
To change a x or y value of a moive clip:
_root.movieclip1._x = 100;
_root.movieclip2._y = 230;
movieclip67._x = (someVar + otherVar)/2;
-
I know, i use swift 3D too for that evry same factor (although id wish they brought out a Maya Plug in!!)
What i meant was, are there many people out there who use Flash and 3D, but use 3D and keep the 3D in 3D and not use it for flash in any way! Not combined. I am just curious to see what percentage of Flash people use 3D(not flash 3D).
How many people using Flash would like to get into 3D, like motion picture, advertising, gaming etc
Cheers
-
As for the code, it works great.
Using
_root.movieclip1._x=100 makes the movie goto that x coordinate. But instead of popping up in that x coordinate, i want it to 'move/tween' to that coordinate.
Any suggestions?
-
FK M.D.
you don't want timeline A/S, you want MC A/S.
click on your MC and add this A/S to it.
Code:
onClipEvent(enterframe){
if(this._x<100)
this._x++; //this is the same as this._x=this._x+1
}
This will move it from wherever it is below 100 to 100 horizontally. You can get fancier and accelerate it, give it a bounce, etc.
Good luck
-
flash mangler
for acceleration/deceleration, I use Robert Penner's easing functions, they are fantastic.
http://www.robertpenner.com/
I'd write my own, if my brain were big enough...
-
Originally posted by pheck
you don't want timeline A/S, you want MC A/S.
click on your MC and add this A/S to it.
Code:
onClipEvent(enterframe){
if(this._x<100)
this._x++; //this is the same as this._x=this._x+1
}
This will move it from wherever it is below 100 to 100 horizontally. You can get fancier and accelerate it, give it a bounce, etc.
Good luck
actually, time line AS is preferable. it keeps your code centralized. with the new mx event handlers, you get the best of both worlds:
Code:
movieClip.onEnterFrame=function(){
if(this._x<100)
this._x++; }
-
if you want a smoother animation you can stick this code on the movieclip of the object you wanna move:
onClipEvent (load) {
_root.goX = _x;
_root.goY = _y;
}
onClipEvent (enterFrame) {
_x = _x+(_root.goX-_x)/15;
_y = _y+(_root.goY-_y)/15;
}
then when you wanna move the object, set the variables _root.goX and _root.goY to the X and Y co-ords you want it to go to.
speed up/slow down the easing with the '/15' bit.
-
FK M.D.
Originally posted by bit-101
Originally posted by pheck
you don't want timeline A/S, you want MC A/S.
click on your MC and add this A/S to it.
Code:
onClipEvent(enterframe){
if(this._x<100)
this._x++; //this is the same as this._x=this._x+1
}
This will move it from wherever it is below 100 to 100 horizontally. You can get fancier and accelerate it, give it a bounce, etc.
Good luck
actually, time line AS is preferable. it keeps your code centralized. with the new mx event handlers, you get the best of both worlds:
Code:
movieClip.onEnterFrame=function(){
if(this._x<100)
this._x++; }
he's right! forgot about that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|