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


ActionScript 3.0 :: Can't Disable .startDrag?

Ok it's 5am so I'm just not thinking clearly and am straining to read my code and I cannot get this to work.

I have a zoom in function and when I'm zoomed in I can drag the movie clip around with a drag function
I have a zoom out function which restores the movie clip to its original size but I would like the drag function to be disabled while zoomed out.


View 5 Replies (Posted: 02-21-2009, 08:56 AM)

Sponsored Links:

Related Forum Messages For Flash category:
ActionScript 3.0 :: Can't Disable StartDrag
I have a zoom in function and when I'm zoomed in I can drag the movie clip around with a drag function I have a zoom out function which restores the movie clip to its original size but I would like the drag function to be disabled while zoomed out.[code]...

Posted: 02-21-2009, 05:12 AM

View 4 Replies!   View Related
Flash :: Canvas Moved On StartDrag() Without Calling Set X / Y Or Move() - How Does StartDrag() Exactly Work In As3 / Flex
i have an .as class that extends mx.containers.Canvas (it's a draggable border of a resizable component), it becomes draggable on MOUSE_DOWN and stops being draggable on MOUSE_UP, MOUSE_OUT and ROLL_OUT. before calling startDrag() i create a Rectangle to define the drag area, i also have a _dragging: Boolean variable to control if it's draggable at the moment. the problem is that when i click this border it jumps to a negative coordinate without calling startDrag or switching _dragging to true.

i've overriden get x, set x, get y, set y and move() methods in order to solve it but the only thing i got was the fact that position changes without calling coords setters or move(), but at the moment it's changed a getter is called and returns new (negative) value so my question is what happens on startDrag() and how to filter unwanted incoming coords values?

Posted: Feb 11 11 at 16:59

View 3 Replies!   View Related
Actionscript 3 :: Flash - StartDrag() Within StartDrag() On Child MovieClip
as you can see, I have a container MC which I have added to the stage. I set its drag constraints using a Rectangle(). I then add the 'cat' child movieclip to the container, and I want this to be dragable too. However, as soon as I click on my cat when testing the MC. It shoots to point x=0 y=0 on the stage and doesn't move.

The container MC can be moved without any trouble.

If I remove the rectangle bounds from the containers startdrag() function. both MC's can be dragged without any issue.

//panning ability
my_x = 800 - myImage.width;
my_y = 480 - myImage.height;


Posted: May 19 11 at 21:44

View 3 Replies!   View Related
AS3 :: StartDrag X Y Coordinates?
not sure if this is possible but i'd like to get the X,Y coordinates of a button I drag. here's my problem:

PHP Code:
public function backbuttonDown(e:MouseEvent)


Posted: 01-11-2008, 02:40 AM

View 10 Replies!   View Related
F8 :: StartDrag() Multiple Mcs At The Same Time?
is there a way to drag multiple movieClips at the same time? Flash help explicitly says: Only one movie clip can be dragged at a time. After a startDrag() operation is executed, the movie clip remains draggable until it is explicitly stopped by stopDrag() or until a startDrag() action for another movie clip is called. anyone know of a way to do it anyway? maybe combining them in a dynamic mc or something?

Posted: 11-01-2007, 04:47 PM

View 3 Replies!   View Related
ActionScript 3.0 :: StartDrag With MouseEvent?
I've created a function called dragItem() that I call with the MOUSE_DOWN event. I've got it working....kind of. I can access the function when the mouse is clicked and I can even get the name of the instance when the mouse is down. I'm trying to use the same logic to get the single object to allow a drag. see my code below...

function dragItem(event:MouseEvent):void { var instName:String =; trace(instName); trace(;;,dropItem);,dropItem); }

I get this error when I try to drag the item...ReferenceError: Error #1069: Property startDrag not found on flash.display.Loader and there is no default value. at Main/::dragItem()

Posted: Sep 24, 2009 9:04 PM

View 8 Replies!   View Related
ActionScript 3.0 :: StartDrag In 3D Not Working?
The Language Reference states:

"Three-dimensional display objects follow the mouse and Sprite.startDrag() moves the object within the three-dimensional plane defined by the display object. Or, if the display object is a two-dimensional object and the child of a three-dimensional object, the two-dimensional object moves within the three dimensional plane defined by the three-dimensional parent object."

However, this does not seem to be the case. I have a 2D object which is the child of a 3D object, but startDrag will not work on the child. If I remove any tweens in code from the parent's rotationY then startDrag will work. If I have any reference to rotationY it will not work, even if it is set to 0.


Posted: Apr 1, 2010 3:29 PM

