Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




3D Movie Clip Follow Mouse Problem



Hi. I am an actionscript beginner and wondering if you can help me? I would REALLY appreciate your help with this.

I made spiral rotating line in 3D space animation using Flash CS4. I would like for my 3D spiral Movie clip to follow the mouse movements of a visitor.

My code works.....but....the spiral decreases in size and eventually disappears when moved to certain sections.

In short, what I am trying to do is to keep my spiral effect constantly the same size and movable on the screen.

Here is the code

addEventListener(Event.ENTER_FRAME, rotate3D);

function rotate3D(e:Event):void
{
spiral02_mc.rotationX += 1;
spiral02_mc.rotationY += 2;
spiral02_mc.rotationZ += 3;
}

spiral02_mc.addEventListener(MouseEvent.MOUSE_OVER , pressHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, releaseHandler);
function pressHandler(event:MouseEvent):void {
spiral02_mc.startDrag();
}
function releaseHandler(event:MouseEvent):void {
spiral02_mc.stopDrag();
}



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 02-01-2009, 08:22 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Movie Clip Follow Mouse
What do i need to do to have a movie clip follow my mouse around the stage? Thanks

Making A Movie Clip Follow The Mouse
how do you make a movie clip follow the mouse horizontally only when the mouse goes over a certain area of the stage instead of the whole movie?
I have buttons that I would like a line to follow the mouse when it goes over them.

Thanks!

stacey

On Rollover, Movie Clip Appear And Follow Mouse?
Can anyone help me with this. I want a movie clip (specifically, some text in the form of a MC) to appear and follow the mouse when it rolls over a specific area and dissapear on rollout. can anyone help?? thanks!!

Rotation On Movie Clip, Follow Mouse
I am creating a game where I have a turret (a movie clip) on a helicopter (also a movie clip) , and the helicopter has action scripting to move with the W, A, S, and D keys, and the custom cursor is crosshairs. I want the turret to follow the mouse with rotation only, and follow the mouse whether the mouse is moved and the helicopter isn't, or whether the helicpter is moved and the mouse isn't, or if both are. I am using MX and I would appreciate any help. I have searched the tutorials. Thanks for your time.

