ActionScript 1/2 :: Change Frame Of Movieclip Depending On Relation To Mouse?

Oct 28, 2010

Its not done yet but its gonna be a dog chasing a/the mouse. I want to have it where the if the mouse is left or right of the following movie clip it shows it walking toward the mouse... so something like
 
if mouse positions is less the the cursor + 10 (pixels) goto and play frame with dog walking left
 
and one for rightup down(I want this to walk till its directly under or over mouse and then laydown or jump only when over or under mouse.. (say its a 20 pixel wide object and 10 on each side will cover the whole thing and not just the exact center pixel, thats what the 10 + movie clip position is for, but Is there a way to tell it to goto and play whatever_frame when mouse is left of any graphic on the sitting dog section???like the equivalent of onRollLeft or whatever.)

[Code]...

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Change Frame Of Movieclip Depending On Relation To Mouse?

Oct 28, 2010

This is a CS4 file so and I have CS5 so if you give me either it will be awesome

I have a movie clip that follows the mouse..

Its not done yet but its gonna be a dog chasing a/the mouse...

I want to have it where the if the mouse is left or right of the following movie clip it shows it walking toward the mouse... so something like

if mouse positions is less the the cursor + 10 (pixels) goto and play frame with dog walking left and one for right up down (I want this to walk till its directly under or over mouse and then laydown or jump only when over or under mouse..

(say its a 20 pixel wide object and 10 on each side will cover the whole thing and not just the exact center pixel, thats what the 10 + movie clip position is for, but Is there a way to tell it to goto and play whatever_frame when mouse is left of any graphic on the sitting dog section??? like the equivalent of onRollLeft or whatever.)

this is the code i have.. its the top statement that doesn't work the bottom 2 do..

Code:

if (_xmouse < detail.x+10) {detail.gotoAndPlay(61);
}
detail.onRollOver = function() {
detail.gotoAndPlay(31);

[Code].....

I already created the shapes and placed them in the appropriate frames.. you should only need to mess with the actions on the instance "detail" (the dog face in frame 1 of scene 1 in layer "follower" ---- just the actionscript needed for that instance is needed in the reply.. you should not need to chage any of the layers, but if you do just tell me what you did and why.

my fla is to big to upload to this form so im placing it on my website here

View 2 Replies

ActionScript 2.0 :: Movieclip Frame Depending On Mouse Angle?

Sep 21, 2010

so i have a movieclip with this script on it (this makes my movieclip rotates)

ActionScript Code:
onClipEvent(enterFrame){
angle = (Math.atan2(_root._ymouse-_y,_root._xmouse-_x)*180/Math.PI);

[Code]....

Now, i have (let's say) 30 frames inside this movieclip, and i wan't it to change is current frame depending on the angle of the mouse (example, if i point my mouse to the right, the mc goes to frame 30, if i point my mouse a little up, the mc goes to to frame 27, if i point my mouse all to the left the mc goes to frame 15... etc...)

Basically the movieclip should change it's frame depending on the mouse angle,

By the way, i don't really wan't the moviecliip to rotate (like it's doing now) i want it to change it's frame only...)

View 4 Replies

ActionScript 2.0 :: Change Key Frame Depending On Dates

Nov 29, 2011

Quite simply I need a piece of code which jumps to a certain frame based on the actual dates below.

1-4rd Dec - gotoAndStop(1);
5th Dec - gotoAndStop(2);
6-7th Dec - gotoAndStop(3);
8th Dec - gotoAndStop(4);

I have found bits of code which allows you to specify which days, but not dates. My actionscript is very beginner so I can't work out what to do.

View 2 Replies

ActionScript 3.0 :: Different Outcome Depending On Which Frame The Mouse Is Clicked?

Mar 1, 2011

I am currently developing a game in a school project using Flash CS4 and Actionscript 3.0.  I have searched the web for assistance, but have come up empty.  Here is what I am wanting to do...
 
I have a 3 by 3 grid on screen.  Each block in the grid contains a movie clip with four targets which cycle through at 24 fps.  Each target with have a different outcome depending on which frame the mouse is clicked.I do not want the animation to stop after the frame is clicked, however.  There are several different types of targets in the game.  Some add points, some subtract points, one target has the avility to freeze the animations for a set period, and another one is basically an instant game over.  Being as how I could not find any aid via the web prior to this post, I am not even positive that this is possible to code in AS3.0.Does anyone know if this is possible, and if so, how would I go about coding it?

View 2 Replies

ActionScript 2.0 :: Change The Frame Depending On Which Button Was Pressed?

May 1, 2003

The first prob I had was when i used the load movie command the swf file was loading in the wrong position, it kept loading down and across the page. I had

PHP Code:

_root.myemp.loadMovie("banner.swf", 0); 

I dont know why this is happening but I just fixed this by doing:

_root.myemp._x = 0
_root.myemp._y = 0

The next problem Im having is that I want to change the frame depending on which button was pressed. If button two was pressed I wanted to load "banner.swf" and gotoAndStop("pg2"), If button three is pressed gotoAndStop("pg3")Ive tried some things but cant get this part right such as:

_root.myemp.gotoAndStop("pg2")
"banner.swf".gotoAndPlay

I just dont know the syntax...

View 2 Replies

ActionScript 2.0 :: Change The Claudio Scroller So That It Will Scroll Ease Depending On The Vertical Mouse Position?

Jun 9, 2005

Does anyone know what I can do to change the claudio scroller so that it will scroll ease depending on the vertical mouse position?

View 4 Replies

ActionScript 3.0 :: MovieClip Change Animation Depending On Key Pressed

Jul 26, 2009

I have started to make an interactive movie where pushing keys moves a movie clip around the stage! And I can obviously make the movie clip do what I want, so here is the question: I want to make the movie clip change its animation depending on which keys are being pushed i.e. Left key the movie clips moves left, and my stick man changes to a running animation. Push nothing and it changes back to his standing still animation.

View 2 Replies

ActionScript 1/2 :: Change Movieclip._alpha Depending On Volume Output Of Music

Dec 24, 2011

how to change the volume, asking how to detect the actual volume (not the set 100 volume) of music/sounds. does flash even detect the actual volume output? So when the volume is 0 (e.g. maybe at the end of a song) the ._alpha is 0, so all I need is a variable for the output volume of a song.

View 1 Replies

ActionScript 3.0 :: Make The Coverflow Animate And The Movieclip Change Angle Depending On The Side

Aug 12, 2010

I'm attaching the file so that you guys can see that? pretty basic. My main problem is to find out how can the mouse check the mouse position on stage and make the coverflow animate and the movieclip change angle depending on the side, I have to animate only 5 itens, here?s the AS:

[Code]....

View 8 Replies

ActionScript 2.0 :: Make A Movieclip In Flash That Makes Buttons Spin Around A Point Depending On The Mouse Position?

Oct 9, 2007

I have recently followed a tutorial to make a movieclip in flash that makes buttons spin around a point depending on the mouse position. I have made my own version off this and would like to use it in a full flash website that i am making at the moment.

The only problem that i am having is with aligning this clip and as it is made up of script i cant physicly drag it to were i want it. I understand how to alighn this with x/y positioning but when i preview the flash in a web browser it is positioned correctly but then when i 'full screen' the browser this clip jumps about 4 inches down the page.

View 1 Replies

ActionScript 2.0 :: Easing While Moving Something In Relation To Mouse?

Jun 18, 2007

I have a stack of images that I need to move down when the mouse is above y = 250 and up when the mouse is below y = 250. I have this code, but the problem is I don't know how to add easing.

Code:
onEnterFrame = function() {
someConstant = 2342;
lastIndex = picThumbArray.length - 1;

[Code]....

View 3 Replies

ActionScript 2.0 :: Play Sound In Relation To Mouse Co-ordinate?

Feb 22, 2009

If mouse position X is between 0 and 100 play "sound1"

When mouse leaves these co-ordinates stop playing sound instantly

If mouse position X is between 101 and 200 play "sound2"

When mouse leaves these co-ordinates stop playing sound instantly

If mouse position X is between 201 and 300 play "sound 3"

When mouse leaves these co-ordinates stop playing sound instantly

And then

If mouse y position is between 1 and 50 volume = 50%
If mouse y position is between 51 and 100 volume = 100%

View 8 Replies

ActionScript 3.0 :: Smooth Out Scrolling Relation To Where The Mouse Is On Teh Screen

Jan 27, 2010

I have some code which moves back and forth through my menu so that it scrolls in relation to where the mouse is on teh screen. The problem is that I cant get it to scroll smoothly and is a little jerky... I want to ass maybe some smoothness or maybe a little lag to it so it just seems more smooth. I have pasted the main code I have so far below.. I am using AS3 at the moment.

[Code]...

View 1 Replies

ActionScript 2.0 :: Each Of The Tiny Things Separate Movieclips That Move With Relation To The Mouse?

Sep 19, 2008

Could anybody point me to the right direction on how to do the background for [URL]? Is each of the tiny things seperate movieclips that move with relation to the mouse? I want to understand how it works since it seems to work efficiently and doesn't have any slowdown.

View 1 Replies

ActionScript 3.0 :: When Change De X Or Y Value Of This First MovieClip The Frame Rate Slows Down For During 1 Frame

Mar 27, 2012

I got a MovieClip filled with a lot of others clips... When I change de X or Y value of this first MovieClip the frame rate slows down for during 1 frame. For exemple... I created a counter that returns around 30 mseconds every frame, but when I do this X or Y change the return is around 400 mseconds... When I try to fill the first MovieClip with less information it goes faster, about 100+-200 mseconds...

View 6 Replies

ActionScript 2.0 :: Mouse Scroller - Images Won't Move Depending On The Mouse Movements

Jan 12, 2011

I am creating mouse scroller and when I insert actionscript my images wont move depending on the mouse movements..I am using Flash cs5 and Actionscript 2.0...this is my actionscript:

[Code]...

View 9 Replies

ActionScript 3.0 :: Event Listener - When The Mouse Rollsover The Movieclip To Go To Frame 3 Of The Movieclip

Mar 4, 2009

i've not tried to do anything odd with eventListeners up until now. i have a movieclip with multiple frames that i use AS to attach a textfield to it. problem is i have a eventlistener for when the mouse rollsover the movieclip to go to frame 3 of the movieclip.

[Code]...

what's causing the textfield to suddenly take precedence and how do i stop it. when i trace the evt.target - it is my movieclip.

View 5 Replies

ActionScript 3.0 :: Detect Mouse Direction And Change Frame?

Feb 5, 2010

I'm building a simple 360 degree image rotation effect using single frames and forward and back buttons. I'm new to AS3 and have managed to create functioning buttons... (so my code may be a bit odd!)But now I also want to advance frames by clicking and dragging on the image itself (or on an invisible button sat on top of the image).Although there are some threads here which have asked the same thing, I don't understand how they were answered. My code is below, and the file I am practising with is on:URL...At the moment if you click on the image area it will advance but as there is no code detecting mouse direction, it just goes forward. Can anyone help me understand how to implement a simple direction detection and then use this to decided whether to advance or go backwards.[code]

View 16 Replies

ActionScript 3.0 :: When Enter Frame, Mouse Position Change?

Jun 19, 2010

I Want to change where my mouse x and y is when i enter the frame...

View 1 Replies

ActionScript 2.0 :: Moving MovieClip In Relation To Border Of Scaled Object

Oct 20, 2009

I have a frame_mc that get scaled 400 % onPress with a fusekit tween. Now I'll like to anchor a title_mc to the the top edge of the frame_mc without scaling it. How to do that? onEnterframe in the onPress function?

View 0 Replies

ActionScript 3.0 :: How Does Flash Determine The Coordinates Of Movieclip In Relation To The Stage

Mar 28, 2009

Okay this is always something that's puzzled me. If I create a movieclip, place that clip on the stage, then inside that movieclip, create another movieclip, how does flash determine the coordinates of that second movieclip in relation to the stage. The reason I am asking this, is that I have a large movieclip which contains a number of other smaller movieclips. When a user clicks on one of the smaller movie clips, I need the larger movieclip to move so that the clicked movieclip is now centered on the stage.

I figure that this would be easier to know if I knew how to calculate the distance which the second, smaller movieclip is from the center of the main stage in x and y coordinate values. Am I making any sense? If not I'll try to explain again.

View 14 Replies

ActionScript 3.0 :: Change Mouse Centerpoint Of A MovieClip

Jun 18, 2009

I'm having a random generated MovieClip and adding drag function to it. Now the problem is that it sets the mouse in the left top corner, while I want it in the center. How do I fix this position?[code]

View 5 Replies

ActionScript 2.0 :: Movieclip Height Change On Mouse Enter?

Mar 4, 2007

I want to change the height of a movie clip when mouse moves on top. Using easing in but as the box gets bigger, the hit area expands and when mouse rolls out of the expanded area, it eases back to original.So when the box is expanded, i can mouse around with that area that has expanded, but rolled back in when i move out of that.

View 1 Replies

Actionscript 3 :: MovieClip Frame Change Listener

Oct 14, 2011

I have a scene with a monster. Monster blinks its eyes. Eyes blinking is a separate MovieClip. Under some conditions, monster opens its mouth. Mouth opening is a separate MovieClip as well. At this moment I have to hide eyes MovieClip. As soon as monster closes its mouth, I must make eyes blinking visible again. My idea is to have some listener that listens to Mouth_opening MovieClip. When Mouth opening's currentFrame changes from 1 to 2, I will hide eyes. When it changes from 2 to 1, I will show it back.

So, the question is: how do I listen to currentFrame changes? Event.ENTER_FRAME is not appropriate: it's being called every render frame, not only when currentFrame changes.

View 1 Replies

Actionscript :: MovieClip Dissappears After Frame Change?

Jan 27, 2012

So I have a button movieclip, it has two frames inside it. onRollOver() I switch to frame 2 and onRollOut() I return to frame 1. The problem is that at run-time I draw two new movieclips inside this and alter their depths using swapDepths() so they appear below the existing movieclip.

The problem is that after you roll-over and then roll-out, the movieclips dissappear. I am assuming this is because the MovieClips I swapped their depths with get redrawn over my MovieClips's depths. How could I avoid this behaviour? The MovieClips I draw at run-time must be below everything else inside the button MovieClip, and I can't have a holder MovieClip inside the button in which to situate them.

View 1 Replies

ActionScript 3.0 :: Change Text At The Second Frame Of MovieClip?

Jan 15, 2009

How can I change the text at the second frame of my movieclip ?I can only change it at the first frame..myMovieCipl.MyTextField.text = "blabla";

View 6 Replies

Professional :: Change Stage Frame From Inside MovieClip?

Jun 23, 2011

How Do I Change Stage Frame From Inside MovieClip?
 
Heres my code so far:
 
hh.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void{    gotoAndStop(2);}
  
i tried (root).gotoAndStop(2); but i got an error , #1061 ..

View 3 Replies

ActionScript 2.0 :: Change Sky Depending On Time?

Aug 24, 2006

changing a colour of something depending on the time on the system of the user?

View 14 Replies

ActionScript 2.0 :: Add Counter Depending On Mouse Speed?

Jun 15, 2011

I want to make a counter get higher depending on mouse speed.

Code:
mousespeedy = _ymouse - oldymouse;
oldymouse = _ymouse;
posmousespeedy = Math.abs(mousespeedy / 100);

[Code].....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved