ActionScript 2.0 :: Only Allow The "follower" To Go To A Certain Point On The Right And The Left?
Jul 29, 2004
I have a mask that follows my mouse around the screen on the x axis only... What I want is to only allow the "follower" to go to a certain point on the right and the left... in other words, I don't want the follower to be able to go off/out of the stage.
Here's my code:
follow.onEnterFrame = function() {
var xMouse = _root._xmouse;
if(Math.abs(xMouse - this._x) < 1) {
[code]....
View 2 Replies
Similar Posts:
Aug 20, 2009
if i have a movieclip or a sprite could i find (via code) where is its registration point compared to its top left point (no rotation included) ?
View 4 Replies
Mar 18, 2009
Do you usually set the registration point in the upper-left corner ?I usually have always troubles with the registration point in the center.. or is maybe useful in any situation ?
View 1 Replies
Aug 8, 2009
I once needed to pan a sprite full of movieClips (picture 1) which were draggable with no bounds so you could drag them up and left (higher than sprites registration point).
You could also drag them down and right and expand a sprite that way (as well) but that didnt matter.What did matter was how much is 'up' and 'left' from the sprite registration point so i can include that in my formula for panning.
This was easy to find, i just sorted my array of movieClips, sorted on x and sorted on y after each drag, and thats how i got my up and left points.
Now I am trying to do that same thing, exept my movieclips inside a sprite have a custom rotation (picture 2), so i also have an up and left point, except this time up and left are caused by rotations of movieClips inside a sprite... (and these are dragable as well with no bounds)
View 1 Replies
Jun 17, 2009
I seem to be having difficulty figuring out the code required for mouse over and scroll left to right. Basically, I have arrows either side of the window and I would my timeline to smoothly go to the left or the right when the cursor is over the arrow.
View 5 Replies
Aug 7, 2009
I'm having some troubles trying to scroll a container MovieClip across the stage.I've attached an EventListener to the stage to track the MOUSE_MOVE MouseEvent, but it scrolls in a weird way (when halfway the screen it shows about 300 px of the container, when going below the horizontal centre, it goes up and disappears from sight.This is my code:
Code:
private function moveHandler(e:MouseEvent):void
{
[code]....
View 2 Replies
Nov 16, 2010
I'm making a 3D room builder. The user places Sprites around the 2D stage and my script converts those Sprites to Papervision3D DisplayObject3D objects. I'm having problems with the 3D object positioning because Sprites have registration points at their top-left corner and 3D objects have registration points at their center. How can I make that conversion?ere's a scheme of how the 2 different coordinate systems work:
I've tried this code:
child3D.x = child2D.x;
child3D.z = child2D.y - child2D.y - child2D.y; // just to make it negative
[code]....
View 5 Replies
Apr 17, 2011
is it possible for the same actionscript 2 script to be working if its inside the frames frame frame when you get down to the point where it says LEFT RIGHT UPP DOWN?
View 0 Replies
Nov 24, 2003
I read the Movement using ActionScript tutorial [URL]. My question is: How can I make the box stop at a certain point, instead of disappearing. What I want to do is to have a picture move from right to left, and then have it stop when it reaches the left side of a banner that I'm trying to make. I'm working with an image of a ship, and I want to make it look like it's floating from the right, and when it reaches the end, I want it to stop there and have text appear on the right side of the pic.
View 8 Replies
Jul 11, 2003
I start with a question: how could I change the registration point of a movie clip created or loaded at runtime? I want to move the registration point from top/left to center.
View 2 Replies
Aug 14, 2003
I've got a scrolling image gallery which I have a zoom button that lets the user zoom in on the images... If they click on the stage, the scrolling stops. Now, if they try to zoom in, the image scales from the left side, since the images registration points are on the left side of the movie clip they're loaded into. This causes the images to shift right, but I want it to appear as if its a straight on zoom...
View 3 Replies
Jun 27, 2011
I need to make a MovieClip rotate around it's center point to the left or right depending on mouse drag. I got some basic semblance of what i want going, but it's pretty hackish. Normally i calculate the angle and such but i only really need to use the distance the mouse travels and apply it to the movieclip and for flavor add some nice easing when you let go.
public function Main()
{
var wereld:MainScreen = new MainScreen();
addChild( wereld );
[Code]....
View 1 Replies
Oct 3, 2009
1. Is there a way to scale up an object from its center even if its registeration point is at the top left? can that be done using TweenMax?2. can I apply the same tween on two objects at the same time? basically what I want to do is load up an image to the stage, and then tween its scale from 0 to the original size along with another movie clip behind it that would form some sort of a border for the image. and I want to scale them up from the center.
View 5 Replies
Feb 25, 2011
I have a column of objects down the center of the stage and I need them to randomly point either to the left or the right. They have been placed using a for loop so I can't point each one individually. I was told I could use Math.random to flip their scaleX position but I can't get it to work.
View 4 Replies
Sep 14, 2009
I need to have 2 kinds of masks, one with a registration point in the top left so that when I tween its height it expands downwards, and one with a registration point in the bottom left so that when I tween its height it expands upwards?how do i do that, with code ofcourse?i have made something but i dont know if its the right way:(this expands downwards, but i dont know how to get it to expand upwards)
Code:
import gs.TweenLite;
var subMask:Shape = new Shape();
[code]......
View 4 Replies
Oct 28, 2010
When you create shape on stage and right click and chose create object you can chose Registration point for the object you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?
View 5 Replies
Sep 22, 2009
I am moving movieclips around my stage in relation to the users mouse location. All of my movieclips have the registration point placed in the default top left corner. As an object moves off the stage to the left it suddenly disappears when the registration point reaches the edge of the stage. I would like to see the whole object move off the screen instead of just disappearing when the left corner reaches the edge. I would move the registration point to the right side but I would like the movieclip to be able to move off all sides of the stage (top, bottom, left, right)
View 5 Replies
Oct 28, 2010
When you create shape on stage and right click and chose create object you can chose Registration point for the object
you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?
View 1 Replies
Mar 31, 2011
I want to learn how you can change the registration point for the Canvas.I want to make a zoom of this component, but the point registration in the upper left corner! How do I move to the center?
View 3 Replies
Mar 31, 2011
I want to learn how you can change the registration point for the Canvas. I want to make a zoom of this component, but the point registration in the upper left corner! How do I move to the center?
View 3 Replies
Oct 29, 2010
When you create shape on stage and right click and chose create object you can chose Registration point for the object..you chose what corner will be used as center of coordinates for this object. Now onice you create object is there way to change this registration point e.g. i created it in center now i want to to be in upper left corner?
View 2 Replies
Sep 8, 2005
I have a function which contains some code and about half way through calls another function. Only problem is it stops the main function from running so the code following it snt executed. What I want to know is is there anyway to go back into the original function at the point at where I left and carry on executing? I've thought of one solution but its a bit long winded and I just wanted to know if there was a quick and easy method, before anyone asks the code needs to be in its current order.
View 3 Replies
Jul 7, 2011
if I make a Super Mario platform jumping game - should it be bottom left ie: the hitPoint of his feet and the platform he lands on.
View 3 Replies
Jul 27, 2007
So when you load a picture into a movie clip, it loads into the Top-Left hand corner.I really want it to load into the Top-Right hand corner. Is there a way?I am loading it via AS - not placing it manually, as I have a variety of images which are of different dimensions....
View 4 Replies
Aug 11, 2009
I have a horizontal scrolling movieclip that scrolls when the mouse is left or right of a certain point of that movieclip. However, it only moves slightly then stops when the cursor goes over it, it doesnt actually scroll normally...
[Code]...
View 1 Replies
Feb 3, 2009
I made two movie clips that follows the mouse but I want to put constraints on them, they should follow the mouse until the mouse reaches a curtain distance and then the movie clip should pop back to its original x and y position.Code: Select allprivate function init():void[code]......
View 1 Replies
Mar 26, 2010
have created this really cool mouse follower that changes colors, I 've done this in AS3 and now I'm at a total loss as to how to get it to work with my website.
View 11 Replies
Dec 31, 2002
I have succesfully achieved a mouse follower using the following code, [code]the part I need to understand how to change is:I want to offset the MC in relation to the mouse pointer,probably by assigning variables, not sure though.
View 3 Replies
Jan 20, 2003
how would one go about making a mouse cursor follower in Flash MX, if one was so inclined??
View 3 Replies
Sep 4, 2004
Does anyone know how to set boundaries on a slow chase mouse follower. Attached is the fla im trying to set boundries to. The ball should not go past the red lines.
I have used the following code:
Code:
onClipEvent (load) {
_y = 0;
speed = 5;
[Code]....
View 2 Replies