Movie Clip Pivots To Follow Mouse
Hello group-
I am new to posting, so here goes: I am trying to have a slingshot follow the mouse from a pivot point: that is, have it rotate from its registration point, not follow the mouse around the stage, or have 36o-degree rotation. The mouse will pass over an invisible button, which, on press, will go to and play an animation in a different scene, of a rock zooming to the target. This in turn will go to and play another animation in a different scene. I have a very basic understanding of Actionscript, and I am working in Flash MX (my school won't upgrade).

Thanks in advance!

Making A Movie Clip Follow The Mouse
I have a movie clip following the mouse. I just need to know the name of the function that makes flash redraw instantly instead of at the end of the function.

in director this function is called updateStage()

Example:

function gameLoop(){

clip1._x = _xmouse;
clip1._y = _ymouse;
updateStage(); //redraw

// other statements
// other statements
// other statements
// other statements
// other statements

}

Movie Clip Rotation To Follow Mouse
Hey,

First off, lemme start by saying that this site is incredibly awesome. Every time I have a problem or wish to learn something in Flash I turn to kirupa.com. Thanks a lot!

Now for my problem. Have you ever played Madness? You know how, depending on where the mouse is, the hand rotates i.e. points at the mouse's current position? Well, I want to learn how to do that. I've attached a short animation demonstrating what I want to be able to do (the arrow points at the mouse's position, and then gun represents the movie clip that rotates) using a script provided by the kind soul who will be willing to help me.

Thanks again,
-Raven~Storm

Help-Movie Clip Will Follow The Mouse Movement
Hi everyone,
I'm neither a beginner nor a pro in AS. Would u pls help me in this issue-this is very imp and urgent.

Pls visit http://www.mindengine.com/ This is a cool site. I want to replicate the movement of it-only the initial part where user moves his mouse and the whole screen moves. I need this part to replicate.

Can u help me, pls, pls...

Thanks.

Follow The Mouse+movie Clip Roll Over
Hello, I'm trying to make a movie clip following the mouse when I roll over to another movie clip. I'm trying this code but it does not seems to be working:
Code:

_root.moshe.onLoad = function() {
   this._x = 0;
   this._y = 0;
   speed = 5;   
}

boxer.onRollOver = function() {
   _root.orn1.gotoAndPlay(2);
   _root.moshe.onEnterFrame = function() {
   endX = _root._xmouse;
   endY = _root._ymouse;
   this._x += (endX-this._x) / speed;
   this._y += (endY-this._y) / speed;
   }
};

Any suggestions would be greatly appreciated, thanks.

Detect Mouse _x & _y Attach Specific Clip And Have It Follow Mouse
I'm trying to make a clip that will have another clip attached (eventually it'll be a mask) when you roll over it. I want the mouse positon to be determined on rollover and a different clip (with different registration point) to be attached depending on which quadrant you rollover first. IE- you rollover the lower left quadrant of the mc first so an mc with an upper right registration point is attached and follows the mouse.

basically I want it to look like you're pulling a mask from out of nowhere onto the main mc from whatever corner you start on... (make sense?)

i'm trying to reconstruct what you see here (http://www.mullerphoto.com/)
this is the first baby step!

anyhow, here's my AS and i'll attach the .fla any help is great! I have the actionscript dictionary and am not afraid to use it, I just need help with the mechanics of how to actually do this (i.e.- which methods, properties, etc. to utilize) thanks!


Code:
leftfunction = function(){
if (patch._ymouse <= 100){
llowerfunction;
}else{
//this function starts the maskclip coming in from the upper left with a lower right reg point
_root.patch.attachMovie("lowerright", "lrclip", 1);
lrclip._x = _root.patch._xmouse;
lrclip._y = _root.patch._ymouse;
}
}

llowerfunction = function(){
//this function starts the maskclip coming in from the lower left with an upper right reg point
patch.attachMovie("upperright", "urclip", 1);
urclip._x = patch._xmouse;
urclip._y = patch._ymouse;
}

rightfunction = function(){
if (patch._ymouse <= 100){
rlowerfunction;
}else{
//this function starts the maskclip coming in from the upper right with a lower left reg point
patch.attachMovie("lowerleft", "llclip", 1);
llclip._x = patch._xmouse;
llclip._y = patch._ymouse;
}
}

rlowerfunction = function(){
//this function starts the maskclip coming in from the lower right with an upper left reg point
patch.attachMovie("upperleft", "ulclip", 1);
ulclip._x = patch._xmouse;
ulclip._y = patch._ymouse;
}

_root.patch.onRollOver = function() {
if (patch._xmouse <= 150){
leftfunction;
}else{
rightfunction;
}}

Moive Clip To Follow Mouse
I would like a movie clip to follow the mouse along its horizontal position.

I am using this code:

onClipEvent (enterFrame) {
setProperty (this, _x, _xmouse);
}

but it causes the movie clip to flash and not follow the cursor tightly.

Is there a better way?

Can I Constrain A 'follow Mouse' Clip To Certain Areas Of The Screen?
Hi there

got a clip that follows mouse on the Y axis ...

As it stands, the clip is active and follows the mouse up and down the WHOLE screen

Would like to set it up, so that it only follows between about an inch or two of the screen

Here is the code ive used to set up the mouse follow

//y movement

my9=_root.content._ymouse;
if (my9<_y) {
dy9=_y-my9;
}
else {
dy9=my9-_y;
}

moveSpeedy9=dy9/5;
if (my9<_y) {
_y=_y-moveSpeedy9;
}
else {
_y=_y+moveSpeedy9;
}

//x movement

mx9= 300;

moveSpeedx9=dx9/10;
if (mx9<_x) {
_x=_x-moveSpeedx9;
}
else {
_x=_x+moveSpeedx9;
}
}

X movement not important, just want the clip to follow when the mouse is somewhere between 150px and 350px from the top of screen

Could really use some help here ... any ideas?

Cheers for any time and suggestions you can give

G

[F8] Make Textmovie Clip Follow The Mouse Cursor
Hello
How can I, on roll over, make a smallsimple movie clip just with some text on it follow the mouse cursor while it is over the area selected?
Thanks, cumps

