ActionScript 2.0 :: Stop One Movieclip From Going Outside The Boundary Of Another?

Dec 17, 2005

how do I stop one movieclip from going outside the boundary of another?

I'm guessing i need to assign maxHeight and minHeight according to the other movieclips dimensions.

What i have is on the main time line a movieclip load which i'm using as a spaceship in my game. But i dont want it to be able to go "off"" the screen so need to set a boundry.

I think i need to set a onClipEvent on the spacesip movie clip to assignthe max/min height.

View 4 Replies


Similar Posts:


AS3 :: Flash - Set Boundary Limit For MovieClip?

Sep 22, 2010

I have a MovieClip that can move up, down, left and right. If the MovieClip hits a wall, the MC bounces, and should not move past the wall--but if you continue to press either your up, down, left or right key, and don't let go--the MovieClip will go past the wall. I'm trying to figure out a way, to stop that from happening.link of movement

// function hitWall --------------------------------------------------------------
function hitWall(event:Event):void {
if (box.hitTestObject(wall)) {

[code].....

View 2 Replies

ActionScript 2.0 :: Add Boundary For The Moving Movieclip

Oct 21, 2003

I have function for moving the movieclip but I would like to add boundary for it. And another thing is that the movieclip contains a textfield for receiving the text input from the user so I have the autoSize=true for the textfield. Then I wonder how to modify the code so that when the movieclip exist the boundary, it couldn't move any more?

View 1 Replies

ActionScript 2.0 :: How To Add Boundary For The Moving Movieclip

Oct 21, 2003

I have function for moving the movieclip but I would like to add boundary for it. And another thing is that the movieclip contains a textfield for receiving the text input from the user so I have the autoSize=true for the textfield. Then I wonder how to modify the code so that when the movieclip exist the boundary

View 1 Replies

ActionScript 2.0 :: Drag Class: Set Boundary For Movieclip?

Mar 24, 2006

I want to restrict the movement of my movieclip. For example, I only want it to move 100 pixels to the right and left.

Code:
class Drag extends MovieClip {
var ease;
var dx:Number;

[code].....

View 3 Replies

ActionScript 3.0 :: Drawing A Boundary And Testing It Against Only A Part Of A Movieclip?

Nov 23, 2010

I have a map of isometric buildings that the player walks around. in the image I have 1 and 3 working fine. I find the corner points of the building and test it against the players location and sort out their depths. easy.but 2 and 4 are the trouble makers. the left and right side of the building.because its isometric there is that diagonal line making up the sides.my only idea so far is to draw a line box around the building at test collisions against the "feet" of the player. but to do that I must draw a box and make it invisible but still be testable against only the bottom portion of the player, the players feet.

View 5 Replies

ActionScript 3.0 :: MovieClip Will Not Stop, Dispite Multile Stop Functions?

Jun 21, 2009

I've tried a couple dozen things to try and stop this movie clip, even down to the bare bones basics and its not working.I have an imported TIFF sequence that i imported onto the stage of a movie clip. Its 73 frames long, i want it to stop on frame 73.So i add the usual stop(); command but it doesn't stop, it keeps looping.On the main layer i put this movieclip in i have an AS layer that also has stop(); and moviclip.stop();But it doesn't stop at all. it just keeps repeating.I put it down to this bare basic setup just to see if i could even stop it. But its not stopping.Layers -> and stuffScene 1Content - movieclipMCActionScript - stop(); movieclipMC.stop();Movieclip - keyframes consisting of image sequence 1-73. frame 73 has stop();

View 1 Replies

ActionScript 3.0 :: Stop Movieclip - SjunkBomb[x].stop(); Doesn't Work?

Aug 27, 2010

I have some bombs like this :

var sjunkBomb:Array = new Array;
for (var i:int = 0; i < sjunkBombMaxAntal; i++) {
var bomb = new sjunkbomb;[code]....

Each movieclip sjunkBomb contains an animated movieclip. When the bombs reach the bottom I want to stop the inside animation.I guess it's better to stop them so they affect the rest of the game if there are a lot of bombs. I know how to hide them with sjunkBomb[x] .visible = false; but if I want to stop them? sjunkBomb[x].stop(); doesn't work!?

View 1 Replies

ActionScript 2.0 :: Movieclip To Slow To A Stop When The Mouse Rolls Of The Movieclip

Feb 9, 2006

I have a movie clip that scrolls side to side when you rollover it but when the mouse is off it continues to scroll - I need the movieclip to slow to a stop when the mouse rolls of the movieclip. I've have been playing arounds with the hitest code (red) but this does not fix it... Its prolly a simple problem - I am not much of a coder....

[Code]...

View 3 Replies

ActionScript 2.0 :: Get A Movieclip Within A Movieclip To Stop Playing When It Reaches Its Last Frame

Nov 20, 2007

i'm trying to get a movieclip within a movieclip to stop playing when it reaches its last frame. let me describe my problem: it should start playing when the user rolls over the movieclip that is containing it(i'll call this mc1, and the movieclip within it mc2). i've put a stop action in mc2's last frame but it won't stop and plays again and again. one thing i should point out is that there is a variable in mc1 that tells the movie whether it's ok to play the movie in reverse when the user rolls over mc1, if this is false, that means that it plays normally(not in reverse). i'm using "play()" to play mc1 when the user rolls over it and this is where i think the problem is; even though the last frame of mc2 has a stop action, it is somehow told to play again? anyways, this is just a guess, i haven't figured out why or how to fix it. i'm not sure if my explanation was too hard to understand so i'll try to clarify it if anyone wants me to.

View 1 Replies

ActionScript 2.0 :: X And Y Boundary When Scrolling?

Aug 19, 2010

I have a map which I am scrolling up down left and right. Currently the map can be scrolled infinitely. Can somebody share a line of code that sets the x and y limits on the scroll. I need the scroll to stop when it gets to edge of map graphic. I have seen it, just can't find it. Here is the code for the up scroll.

[Code]...

View 3 Replies

Flex :: Dragged TitleWindow Within App Boundary?

Mar 7, 2010

I am using PopupManager in FB4 to display a custom dialog.

popwin = new TitleWindow();
popwin.addElement(myCustomDialog);
PopUpManager.addPopUp(popwin,this,false);
PopUpManager.centerPopUp(popwin);

It's possible to drag the popped up TitleWindow and let go of it when its gray title bar lies outside the bounds of the Flex app rectangle,and then the popup cannot be grabbed again.It's also possible to drag the TitleWindow downwards so it becomes completely invisible below the bottom edge of the Flex app rectangle.When the Flex app bounds are less than the full browser window,and the user is working quickly, this chances of this happening increase.Is there a simple setting that will keep this from happening, or must the programmer intercept the behavior during the drag operation?

View 2 Replies

ActionScript 3.0 :: Define Boundary For An Object

Apr 26, 2010

Basically, the problem I have is that I'd like to limit the predators to their own hunting environment, ie. Polar bear to ice, killer whale to sea so that the penguin has at least some chance of avoiding either predator. My initial idea was to define a boundary (apologies if this isn't the correct terminology) around the ice, thereby achieving what I'd like but I have no idea how to do this. Am I thinking about this too simplistically? Also, I would like the killer whale to retain its ability to swim under the icebergs. Note: As you can probably tell, the killer whale is on the lowest layer below the sea and then the ice is on a layer above the sea.

View 0 Replies

ActionScript 2.0 :: (flash) Draggable Mc With Boundary?

Mar 17, 2004

I have a menu that i need to be able to drag, but the menu is only allowed to be dragged to a certain constraint. (i.e. before the menu can no longer be visible within the .swf) I have the basic drag ac:

on (press) {
startDrag ("");
}
on (release) {
stopDrag ();
}

How would i go about adding constraints to this mc?

View 6 Replies

ActionScript 2.0 :: Using A Non Rectangular Drag Boundary?

Jan 17, 2007

When you call startDrag on a Sprite/MovieClip/whatever, you can specify a rectangle which the object in question will stay within.

Eg... startDrag(false, rect1); where rect1 is of type :Rectangle

how you would go about constraining the dragging to an arbitrary shape, say a triangle or a circle rather than a rectangle?

I figure I could just have a Timer calling a function to check the whole time but that doesn't seem particularly nice.

View 1 Replies

ActionScript 2.0 :: Defining A Rectangle Boundary

Jul 1, 2003

I have drawn a rectangle area in which I want to drag a copy of a MC instance from outside the rectangle.

1. I want to be able to define the rectangle as a boundary so that I can drag and drop a copy of the instance from outside the rectangle to inside the rectangle. If the MC instance is dropped outside the rectangle then the MC instance snaps back to it's original position.

2. Once the MC instance has been dragged and dropped inside the rectangle it can be dragged and moved around BUT only inside the rectangle and not outside it.

View 5 Replies

ActionScript 2.0 :: Movie Clip Boundary?

Sep 6, 2010

User is required to move the mouse within the movie clip, if the cursor is inside the movie clip, something will happen else if the cursor is outside the movie clip another thing happeno fill in the blank.yclip.onPress =function () {if (the mouse cursor is within the boundary of movie clip){flower._visible=true;}else{table._visible=fa lse;}

View 5 Replies

ActionScript 3.0 :: Bounce Not Rendering At Boundary

Mar 22, 2011

I'm running some AS3-based animation, a simple bounce effect. A ball lies above a line, gravity as acceleration increases it's negative velocity by 1 each frame. When it penetrates an arbitrary line it is move up accordingly and velocity is set to a high positive number (24).

At 40FPS, and with a high positive velocity set to the ball, the critical frame where it hits the "ground" doesn't always render (maybe four out of five times fails), yet tracing outputs that it did indeed go across the bounce areas. Here are the 4 critical positions where 456 would be where it was wrapped to the ground:

[Code]...

View 6 Replies

ActionScript 2.0 :: (flash Mx) Draggable Mc With Boundary?

Mar 17, 2004

I have a menu that i need to be able to drag, but the menu is only allowed to be dragged to a certain constraint. (i.e. before the menu can no longer be visible within the .swf) I have the basic drag ac:

[Code]....

View 6 Replies

ActionScript 2.0 :: Boundary Coordinates Not Working?

Aug 15, 2004

i made sum coordinates that my MC (supposedly) cannot pass. But he keeps going past them. i was wondering if sumone can take alook for me.

Code:
if (this._y<=175 && this._y>=400) {
moveYSpeed = 0;
moveXSpeed = 4;

[Code]....

ovcourse this is only a portion of my code but, can sumone check if its right? the variables speek for themselves.

View 1 Replies

ActionScript 2.0 :: Boundary For Infinite Menu?

Sep 14, 2004

All i need to do is put a boundry for the infinite menu to stop at for the left and rightThis is my code from the tut:

[AS]
onClipEvent (load)
{

[code]....

View 5 Replies

ActionScript 3.0 :: Dragging Within Boundary Of Smaller Rectangle

Mar 31, 2009

I have a simple yet mind boggling problem on my hands,simply put I have a large MC (with its registration point in the center, i need it there), and it sits in a smaller stage (think of it like as if you were panning a map thru a viewer, like google maps) but i need a set of boundaries to prevent it from going haywire. Now i have tried a couple of methods ie [code]The above just manages to stop it but once it reaches that point the drag stops totally.

View 2 Replies

ActionScript 3.0 :: Fit Many Display Objects Of Different Sizes Within A Boundary?

Aug 22, 2009

I am currently working on an AS3 where I need to fit many differently sized display objects within a rectangular boundary without them overlapping. If you take a look at this link, [URL]and take note of how the speech bubbles are able to align themselves in the swf without overlapping, this is pretty much exactly what I hope to achieve.

View 2 Replies

ActionScript 3.0 :: Restrict Boundary On Drag And Drop?

Jul 25, 2011

I am facing one problem that i want to restrict my boundary while my object is moving around a area.So i want to move my black color ball only one position left/right/bottom or topEventhoung if my ball presents in the left side edgeit should move left side. same thing for upper side, bottom side and right side.right nowi m using Mouse Down for DragMouseUP for DropInbetween MouseMove for finding its co-ordinates

View 1 Replies

Actionscript 3 :: Fit Text Into Circle Or Oval Boundary

Feb 1, 2012

How can i fit text inside Circular or Oval boundaries (not rectangular boundary)?

View 1 Replies

ActionScript 2.0 :: Drag Inside A Boundary (not A Rectangle)

May 7, 2010

how to limit the region an object can be dragged in if the region is an irregular shape. I've tried with the 'set bounds' command and tried making a shape out of rectangles - but no joy.

View 2 Replies

Actionscript 3.0 :: Using Shape As Object Movement Boundary?

Jan 18, 2010

Let's say you have a room, and a little circle representing the player. Let's say also that you decide to draw a shape overlapping the room, set alpha to 0%, and use hitTestPoint() between this shape and the player to create the movement boundary. In short, as long as the player's centerpoint is overlapping the invisible shape, he/she is free to move around.Now, I decided to make things more complicated and add an obstacle to the room - a table in the center. One would think that cutting a rectangle out of the middle of the invisible shape would prevent the player from being able to move there. No dice, the player passes right through the hole in the middle of the invisible shape. The problem, as I see it, is that when the shape is converted to a symbol for use in actionscript, the entire volume of the movie clip is used for collision detection, not just the shape's volume. No matter what options and settings I play with, I can't get the hole in the shape to stay cut-out when I convert the whole thing to a symbol.

Now, I know I could probably add an extra shape to represent the obstacle, and add extra collision detection into my actionscript. However, given that there will be a large number of rooms in the game, and a variable number of obstacles in each room, this is not an elegant solution. The most elegant solution would be to figure out a way to map the playable area in a room with a single movie clip (/graphic).So, I turn to you fine folk. Can anyone tell me how to convert a shape to any kind of symbol, and preserve features like holes within the shape (as in, not have them glazed over as part of the symbol's body

View 5 Replies

ActionScript 3.0 :: Pinch Zoom Scaling Boundary?

Apr 12, 2011

I am trying to achieve a pinch zoom effect on an image dynamically added to the stage via actionscript.

the images natural size is 2048x and onload is scaled to 1024x

when the pinch zoom is performed it calls the function below.

the problem i am trying to solve (and have tried numerous things) is to ONLY have the image scale between the two sizes as mentioned above.

scale between 1024x and 2048x and not go larger or smaller than.

[Code]...

View 2 Replies

ActionScript 3.0 :: Rectangle - How To Make Boundary Fill In Flash

Oct 29, 2009

How to make boundary fill in flash, like paint brush. If I click on any position bounded area will be filled with particular color. I have tried to make it
import flash.display.Bitmap;import flash.display.BitmapData;
var bmd1:BitmapData = new BitmapData(20, 20, false, 0x00000000);
var bm1:Bitmap = new Bitmap(bmd1);this.addChild(bm1);
function boundary_fill(x:Number, y:Number,  fcolor, bcolor){
[Code] ..... 
I have rectangle now I want to fill it with red color but it show attach overflow error .

View 5 Replies

ActionScript 3.0 :: Pool Ball Physics With The Boundary Be A 3d Sphere

Nov 11, 2009

I'm creating a ball bouncing in 3d. My problem is that I have a square boundaries. top,bottom, front, back. I tried get the the distance ( of the sphere/radius) but went I * vx , vy , vz by 1 or -1. One of the position is - while the other two might by positive. I need pool ball physics with the boundary be a 3d sphere.

View 9 Replies







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