View 4 Replies!   View Related
ActionScript 3.0 :: StartDrag Within A Loaded SWF
I have an index file in which I load my external .swf. One of the external .swf has a drag and drop quiz. And as you can guess, the startDrag doesn't work! In fact, when I publish within Flash it works just fine, but when played within the index file, it stops working!

For your information : all my files are in AS3.

So here's a bit of my code.

var interbouton : Number = 10;
//I have 7 items that I can dragfor(var i:Number=0; i<7;i++){ var dragBtn :MovieClip = new Drag();


Posted: Jun 16, 2011 3:06 PM

View 2 Replies!   View Related
ActionScript 3.0 :: StartDrag And Bounding Box
I have noticed when setting a bounding box on a drag object, if you go outside the bounds of the box you have set, the mouse won't let go of the object unless you go back inside the bounds and click on it again. Is there any way to force the stopDrag if you go outside the bounds while dragging? I have tried this bit of code:


Posted: 05-05-2008, 08:28 PM

View 3 Replies!   View Related
ActionScript 2.0 :: Tile Map Using StartDrag()?
I'm making a strategy game the uses a tile map to show information about the other players! Every tile is 50*50px and when you start the map it loads about 50 tiles and puts them together (all this from a Flash->ASP->MySQL which i managed to do on my own)