[F8] Make Textmovie Clip Follow The Mouse Cursor
Hello
How can I, on roll over, make a smallsimple movie clip just with some text on it follow the mouse cursor while it is over the area selected?
Thanks, cumps

Follow Mouse Outside Movie
Hey guys

Is it possible if I have a movie on my page and a movie clip inside, to get the movie clip to follow the mouse position left and right when the mouse is anywhere on the page (not just over the movie) ??

If so how ??

thanks

Movie Follow The Mouse
Hi mates
i m making a site and want its movieclip to follow the mouse (left,right,up,down to the end of the picture i masked and had put in the mc)i used most of the codes here on the forums but all it does is it moves fine but the whole pic inside the movie clip dissapear and the background color appears i want it to stop at the end of the pic in the mc (to stop at the left,right ends of the image i use as mc)

i know it may be a stupid question and i didn't explain it well but here is what i mean and want to do

http://www.fifastreet.com/

please take a look and tell me

Cheers

Attached Movie Mouse Follow
quick question...


i have attached a movie to the stage like this....

code:
_root.attachMovie("Circle", "xLargeC", 3501);
xLargeC._x = 37.5;
xLargeC._y = 85.0;
xLargeC._width = 18;
xLargeC._height = 18;
_root.attachMovie("Circle", "yLargeC", 3502);
yLargeC._x = 13.6;
yLargeC._y = 110.1;
yLargeC._width = 18;
yLargeC._height = 18;


now i want the xLargeC to follow my mouse movement on a horizonal path... and the yLargeC to follow on a vertical path? make sense? if i move my mouse up the yLargeC moves up too but never left or right??? so i just need some type of way to write the AS on this...

Thanks,
Carlos

Mouse Follow But With Movie Anchored?
How do I get my 'mouse follow' action to work whilst the actioned movie clip is anchored to one point? ie: an eye in the head of a stationary character - the pupil watches what you are doing, following the mouse but not leaving the charcters head?

Duplicated Movie Clips To Follow Mouse
Hi all,

I have a simple movie clip (a circle) duplicated 10 times using the following actionscript.

n=0;
while (n<10) {
duplicateMovieClip ("_root.circle", "mc"+n, n+1);
setProperty ("mc"+n, _xscale, n*10);
setProperty ("mc"+n, _yscale, n*10);
n=n+1;
}

How do I get each movie clip to follow the mouse on the X axis only?

naes

How Do I Make A Flash Movie Follow The Mouse
Ok. I want to have somethign going left to right be followed by the mouse, and i wana have it masking my sites name. I know the masking i made what it looks like but how do i get JUST the mask to follow it? plz help me

Crit Movie And Very Advanced Mouse Follow?
Hi guys!

Firstly it would be nice of you to crit my freelance cartoon website...

http://uk.geocities.com/tris3d@btinternet.com/main.swf

... I know this isn't the place to post but the main reason i'm here is help! The movie is very rough and is 900kb's without preloader so sorry about that.

Anyway, I spent ages creating this site ( lack of programming knowledge ) and now that i finally came close to finishing I think its to messy for a cartoonist site.

Now i've got an idea for a more simplistic version but the only thing standing in my way is the code for a very advanced mouse follow.

http://www.kirupa.com/developer/mx/mousetrailer.htm

Funny enough its not that much different from the above effect except i really want to have a mechanical arm instead of text and imagine in that tutorial that the last letter was contrained to something.

Just to complicate things i wanted the hand to be able to point in the direction that the mouse follows with smooth animation so it doesn't just have the four directions. Is any of this possible? Would love any help or at least someone to tell me its not possible to stop my excitement for the new look freelance web site.

This has been a superb forum for helping people like me that have ideas but will always have programming barriers.

Thanks in advance for any help.

Mouse Follow But With Movie Anchored? Solution Found
Found the code on this site - It only needs 2 lines of code deleted and your ready to rock.

http://www.actionscript.org/tutorial...se/index.shtml

If you want the movie to chase after the mouse leave this code as it is at the above url, if you want to anchor it to it's staring point then use this:

