Rotate Movieclip Around A Defined Pivot
Simple question.
I am generating 10 segment buttons around a circle using translated ._x and .y coordinates.
I want to add the line.. _root["segment"+i+"_btn"]._rotation = rotate;
But the rotation point isn't right. How do I specify the pivot point that a movieclip rotates around?
Changing the center point of the button makes no difference.
I know from the actionscript reference that the default is 0,0 but I can't find any documentation as to how to change this.
This is what I'm getting at the moment
Can anyone help ?
Thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-11-2003, 11:05 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Clip Mask And MovieClip Pivot Questions
Two more beginner questions:
1) What's the easiest way to invert a clipping mask for a MovieClip in ActionScript? I tried using a ColorTransformMatrix to invert the alpha of the mask MovieClip, but it didn't work (looks like the clip mask simply does nothing where there are no filled shapes). I would like to add a graphic everywhere EXCEPT within the area of an animated MovieClip, and due to various requirements I cannot simply place it behind that MovieClip.
2) Is there a way to set the pivot of a MovieClip in relation to the animated drawings/frames? It looks like the "origin" of a movieclip is the lower left-most corner of all the bounding boxes of all the frames of animation in my MovieClip. So if I set the _x and _y of a MovieClip in ActionScript to 150,150 it places the lowerleft-hand corner there instead of what I would like to be logical center of the MovieClip (say, center of a wheelbase of a car, or center of the feet of a person, or center of mass of a rock). I am fine with dialing in an offset, but just wondering if there is a cleaner way to do it (esp. if I happen to add more animation frames or replace drawings and the bounding box changes size).
Thanks,
--
Ken
How To Dynamically Change The Transformation/pivot Point Of A Movieclip?
Hey guys,
I have a new project where the user can click on a movieclip and zoom in to the point where they clicked. Im thinking to do this i'll need to dynamically modify the transformation/pivot point to the point they clicked (tween it) and then scale the object. Which leads to the question...
Does anyone know how to modify the transformation/pivot point of a movieclip object? Is this even possible? Are there any other alternatives to zooming in on a movieclip? I'm thinking maybe move the object across and up/down while i scale (if its not possible to modify transformation point).
Any help would be appreciated,
Thanks
Defined HitTest Within Movieclip
hey i was just wondering if i can specify the shapeflag of a movieclip that is within another movieclip like,
if (_root.hero.hitTest(this._x, this._y, true)) {
//whatever
}
i tried it and it didnt work, i was thinking maybe it was because since the "this" clip was inside another movieclip, the _x and _y detection of "this" would be off.
MovieClip Defined By Variable
I'm trying to place a movieClip based on a variable.
In as2 you could do this:
this.targetMC.fishHolder.attachMovie(fishMovieClip Name, "mcFish1", this.targetMC.fishHolder.getNextHighestDepth();
How do you do it with AS3? For example, how can I make Spraycan1 relative?
spraycan1=new Spraycan1();
toolLayer.addChild(spraycan1);
Thanks in advance!
How To Pass The User-defined Fuction To/from The Movieclip?
On the _parent timeline, I created an user-defined function, so that it can be accessed by the script inside one of the movieClip and be able to reach out to tweak the property to the other movieClip. I wonder how to do that? I know that I can do the _global but it only work with the variables. I have no idea how to do that with the function. So, any example here that would be very helpful. I did the Google search and it only talk about the object and class.
Thanks..
FletchSOD
[FMX] PLEASE HELP Rotate Movieclip When Collision With Another Movieclip Occurs
hi,
please help me! i've been stuck on this for ages and i can't seem to get it to work! What i'm trying to do is to make my movie clip (plane_mc) to rotate when it collides with another movie clip (cloud_mc). At the moment my plane is controlled by the arrow keys on the keyboard, it is flying through a sky with clouds and when it touches a cloud, i want it to rotate.
If you can help me in anyway, please do!
Thankyou so much in advance
katey "actionscript dummy"
[FMX] PLEASE HELP Rotate Movieclip When Collision With Another Movieclip Occurs
hi,
please help me! i've been stuck on this for ages and i can't seem to get it to work! What i'm trying to do is to make my movie clip (plane_mc) to rotate when it collides with another movie clip (cloud_mc). At the moment my plane is controlled by the arrow keys on the keyboard, it is flying through a sky with clouds and when it touches a cloud, i want it to rotate.
If you can help me in anyway, please do!
Thankyou so much in advance
katey "actionscript dummy"
Movieclip Plays When Pointer Hits Defined _x & _y Coordinates?
Hi
Has anyone heard of, or know of, a method by which a movieclip can be triggered to play simply by having the _x and _y coordinates of the pointer match some boundary criteria set?
Is that even possible?
Read on, if you're interested...
I've got a dynamic text box which I have set up with a series of single line names, which when clicked, are set up to use the asfunction to action another movieclip.
I'm trying to set something up where when the pointer passes over a textline it starts a simple underlay to highlight that text, but I've tried a simple button (does not work because on top of the textbox, it does not let you click the textbox, and under, the textbox stop it from being hit), and I've also tried using Hittest, but that's pretty much having the same problem.
Keeping A Movieclip On The Highest Level/above Two Other Defined Levels?
i have a series of external swf's which all load into a main swf, in one place, upon button clicks (its a portfolio)
what i want is that when an image is already loaded, clicking on a .swf to load a new one into the same movieclip preloads the new file fully before displaying it, oppose to just emptying the target clip and then preloading. Does anyone know the best way to do this?
i dont want any gaps between the images ie the target movie doesnt empty to preload the new one, but does once its loaded
Function Not Defined Immediately After Create MovieClip Instance
Hello kirupa flashers,
I create a new MovieClip, call it Somehow, and link it to the name "MyClip", for example.
Inside of the Clip, there must be a Function like this:
Code:
this.sayHello = function() { return("Hello"); }
(In fact, my script should do different things, but this should be enough at first
In my root frame, i do something like that:
Code:
attachMovie("MyClip", "MyClip01", 1);
trace(MyClip01);
trace(MyClip01.sayHello());
For the first trace i get "_level0.MyClip01", which is correct.
But i cant call the function sayHello(), it says: "Undefined".
And when i put the last line in the second frame, or as a button action, it is working, but
this is not what i want.
The reason is, that i get a big struct object where all the information is stored about
the Clips i have to create and how to initialize them and so on.
It LOOKS LIKE this:
Code:
for(i=1; i<=100; i++) {
attachMovie("MyClip", "MyClip"+i, i);
theClip = eval("MyClip"+ i);
theClip.tellSomething(i*i);
}
They must be MovieClips, because the functions not only response with hello, like in the example.
So I want to create the Clip copies and call the functions in one step. This example is also not working when i put it inside of a onLoad, or onEnterFrame and so on....
And ideas? I doubt that its so difficult...
Eclipse2k
Function Not Defined Immediately After Create MovieClip Instance
Hello kirupa flashers,
I create a new MovieClip, call it Somehow, and link it to the name "MyClip", for example.
Inside of the Clip, there must be a Function like this:
Code:
this.sayHello = function() { return("Hello"); }
(In fact, my script should do different things, but this should be enough at first
In my root frame, i do something like that:
Code:
attachMovie("MyClip", "MyClip01", 1);
trace(MyClip01);
trace(MyClip01.sayHello());
For the first trace i get "_level0.MyClip01", which is correct.
But i cant call the function sayHello(), it says: "Undefined".
And when i put the last line in the second frame, or as a button action, it is working, but
this is not what i want.
The reason is, that i get a big struct object where all the information is stored about
the Clips i have to create and how to initialize them and so on.
It LOOKS LIKE this:
Code:
for(i=1; i<=100; i++) {
attachMovie("MyClip", "MyClip"+i, i);
theClip = eval("MyClip"+ i);
theClip.tellSomething(i*i);
}
They must be MovieClips, because the functions not only response with hello, like in the example.
So I want to create the Clip copies and call the functions in one step. This example is also not working when i put it inside of a onLoad, or onEnterFrame and so on....
And ideas? I doubt that its so difficult...
Eclipse2k
Access To User-defined Functions In Loaded Movieclip?
Hello,
I couldn't figure out how to get it to actually access a function I defined in another swf movie (which gets created at the first frame of the movie), in another movie.
I made a loading screen which gets loaded by an empty movie clip. This is the function that gets created at that first frame in the movie clip instance that gets loaded:
Code:
function UpdateMe(Loaded, Size){
percent = (Loaded/Size)*100;
loadedText.text = "Loaded: "+Math.round(i)+"%";
myLoadBar.scrollLoaded(percent);
trace("Updated!");
}
In another movie clip, which doesn't have anything in it except an Action Script layer, I load an instance of the previously mentioned swf file in the first frame.
Code:
loadingScreen = new MovieClip();
_root.loadingScreen.loadMovie("LoadingScreen1.swf");
The loadingScreen instance shows up, so that isn't the problem.
In frame 3 of this empty movie, I try to call that functon which should have been initialized in that movie clip. Which is from outside it. Not even the trace command works, so I assume that it doesn't even know there's a function.
Code:
_root.loadingScreen.Update("500","1000");
What am I doing wrong? Is it possible to begin with to call a function from outside the movie it was created in?
Any help would be really appreciated,
Thanks in advance!
p.s. Since I don't know how big the final project will end up, I'm not throwing everything in the same .fla file, so everything remains relatively easy to modify and to prevent me getting confused.
[AS3] Error:1119 A Movieclip On The Flash Stage Isn't Necessarily Defined?
I am trying to create a simple concept game with a "magnet", ball, and box. The ball(ball1), box(box1), and magnet(magnet) are movieclips created on the Flash CS3 stage.
This is my code
ActionScript Code:
var ballvel:Point=new Point(0,0);
var grav=-0.01;
var solid_objects:Array=[root.box1,root.magnet]
addEventListener(Event.Enter_Frame,step);
Function step(e:Event):Void{
function test():void{
for (var obs in solid_objects){
if (ball1.hitTestObject(obs)){ballvel.y+=20}
}
}
magnet.x=mouseX
ballvel.x=(magnet.x-ball1.x)/2
ballvel.y+=grav
ball1.x+=ballvel.x
ball1.y-=ballvel.y
}
(Ignore any sytnax errors, as I had to retype this from another computer, but optimization tips would be appreciated since this is insanely sloppy code at the moment)
When I run this I get these errors:
1119: Call to a possibly undefined property box1 through a reference with static type flash.display:DisplayObject.
1119: Call to a possibly undefined property magnet through a reference with static type flash.display:DisplayObject.
Please excuse my ignorance, for I rarely use Flash CS3, but does this mean I must somehow define "box1" and "magnet", or am I reading this totally incorrectly? Please explain either way.
Thanks in advance.
Rotate MovieClip Help
I am having trouble getting my rotator onPress function to work. I am not sure what I am doing wrong. Any help would be appreciated
Code:
obj_mc.onPress = function() {
obj_mc.attachMovie("rotate_mc", "rotator", this.getNextHighestDepth(), {_x:25, _y:-50});
delete this.onPress;
};
//
obj_mc.rotator.onPress = function(){
trace(this)
justPressed = true;
_root.obj_mc.onMouseMove = function() {
oldangle = newangle;
var x = this._parent._xmouse-this._x;
var y = -(this._parent._ymouse-this._y);
var angle = Math.atan(y/x)/(Math.PI/180);
if (x<0) {
angle += 180;
}
newangle = -angle+90;
if (newangle<0) {
newangle += 360;
}
if (!justPressed) {
_root.obj_mc._rotation += newangle-oldangle;
}
justPressed = false;
};
_root.obj_mc.onMouseUp = function() {
trace("The rotation of the clip is: "+this._rotation);
delete this.onMouseMove;
};
}
Rotate Movieclip Around Centre. How?
I've got the below code sitting on the root of my movie.
What it is supposed to do is rotate a movieclip around its centrepoint. What happens, however, is that the movieclip jumps up and to the left of it's starting point on the first iteration of the loop, and then works fine....Any ideas as to why it's doing this?
//Set degrees of rotation per iteration of Rotate function
rotation_speed = 20;
//Get bounds of the movieclip to be rotated
function origin(){
var bounds = mcRotateMe.getBounds(_root);
return {xbounds.xMin+bounds.xMax)/2, ybounds.yMin+bounds.yMax)/2};
}
mcRotateMe.rotation_origin = origin();
function Rotate(){
mcRotateMe._rotation += rotation_speed;
var curr_origin = origin();
mcRotateMe._x += mcRotateMe.rotation_origin.x - curr_origin.x;
mcRotateMe._y += mcRotateMe.rotation_origin.y - curr_origin.y;
}
setInterval(Rotate,300);
How To Drag And Rotate My MovieClip?
On my stage I have a movieClip called "obj_mc", in the first frame I have this code
ActionScript Code:
obj_mc.onPress = function() {
obj_mc.attachMovie("rotate_mc", "rotator", this.getNextHighestDepth(), {_x:25, _y:-50});
this.startDrag()
//delete this.onPress;
};
obj_mc.onRelease = function() {
stopDrag()
//delete this.onRelease;
}
The "rotate_mc" movieClip has a button in it with this code
ActionScript Code:
on (press) {
justPressed = true;
_root.obj_mc.onMouseMove = function() {
oldangle = newangle;
var x = this._parent._xmouse-this._x;
var y = -(this._parent._ymouse-this._y);
var angle = Math.atan(y/x)/(Math.PI/180);
if (x<0) {
angle += 180;
}
newangle = -angle+90;
if (newangle<0) {
newangle += 360;
}
if (!justPressed) {
_root.obj_mc._rotation += newangle-oldangle;
}
justPressed = false;
};
_root.obj_mc.onMouseUp = function() {
trace("The rotation of the clip is: "+this._rotation);
delete this.onMouseMove;
};
}
When I test the movie, everything works; the rotator movieClip gets attached and if I press on the rotator clip I can rotate my obj_mc about it's center.
But I also want to be able to drag the obj_mc. If I add a startDrag to the onPress function of the obj_mc clip, the rotator movieClip doesn't work. I have to comment out the delete this.onPress and onRelease in order for the rotator to work.
How can I correct this?
Rotate MovieClip About Center
I need to rotate my movieClip about it's center. I would like to do this with a small button attached to the corner of the movieClip. Are there any tutorials for doing this?
Rotate A MovieClip Thats Inside A MC
Howdy,
I have a movie clip thats being moved around smoothly via actionscript so that when buttons are pressed it comes to rest in various positions.
Now I would like to have movieClips within this movieClip rotate within.
Check it working ish here
Am I missing something?
I may well be approaching this the wrong way but it really hot here and my brain is slowing down.
I basically want it to look like you are viewing the pictures on a table, and the "camera" is turning as it spins over the next picture. Rather than the pictures sliding into view.
Drag And Rotate Movieclip Problem
Hi All,
I am starting a project which uses movieclips that can be dragged around and rotated/resized by the user.
I have created an MC that has an invisible button on it and have put the following action onto the button
on (press) {
startDrag (this);
}
on (release) {
stopDrag ();
}
on (keyPress "<Down>") {
_xscale -=10;
_yscale -=10;
}
on (keyPress "<Up>") {
with (this) {
_xscale +=10;
_yscale +=10;
}
}
The problem is when I make duplicates of this MC and put it on the screen only the first instance of the MC resizes.
Can anyone point me in the right direction ? is this something to do with depths?
I have given the movies different names and know that I could put an action on each individual movie and use an absolute path but in the future I wish to use a duplicateMovie command to alow the users to put as many MCs on the stage as they like and resize/rotate etc..
Thanks In advance
Shorty
Help: Point To Mouse & Rotate Only If In Movieclip
I'm using Flash 5.
What I want my movie to do:
I have a color wheel movie clip with a pointer arm movie clip in the center. If the mouse if over wheelMC then the pointer should rotate to follow the mouse. If the mouse is outside wheelMC then the pointer does nothing.
What it actually does:
The pointer rotates & points to the mouse where ever it is.
My code is on the pointer movie clip:
onClipEvent (enterFrame) {
if (_root.wheel.hitTest(_root._xmouse, _root._ymouse, true)) {
a = pointer._y-_ymouse;
b = pointer._x-_xmouse;
angleA = Math.atan2(a, b);
degrees = angleA/(Math.pi/180);
setProperty ("pointer", _rotation, degrees);
}
}
How Do I Rotate A Movieclip By Moving Mouse?
Hi all,
I'm sure a lot of you have seen the tutorials for buttonless scrolling (where you move your cursor to the right of the screen and the movieclip scrolls to the left etc). Here is an excellent example...http://www.gotoandlearn.com/ (and then scroll down until you get to the title, 'Scrolling Thumbnail Panel').
Now, I want to use this principle to rotate a MC of the world instead of scrolling the MC left and right. So, as your cursor moves to the right of the screen, the globe rotates in an anti-clockwise direction and visa versa.
Could anyone moderate the code below to make this work? I have a deadline in a week and I'm starting to panic. I've tried a few things but none of them work. Thanks!!
FG.
the code...
panel.onRollOver = panelOver;
function panelOver() {
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds(_root);
function scrollPanel() {
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if(panel._x >= 89) {
panel._x = 89;
}
if(panel._x <= -751) {
panel._x = -751;
}
var xdist = _xmouse - 250;
panel._x += Math.round(-xdist / 7);
}
Flip/rotate Movieclip (rectangle)
Hi there
How can i flip/rotate a movieclip around it's own axis (a rectangle) with actionscript? I have been playing around with _width but i can't make it look good. :(
Simular to this one: http://www.templatemonster.com/flash-templates/16467.html
How Do I Rotate An Arrow To Point At A Movieclip?
I need to:
a) Gradually rotate an arrow to point towards a moveclip (this is simple)
and
b) Have it to take the shorter path (either clockwise or counter-clockwise depending on the situation). (can't figure this out)
Can I get some help with the math and/or pseudo-code?
Thanks!
Rotate Movieclip On Mouse Press
HI all,
Please help me to achieve this.
I have attached my fla. I want rotate the mc by Mouse drag. But its get some of the jerk, So plz find out my fault and give the solutions
Please.... Its very urgent....
Regards,
Suresh J David
Movieclip Rotate On Mouse Cusor Movent
is there a way to make the obect rotate from the mouses movement similar to gun turret on a tank ,, or just get the movieclip to rotate would be a start , the script is not sure
shooter.onEnterFrame = function(){
if(_xmouse >= movieclip){
//rotate
}else if(_xmouse <= shooter){
trace("no");
//dont rotate
}
}
Rotate Movieclip According To Mouse Direction, Drag
Hi!
Is it possible to rotate movieclip, while dragging, according to mouse direction and mouse x, y on that clip.
on the picture the 0, 0 of the mc containing red box is where the lines cross, the mouse point is indicated with cursor and around it is the circle where clip's x and y should be constrained and movieclip should rotate according to mouse movement direction for example: when mouse is moving straight down then the clip's x, y rotates up and stops when its 12 o'clock...
Does it make any sense?
Getting An Arrow (movieclip) To Rotate And Point At The Mouse Cursor?
Hi all, my first post. Hopefully some helpful folks will help me out
I'm not sure how to script this, and am struggling to find something that demonstrates it to me.
I simply want a movieclip (which will be an arrow) to constantly point at the mouse cursor. So it will be rotating around, as if looking at the cursor as you move it around the screen.
it doesnt actually have to point at the mouse cursor though, it could just point at another movieclip, which the user will drag about.
does anyone have a script lying around that could do this? Or know of a fla somewhere that i can use?
thanks!
Phil
Random Movieclip @ A Random Partly Defined Position
Ok I´ve searched this forum to death but i didn´t REALLY
find the answer to my question! I think it can´t be that
difficult but i´m new to action-script and so i gotta hope
u´ll know the answer :
I´ve got an movie. (uh yeah ^^) in this movie there are
many movieclips that contain animations. now i want these
mcs to appear randomly @ a random position of a few defined
positions.
I really got NO idea how to do this !*prayinforyahelp*
ok thx 8]
Simple Circle Rotate (Ring, Donut Rotate)
Why this simple rotation doesn't look nice?
Download FLA Movie
The animation it's a simple ring/donut, thats rotate around it's own axis.
It's a simple 2D animation, do you have some tips to do that rotation?
Many... Many Thanks!
[CS3] Pivot Point Help
I've been using flash for quite a while but not really made a movie yet, so I know quite a bit of it.
With the character I made, I want it to move its arms and legs to make it walk.
I'm trying to do this using the pivot point tool.
Ive made each leg and arms symbols and put them in separate layers.
I've moved the pivot point in the left up to the hip part of the character and moved/rotated the leg backwards.
I've done the same to all the legs and arms and I've motioned tweened it.
BUT when I play the movie so far, the legs and arms flip rotated and do all sorts
of weird stuff and at the end keyframe it just goes BANG and then it goes to where i intentionally wanted it to go.
Can anyone help me with this, or know a different and easier way to animate a walking action BESIDES the frame by frame onion skin way.
Thanks
Pivot A StartDrag?
Hi,
I'm trying to build a record player and want the needle to be draggable onto the turntable when the user clicks on it, which i can do. I'm trying to find out if I can apply a pivot to the top end of the tone arm so it acts realistically.
I've been looking for ages for a solution, but cant seem to find anything. Also tried using rotation, but it doesnt react realistically to the mouse pointer, which needs to be over the needle all the time.
Any pointers or help would be great.
How To Detect Direction Of Movieclip And Rotate To Face Direction
Hi!
I have searched this forum, but Im not really sure what to search for, so I havent found anything similar to this. If anyone know, then please post the link to that thread.
I am trying to do some sort of aquarium with random moving amoebas.
But I want the amoebas (movieclips) to detect in what direction (angle) they are moving and rotate so that they "face" the direction they are going in.
I also post the fla file here so anyone can download it to see what I mean.
Thanks in advance
Detect Direction Of Movieclip And Rotate To Face Direction?
Morning all!
Little thing bugging me here.....
I have a movie clip which moves around the stage randomly, but I want it to face the direction it randomly changes to. Can you help or shed some light for me?
Here is my code:
PHP Code:
onClipEvent (load) {
width = 600;
height = 450;
speed = Math.round(Math.random()*2)+1;
x = Math.random()*width;
y = Math.random()*height;
this._x = x;
this._y = y;
x_new = Math.random()*width;
y_new = Math.random()*height;
}
onClipEvent (enterFrame) {
if (x_new>this._x) {
sign_x = 1;
} else {
sign_x = -1;
}
dx = Math.abs(x_new-this._x);
if ((dx>speed) || (dx<-speed)) {
this._x += sign_x*speed;
} else {
x_new = Math.random()*width;
}
if (y_new>this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new-this._y);
if ((dy>speed) || (dy<-speed)) {
this._y += sign_y*speed;
} else {
y_new = Math.random()*height;
}
}
I have experimented with:
_rotation = (Math.round(180 / Math.PI * Math.atan2(diffy, diffx)) + 360)
and also this._rotation += 1; but not having much luck. Thanks for looking and helping if you can
Pivot Points Or Anchor
ok i wanna make an animated animal so i am making all the body parts but have no idea how i could set pivot points. does anybody have any input on how i can do this?
thanks for your time,
jason
Pivot Point, Joint
could somebody tell me how i can do a joint movement or kinda make 2 movieclips seem connected and bend at that point? what im looking for is something like what i seen on the featured section with a menu that had a slider with an arm attached to it. i cant find the site again so ill just explain. its almost like an arm, you could drag the hand and the other arm parts seem to follow and pivot at the elbow and shoulder. thanks for your time everybody.
Pivot Point '_rotation'
when you use the 'my_mc._rotation' string, is there any way to make the pivot (center of rotation) different from the center of the movieclip?
cheers,
stwelin
[F8] How To Modify The Pivot Of An Object?
Hey guys,
Just doing a simple out animation of some boxes and i want them to slightly decrease in both x and y scale when they fade out. My problem is that when i say to modify the _xscale and _yscale of an object it uses the top left corner of the object as the pivot.
So basically at the moment i have:
PHP Code:
function boxesOut():Void {
new Tween(boxes_mc,"_alpha",Regular.easeOut,100,0,0.5,true);
new Tween(boxes_mc,"_xscale",Regular.easeIn,boxes_mc._xscale,90,0.5,true);
new Tween(boxes_mc,"_yscale",Regular.easeIn,boxes_mc._yscale,90,0.5,true);
}
What can i add to change the pivot to the centre? So the object is shrinking towards the centre and not the top left corner.
Any help would be appreciated, thx
[MX04] Pivot Script?
I'm making a platformer that requires the player to use the mouse to aim, and I'm trying to make it so that the character's arm pivots to point at the cursor's current position. I made some quick images in Paint to show you what I mean:
The white box represents the cursor, the green box represents the character, and the blue line represents the arm.
As you can see, the arm has pivoted along with the cursor's position.
I also want it to flip the character depending on which side the cursor is on (cursor on the left=character faces left, cursor on the right=character faces right)
I know it's asking quite a bit, but it would really help me. I hope you know what I'm talking about, and thank you very much.
~TJ~
[MX04] Pivot Script Help
I'm making a platformer that requires the player to use the mouse to aim, and I'm trying to make it so that the character's arm pivots to point at the cursor's current position. I made some quick images in Paint to show you what I mean:
The white box represents the cursor, the green box represents the character, and the blue line represents the arm.
As you can see, the arm has pivoted along with the cursor's position.
I also want it to flip the character depending on which side the cursor is on (cursor on the left=character faces left, cursor on the right=character faces right)
I know this may be tough, but I really need it. Thank you,
~TJ~
Tweening Pivot Points?
Hey all.
I'm currently working on a project that's supposed to be strictly based on timeline animation.
Yepp, it's that ol' bookflip thingy again.
Using this tutorial: http://www.oreillynet.com/pub/a/java...lashhacks.html
I've managed to get the frontpage (A) and the backpage (B) to work properly. The problem is the Flippage (C). Without using script I need to sort this animation out.
While turning page C needs to go beyond it's line of symmetry. So I need the pivot points to change from bottom left to bottom right over the course of a 50 frame animation.
What occurs when I try this out is that the first 49 frames animate according to pivot point at bottom left and then at frame 50 it snaps to the position of the pivot point at bottom right, so there's no tween for the pivot points.
So I ask...
Is it possible to tween the pivot points position or can't it be done?
And if it's not possible, what are my options besides frame by frame animation or action-script (which isn't an option in this case).
regards / Johan
Drag On A Pivot Point?
hi
is it possible to do a drag function around a pivot point? i have an mc of an arm which i need to drag around but 1 end needs to be fixed to a point...cheers
Pivot Point In Papervision3D (AS3)
I was wondering if you guys had any hints on an easy way to set a pivot point for a plane to rotate around. Is there a way to set the pivot point that I missed, or is this something that requires a little coding to accomplish?
Thanks in advance for any help.
-Scott
Dragging Around A Pivot Point
i have mr sekasi to thank once again for this piece of code...which i have altered slightly to add an onPress to begin the drag however i cannot seem to stop the drag...i have tried deleting the onEnterFrame...the function but just not happening...i guess it`s pretty simple but???
thanks in advance
Code:
function drag(){
this.onEnterFrame = function(){
var dx:Number = _xmouse - moo._x;
var dy:Number = _ymouse - moo._y;
var angle:Number = Math.atan2(dy, dx) * 180;
moo._rotation = (angle / Math.PI) - 90;
}
}
moo.onPress = function() {
drag()
}
moo.onRelease = moo.onReleaseOutside = function() {
delete drag();
}
Default Pivot Point In 2004?
Hi,
Have just upgraded to 2004 and was wondering if you can set the default pivot point to the centre of an object when you create a MC or graphic. I am trying to do some animations and it is making life a nightmare cos it keeps making symbols default to top left..
any help greatly appreciated
cheers
speakers:
|