What i need to do is to make the map draggable (kinda like and make every tile clickable! I can't manage to do both of these things at the same time All the tiles are in a movieclip called mapMc so by creating a big button above the visible map area and write:

ActionScript Code:
on (press) {
allSize = _global.fullMapSize/2; //This gets the size of the map after all tiles have loaded[code].....

And that kinda works (except for the boundaries)Second, when you press a tile, which i stupidly constructed as another button, so every tile is a button (loaded dynamically) with as that fetches the tile information (already fixed ) But how do I combine them?

Posted: 02-05-2009, 04:03 PM

View 0 Replies!   View Related
ActionScript 3.0 :: Run Only Once StartDrag And StopDrag?
i created quiz. Questions of quiz, two question are fill inthe blank and others are multiple questions. i want to add matches question using startdrag-stopDrag. it runs in seperated fla. But it doesnt runk when i add to quiz.fla, actually mybadscrore doesnt work. However , how i can do to run only once


square1_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag);
stage.addEventListener(MouseEvent.MOUSE_UP, drop);
function drag(e:MouseEvent):void


Posted: 12-31-2011, 12:22 PM

View 3 Replies!   View Related
How To Make A Infinit StartDrag
How to make a infinit startDrag So something like :Code: Select allstartDrag(this, false, 0, 0, infinit, infinit); Only this code acts like this:Code: Select allstartDrag(this, false, 0, 0, 0, 0); And also I'd like this startDrag to work with negativ cordinates.

Posted: Wed Mar 25, 2009 3:49 pm

View 2 Replies!   View Related
ActionScript 2.0 :: StartDrag Outside Of Boundries?
trying to made a jigsaw puzzle, and using dynamic function to cut picture to pieces, but the pieces are not drag properly, except top-left coner to make a good jigsaw, please share with me, it's my first game program in my life,

for(i=1; i<10; i++){
this.attachMovie("ad1", "pic"+i, 9+i, thumb);
_root['pic'+i]._x = 5;[code].....

Posted: November 22nd, 2006

View 3 Replies!   View Related
ActionScript 3.0 :: Can't Get StartDrag Working
I have a MovieClip with other MovieClips inside of it. On each of the MovieClips inside, I have added a MOUSE_DOWN event and in the handler, I call, null);

But it doesnt seem to work :/

I have traced out the target name. I have tried current target and traced out it's name. THey both trace correctly. The target is being reached and it is the corect target. But the startDrag function doesnt make the MovieClip draggable.

Posted: May 20th, 2009

View 6 Replies!   View Related
ActionScript 2.0 :: Set The StartDrag (L,T,R,B) Parameters?
I've got a zoomable map within a frame, and of course I don't want it to be dragged out of view, right?

So, how do I set the startDrag (L,T,R,B) parameters when it's a different size when it's enlarged (zoomed)?

Would it be advisable to somehow set multiple conditions to do something like this? (if so, how would I do it?)

if ( between Size>100 AND Size<200) {
startDrag(this, false,400,150,600,250);
if ( between Size>200 AND Size<400) {
startDrag(this, false,500,250,500,150);

Would it be advisable to do something like that? If so, how would I code it?
If not, what would be a better idea?

...I swear, adding this zoom feature added a whole level of complexity to this map that I've never imagined.

Posted: July 13th, 2004

View 4 Replies!   View Related
ActionScript 2.0 :: StartDrag Restrict X & Y Coordinate?

If you drag the map, it moves even beyond the edge of the map so the map eventually gets dragged off the screen. Is there any possible way to stop the map moving any furthur than its boundry?

The source is here - [URL]

Posted: 07-28-2009, 06:20 AM

View 3 Replies!   View Related
ActionScript 2.0 :: CS3 StartDrag / Duplicate Object
I've on box named=box1, and added action script.[code]I want to make duplicates of box1 and script should be the same as above.[code]But when i click on button again, box1 duplicate is disappearing. I do not want that.

Posted: 10-17-2009, 04:58 AM

View 5 Replies!   View Related
ActionScript 3.0 :: StartDrag() Constrain To Rectangle?
I am trying to created a constraint to a rectangle. I have the startDrag working and I am trying to constrain a square to the movie size of 600x400.I have been searching online help files but I can not for the life of me get it to work, would someone beable to put me out of my misery. I have attached the demo file I am working with but I will also post my script here for thoughs who prefer that...


("animation", false, 0, 0, 300, 300);

but know joy...

my code:

////Button Listeners/////////////


// BtnNav listeners
btnNav.addEventListener(MouseEvent.ROLL_OVER, btnNavOver);
btnNav.addEventListener(MouseEvent.ROLL_OUT, btnNavOut);
btnNav.addEventListener(MouseEvent.CLICK, btnNavDown);


Posted: 10-19-2009, 05:22 AM

View 2 Replies!   View Related
Flash8 :: StartDrag And Bring To Front?
have a thing where i have a million drageable objects and to make it easy i made each one of them a movieclip with this on

on (press) {
startDrag ("");


Posted: 01-13-2012, 02:48 PM

View 1 Replies!   View Related
ActionScript 1/2 :: Unable To DuplicateMovieClip&StartDrag?
How can I drag a duplicated Movie Clip from DuplicateMovieClip Function? ( use one movie clip)Example below:

on(press) { duplicateMovieClip("_root.a1","a2", 2); setProperty("a2", _xscale,100); setProperty("a2", _yscale,100); } on (release) { startDrag("a2",true);}

It does dupllicat the Movie Clip but I can't drag the duplicate.I learned this from a very old Flash lesson. I wonder there is a new way to write it now.

Posted: Jun 2, 2009 11:00 PM

View 3 Replies!   View Related
ActionScript 3.0 :: StartDrag Not Working Within A Loaded Swf?
I'm trying to work with a movie clip that I am loading into my main SWF. When run alone the draggable rail works fine but once loaded into the actual main SWF it won't drag. I put an on EnterFrame on it so that when I click it reads out some data and that still works within the main swf. Is there some sort of restriction on what loaded content can do?

import flash.display.MovieClip;import;
var upper_left = rail.x;var upper_top = rail.y;var travel = rail.height-handle.height;


Posted: Oct 14, 2009 7:08 PM

View 12 Replies!   View Related
ActionScript 1/2 :: StartDrag Function On 2 Movieclips
Is there a way how the startDrag function can be used on 2 different movie clips on one stage?

I have my own photo slideshow player (photos + music) and I need 2 dragable movieclips (buttons). First one is on the timeline and second one on the volume slider. How to achieve that I could use the startDrag function on both of them in the same time?

Or is there any trick how to do it? A regular youtube player has 2 dragable buttons (volume, timeline) also...

Posted: Dec 14, 2009 9:07 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Use StartDrag With A Movieclip That Contains 3D Cube?
I'm trying to use startDrag with a movie clip that contains a 3D cube (comprised of 3D planes). It only moves the face of the cube, but not the other sides. Can one use startDrag in 3D space, or is there another method?

Posted: Dec 20, 2009 7:12 PM

View 2 Replies!   View Related
ActionScript 3.0 :: Assigning StartDrag XY Coordinates?
I'd like to figure out how to get these four skulls to move on a constrained X axis on enter frame, and on CLICK, I'd like them to reset to their original positions.Example:On frame 1 is an mc I created named holder. Inside there's an mc named box. Inside box are four mcs, circles1-4, inside the circles I have four skulls.I've also created an mc called rectangle and dragged it over the first skull to get the coordinates I want using the following trace:

trace(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
Resulting in these coordinates: 143.95,119.05,131.15,61
So, this works MOUSE_OVER the circles


Posted: Feb 26, 2010 5:12 PM

View 19 Replies!   View Related
Copyright 2005-08, All rights reserved