onClipEvent (enterFrame) {
myRadians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
myDegrees = Math.round((myRadians*180/Math.PI));
_root.yChange = Math.round(_root._ymouse-this._y);
_root.xChange = Math.round(_root._xmouse-this._x);
_root.yMove = Math.round(_root.yChange/20);
_root.xMove = Math.round(_root.xChange/20);

this._rotation = myDegrees+90;
}

A Movie Clip Follow Another?
I had used motion tween to move the first movie clip, now the problem is, I need to make another separate movie clip to follow the first movie clip when it was moving in a motion tween, is there any ways to do that? Pls help..

Thanks

Follow Movie Clip
hi
i have a movie clip that moves using _x, i want to know how i can have another movie clip follow it.

Follow Movie Clip
I have a forklift which can do anything (raise lower fork, and move forward or backward) and I have a object that I want the people to have to lift. I figured it would be a hitTest but i dont know. What I need done is when the fork ("Tyne") hits the object ("op_hit") the object follows the fork wherever it goes.

I tried this code but it did not work:

onClipEvent(enterFrame) {
if(this.hitTest(this._parent._parent.myFork.mast.T yne)) {
setProperty(this._parent, _x, Number(getProperty("/myFork/mast/Tyne", _x))+20);
}
}

Thanks in advance for help.

Follow Movie Clip
How do I make a movie clip follow another movie clip? Kinda the way I can make things follow the mouse pointer? I have no idea how to write the code ....will somebody help ?

Follow Movie Clip
How do I make a movie clip follow another movie clip? Kinda the way I can make things follow the mouse pointer? I have no idea how to write the code ....will somebody help ?

Movie Clip Follow
how do I get one movie clip to follow another?

Thanks

Follow A Movie Clip?
How do I make it so that a movie clip follows another movie clip?

Getting One Movie Clip To Follow Another DYNAMICALLY
Ok, I'm trying to create some circles (or balls, whatever) that connect to a line and "stick" to the line, no matter where the line might move...like a strand of pearls. So, if the first "ball" moves up, the entire line of balls will follow suit.

Sort of like a mouse trailer, but not on a mouse. Just a free-standing Movie Clip that I can use again and again.

I'm using MX.

Thoughts?

Thanks!

Make One Movie Clip Follow Another? HELP
Okay. Here is the scenario. I have a movie clip that you can click and drag. (its a mask by they way). I want to put a border around the mask though without the border becoming part of the mask. Im sure there is a better way to do this but I'm running out of time. Someone told me I could make the border its own movie clip and put actionscript to it onEnterFrame so it's position is always the same as the position of my draggable clip. In essence im dragging one clip but another one is going along for the ride as well at the same exact position. I just dont know the syntax to do this.

Attatched to my draggable clip is:

on(press) {
startDrag(this,false);
}
on(release) {
stopDrag();
}

I just want a secong movie clip go wherever this one above gets dragged.

Thanks in advance.

Ari.

How Do I Make A Movie Clip Follow Another Mc?
hi ppl,
I am trying to make a movie clip follow another movie clip.

I have llokewd everywhere, but all i can find is how to make a movie clip follow the mouse. Im trying to find some code so that a movie clip will follow another movie clip.

thanks in advance

[F8] Getting A Movie Clip To Follow A Path Around Another One
how does one make a move clip follow a specific path around another one? i have been trying for the past like 3 hours and i can't figure it out. if i have a square and another movieclip, and i want the movieclip to "roll" around the edges of the square, how can i do it?
if you can, please help me!

Attaching A Movie Clip To Follow Another...
Hi Guys,

Anyone remember the centipede game? I have a similar situation where after you eat a bug it is supposed to attatch to your body in a different form and follow you around.

I've got the Flash 8 AS bible but this is like looking for a needle in a haystack. Can anyone tell me where to start with an AS function? Or even which AS to use as I don't think attachmovie will do it...

Cheers

How Could I Get An Arrow To Follow A Movie Clip?
Is there anyway to make an arrow point to a moving movie clip, besides moving the arrow every frame?

How Can I Have A Movie-clip/graphic Follow A Path?
Let's say I draw a nice curved path (with a decent width) and I want movie clips to follow the curve path (inside of the path, in the middle).

How would I do this?

Thanks,
John

[F8]How Do You Make A Movie Clip Follow A Object?
How do you make a movie clip follow an object? I have no clue.

Making The Stage Follow A Movie Clip?
Hey crew. Im new. Hi! xD Having a wee trouble with this semi platformer im trying to make.. Anyone got an idea how to make rest of my screen move with my character?

Like.. i dont want screen till move until oliver gets close to the edge.. then screen goes with him.. the camera.. yknow? just like in super mario or something ^_^

...HELP!

Thanks xD

Menu/movie Clip...image Follow
at this site on the right hand site... there are 3 menu options...with one white box that follows where your curror goes. i can acomplish this but the movie i make snaps the white bow back to the top...anyone know how this is done????? http://www.blitzds.com/relaunch.html thanks for the help

Menu/movie Clip...image Follow
at this site on the right hand site... there are 3 menu options...with one white box that follows where your curror goes. i can acomplish this but the movie i make snaps the white bow back to the top...anyone know how this is done????? http://www.blitzds.com/relaunch.html thanks for the help

[F9] Making A Movie-Clip Follow A Path (Pathfinding)
Hi,
I've been working on an A* based path finding game.
I can work out a path and all that using a*, but my question is; how do i make a movie clip follow this path from start to finish instead of just drawing out the best path.

My first thoughts are to create an array of the paths points and use that, but i'm unsure of how

any help would be great


jack

Having A Movie Clip Follow Another Symbol Twitch Glitch
Alright, I'm having a problem with my interactive thing. There's a twitch when this thing follows the other movie clip. Here, look-
http://img.photobucket.com/albums/v4...efka/Chase.swf

This is the action script I have for the thing that chases(the thing being chased has the instance name of chasee)-


ActionScript Code:
onClipEvent(load){
speed=4
}
onClipEvent(enterFrame){
if(_root.chasee._x > _x){
_x += speed
}else if(_root.chasee._x < _x){
_x -=speed
}else if(_root.chasee._x == _x){
_x +=0
}
if(_root.chasee._y > _y){
_y+=speed
}else if(_root.chasee._y < _y){
_y -= speed
}else if(_root.chasee._y == _y){
_y +=0
}
}

Good Method For Making Movie Clip Follow A Curve?
Hey all!

I'm working on a game where you have a car that will drive along a side-scrolling terrain, and it needs to folllow the hills up and down and rotate accordingly.

Because the front wheel and back wheel will need to be at different heights as the car moves, I'm wondering what the best way to make it rotate correctly is?

The height detection works, and the car will follow the hills but that's just using one point on the car movie clip to test with - it needs to use the front and back of the car.

Does anyone have any good ideas about this?

Cheers

-oka

Good Method For Making Movie Clip Follow A Curve?
Hey all!

I'm working on a game where you have a car that will drive along a side-scrolling terrain, and it needs to folllow the hills up and down and rotate accordingly.

Because the front wheel and back wheel will need to be at different heights as the car moves, I'm wondering what the best way to make it rotate correctly is?

The height detection works, and the car will follow the hills but that's just using one point on the car movie clip to test with - it needs to use the front and back of the car.

Does anyone have any good ideas about this?

Cheers

-k

Mouse Rollover On One Movie Clip Increase Decrease Alpha Of Another Movie Clip..
So I really haven't messed with Actionscript much for a couple years and here is my issue.

I have several movieclips I put together that will eventually be a menu for my website. When you roll over a menu option (movieclip) I am trying to get another movie clip to fade in giving the description of the menu item.

For example - when you roll your mouse over the 'Live Chat' option a brief text description would appear telling you what the live chat is about. This description is a seperate movie clip appearing away from the original menu.

I have made the movieclips for the menu and the movie clips for the descriptions. I tried this action on the menu option to get the description to fade in:


Code:
onClipEvent (load) {
this._parent.mc_text_discussionBoard._alpha = 0;
}
onClipEvent (enterFrame) {
this.onRollOver = function() {
if (this._parent.mc_text_discussionBoard._alpha<100) {
this._parent.mc_text_discussionBoard._alpha += 5;
}
};
}
But the alpha only increases on the description (mc_text_discussionBoard) by 5 when I keep rolling my move over and out and over again. It makes sense why it does that, but I'm not exaclty sure how to get it to continually increase the alpha by 5.

any help would be great and I am anxiously waiting to get this solved!
Kevin

Problem Getting Movie Clip Inside Of Movie Clip To Face Mouse
I used the code below to make a movie clip face the mouse, it works when I use it on a movie clip that's not embedded in another movie clip, but when I used it on an embedded movie clip, it's axis seems to change.









Attach Code

var stickGun:MovieClip = this.stick_holder.stickGun_mc;
//stick_holder.stick_mc.stickGun_mc

stage.addEventListener(Event.ENTER_FRAME, onMove);
//stick_holder.stick_mc.stickGun_mc.addEventListener(MouseEvent.MOUSE_MOVE, onMove);

function onMove(event:Event):void {
// get the radian value of the angle between the clip and the mouse...
var myRadians:Number = Math.atan2(mouseY - stickGun.y, mouseX - stickGun.x);
// convert it to degrees...
var myDegrees:Number = Math.round((myRadians * 180 / Math.PI));
// get the horizontal and vertical distance between the clip and the mouse...
// rotate the clip toward the mouse...
stickGun.rotation = myDegrees;
}

Movie Clip Mouse Speed Control Depending On Mouse Press
Hi,
Please help me !
As iam developing a small ball game in flash, where i need to control the speed of the ball (i.e, to increase or decrease the speed of ball)when clicked on a button depending on mouse press .

I have done similar on key press but iam not able to do the same for mouse pressed.


Please help me out

Your help will be appreciated.

Thanks & Regards
Zabi

Playing A Movie Clip On Mouse Over And Continue To Last Frame On Mouse Out
Hi All,

I have a movie clip on the timeline which is an animated mouseover button

Basically what I need to do is for the movie to be stopped at frame one when there is no mouse over and loop continuosly when I do have mouse over then on mouse out i want it to finish it's frames playing from where ever it was at when the mouse was moved out to the last frame and then display frame one so it is stopped again ready for a new mouse over.

Something I have found difficult to work out is that whilst it is doing the "out" play to to last frame, if you put the mouse back over again, it starts from frame 1 so looks like it jumps so i need the mouse over to also read what frame it is currently playing so that it can continue its endless loop from that frame to avoid it jumping about.

I hope that makes sense, it's really difficult to describe in words.

Here's the movie clip's action as it is now.

on (rollOver)
{
this.gotoAndPlay("over");
}
on (releaseOutside, rollOut)
{
this.gotoAndPlay("out");
}

ok so in the movie's timeline itself, the label "over" is a frame containing another movieclip which is basically a continous 30 frame loop and my movie timeline is stop();

so, on (rollOut) it plays at label "out"

I have placed a copy of the movie loop at the "out" frame which plays the movie slower at the end to make it a nice wind down stop

what I thought to do in action script is to read the current frame that the movie loop is at and make so the "out" position movie starts its playing frame from that frame number until it reaches the end frame where it jumps back to frame one of the timeline with the first stopped frame.

I've seen a command something like this below used to get the current frame number and take it away from the total to continue playing from that point, that's not totally right for what I am doing but it shows me the sort of thing i need to write but i don't know how to write an actionscript to read the current frame from the movie1 whcih is playing and start playing movie2 at "out" from that frame number?

on (rollOut) {gotoandPlay(_totalframes - _currentframe); }

maybe there is an easier way to get this to work, i've seen lots of similar examples on the web but nothing that specifically plays a lopp and then continues to the end on mouse out. it sounds simple but I've tried all weekend to do it without success?

Can anyone help me please?

Thanks,
Terrence.

Mouse Follow/stopfollow After Mouse Leaves Object (with Ease)
well, i think the title covers me entirely, i would like some help with a script.
The problem is, i have a scene with objects that at first they are static, when the mouse comes in and makes a move-over the scene and some objects,i have assigned multiple collision to the objects, i want when the mouse moves over a object, the object to follow the mouse,while colliding to all other objects and after a while i would like as the mouse moves away, the following to stop and the objects to return to its original spot with ease.

I know that this is a big one, but i would like some help if i could get

Copyright © 2005-08 www.BigResource.com, All rights reserved