ActionScript 3.0 :: Making A Draggable Item That Can Only Drag On An Axis?

Oct 5, 2010

What I want to create is a movie clip, that I can drag, but only on axis, such as up and down, but not left to right. For example, only on an X axis, but not on a Y axis.The code i'm currently using to make the items draggable is:
 
pc.onPress=function(){
startDrag("pc",true,50,50,550,350);
removeMovieClip("cnt");

[code]....
 
"pc" is the instance name of the movie clip I want to drag. "cnt" is a line that I've got drawn between the various draggable points I've created.

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Draggable Movieclip With Loop In Y-axis?

Sep 17, 2009

For the last couple of days I've been trying to find an example of a draggable movieclip (with mouse) in Y-axis which also can loop. This movieclip will load several different dynamic SWF-files from a XML file, but they are all the same width and height.I want this movieclip draggable in Y-axis only, and it should loop when you reach the end. But I can't figure it out tbh.What I want to achieve is similar to this: But in a vertical direction and when you grab something all 3 images that are visible should follow the mouse movement.Here is a code that I've written, you can drag the "container"-movieclip, but I can't figure out how to loop it and everytime I press and drag it again, the movieclip pops back to Y:0 at the mouse-pointer, hard to explain

import caurina.transitions.*;
import flash.display.Sprite;
import flash.events.Event;

[code].....

View 2 Replies

ActionScript 2.0 :: Creating Vertical Menu Draggable On Y Axis

Sep 3, 2010

I am building a vertical menu that is draggable on the Y axis.
1.How do I add easing? Can I use fuse?
2.If the button that is being dragged reaches a point on the y axis it would trigger a function. If it is let go before reaching that point the button would snap back to the original position. I guess a simple (if statement) would work - but not working for me
3.Last thing. It is a vertical menu, so when a button is being dragged everything above it would drag with it. Cannot seem to get that to happen

View 1 Replies

Actionscript 3 :: Multiple Draggable Item Into A Single Target

Oct 13, 2010

I'm creating a drag and drop Flash activity where there is 1 target and multiple draggable items. In my case I have 4 apples and I want to be able to put all apples into the same basket. I can get the draggable item into one target but i cannot get multiple draggable items into one single target.[code]

View 1 Replies

ActionScript 3.0 :: Making A Text Box Draggable?

May 10, 2011

ive got a text box a user can enter some information, an add_btn whcih will place the text onto an image inside a UILoader.i keep getting this error :

Quote:

TypeError: Error #1010: A term is undefined and has no properties.
at DLS_fla::MainTimeline/onClickadd_btn()

when i hit the add_btn... why has it got no properties

ActionScript Code:
function onClickadd_btn(evt:MouseEvent):void{
//and the work around for removing the old text when new confession is added.
if(newTextBox!=null){

[code]....

View 9 Replies

ActionScript 3.0 :: Making Copied Movieclips Draggable

Sep 28, 2010

When you click on a movieclip in the menu, it is then copied and added to the container_mc movieclip.

My problem is that I can't figure out how to make the movieclips draggable once they are in the container_mc.

I tried the following as a test but its only working for the existing movieclip, not the new one like I want it to[code]...

View 2 Replies

ActionScript 2.0 :: Duplicating Movieclips & Making Draggable?

Apr 16, 2003

I am basically trying to duplicate a movieclip by using a button.. (no probs there).however, i want to drag each movie clip individually.. ( my brain froze)here is my butchered code..// graphic is the mc i wanna drag, n is the textfield that i want to count up.

on (press) {
addmore = "graphic" add n;
duplicateMovieClip("graphic", addmore, n);

[code]......

View 14 Replies

ActionScript 1/2 :: Draggable Button (drag Without Click)

Jun 14, 2009

make a script for a draggable button? I just need a button (..onPress) that will wont work if you start dragging it

View 3 Replies

ActionScript 1/2 :: Multiple Draggable Movieclip Within The X And Y Axis Of Another Movieclip

Mar 19, 2012

I have this four draggable movieclips. I have able to drag the green bar within the gray bar and the dynamic percentage text increase/decrease accordingly.

The program should make the second draggable determine the percentage of the first (100 - current value) and make it the basis for the other 3 draggable.

Example:
 
if the 1st draggable will be 75%. the other 25% will be divided by the other 3 draggables.

The 3rd draggable determine the 2nd percentage (100 - current value) and make it the basis for the other 2 draggable and so on.
 
When I drag the 1st draggable the other 3 is drag & animated accordingly but I cannot drag the 2nd, 3rd and 4th draggable.

View 1 Replies

ActionScript 1/2 :: Draggable Movieclip Within The X And Y Axis Of Another Movieclip?

Aug 2, 2011

I know that startDrag function allow a movieclip to be draggable on the stage. But what I'm trying to achieve here is that I want that certain movieclip to be draggable on a limited space. I attach a screenshot for further information.Above is a screeshot of the flash movie. The white area is the stage and the green square is the draggable movieclip while the gray rectangle is its draggable limit.

View 3 Replies

ActionScript 2.0 :: Drag Movieclip On Y-axis

Apr 26, 2010

Is it possible to drag a movie clip named "xxxx" along the y axis when you click and drag? if so what is the as2 code?

View 1 Replies

Actionscript 3 :: Start Drag Only On X-axis?

Jun 22, 2011

I have a red square that I want to drag only on the x-axis. I've worked out a simple script, which theoretically should work, but it's not behaving properly. It's a bit hard to explain..the square keeps starting at the wrong position and the stage position seems to be changing so sometimes you can't drag the square all the way to the right...

red.buttonMode = true;
red.addEventListener(MouseEvent.MOUSE_DOWN, dragHandler);
function dragHandler(e:MouseEvent):void {

[Code]....

View 2 Replies

ActionScript 2.0 :: Restricting Drag To One Axis?

Mar 9, 2005

I'm using this simple code to drag a clip on stage:

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

how I can restrict the drag to the X axis only?

View 7 Replies

ActionScript 2.0 :: Drag A MC Just On Its _x Axis, Keeping The _y The Same?

Nov 23, 2007

How do I drag a MC just on its _x axis, keeping the _y the same?

View 2 Replies

ActionScript 2.0 :: Making Movieclip Look At Cursor On The X Axis

Jan 15, 2010

I have been trying in vain to make my movieclip look at my cursor on the X axis. The problem I have is that, when it's negative scale. it's keeps looping the 2 directions.

[Code]....

View 0 Replies

ActionScript 2.0 :: Making StartDrag Move Through And Axis?

Jun 1, 2004

I want to make a handle pull up and then down through an arc. Now using the startDrag on the Handle won't make the handle pivot around an axis. It needs to move a bit like a (one arm bandit) or (The old coin Poker Machines) I have attached a basic file to show the problem I have so far.

View 2 Replies

ActionScript 2.0 :: Making StartDrag Move Through And Axis

Jun 1, 2004

I want to make a handle pull up and then down through an arc. Now using the startDrag on the Handle won't make the handle pivot around an axis. It needs to move a bit like a (one arm bandit) or (The old coin Poker Machines) I have attached a basic file to show the problem I have so far.

View 2 Replies

ActionScript 2.0 :: Making Random Movement On Only X Axis?

Nov 25, 2002

well i've read the random movement tutorial but now i only want things to move randomly horizontelly; on the x axis. I'm pretty sure this is possible since most things are with flash so would anyone know what AS would be used? i've treid the one here: [URL] and deleting stuff that i think is not relevant. But i keep getting more and more erros each time i try to fix something...so anyone know what the AS would be? thx

View 1 Replies

Professional :: Drag And Drop Axis Lock?

Dec 13, 2011

I am creating animations in Flash 5.5 for use in Captivate 5.5.  I have created a drag-and-drop animation for a horizontal line and a vertical line, to act as moveable "straight edges" for use on complicated charts. How do I lock the horizontal line to just move along the Y axis, and the Vertical line to just move along the X axis?  (I'm a relative newbir working in Flash.) 

View 8 Replies

ActionScript 3.0 :: Flip Object Over An Axis When Using Drag And Drop?

Dec 17, 2009

how I can flip a movie clip during a drag and drop when it hits a certain axis on my stage?  So If I have the letter L and am dragging it from right to left.  When I hit the mid way point of my stage I wand that L to flip and look like a backwards L, but allow me to keep dragging.

View 18 Replies

ActionScript 2.0 :: Drag And Drop Around A Fixed Center Axis?

Apr 19, 2006

I nedd to build a "See if you have the right weight" wheel in Flash. It have to be a small wheel over a bigger one. The top one have to be drag and drop like it was pined to the other one, so it rotates around the center axis (when click and drag with the mouse over), allowing us to match the scales in the wheels as we like.

I've found a lot of tuturials about drag and drop objects in Flash, but freely, not around a fixed center axis.

View 1 Replies

ActionScript 2.0 :: Making An Item In .fla Scale With Browser?

Feb 7, 2006

I am trying to make my background movie clip(bg) scale to the size of the browser window (or whatever size that might change to) while the rest of the content is at it's normal size.

on the key frame where the background clip is i have:

Code:
private function initStagelistener(){
var bg = this;
_stageListener.onResize = function() {

[Code]....

View 2 Replies

ActionScript 3.0 :: Drag And Drop Item Sticking

Nov 3, 2008

I'm creating a drag and drop game for grades K-2 and two of my pieces stick to the mouse when clicked. I'm not sure what the problem is as I've used the same code for all of my pieces. The pants1_mc and the glasses_mc are the problems.

View 3 Replies

Flex :: Drag-and-drop Onto List Item?

Oct 21, 2010

I have a List with an item renderer and would like to enable drag-and-drop onto the items in the list, rather than adding the data to the list. Is it possible to find the item that is being hovered over when dragging?

View 1 Replies

Actionscript :: Drag More Than One Item In Adobe Flash?

Apr 25, 2011

I've been trying to program a game in my class on Digital Media, and have run up to a huge roadblock concerning draggable items. I first managed to make one item that could be dragged with the mouse using this code (the movie clip is called 'honey')[code]...

View 1 Replies

ActionScript 3.0 :: Dropdown Menu - Making Every Item Clicked Only Once

Apr 7, 2009

I made a drop down menu based on xml file and some simple summation after each click of the item. This drop down menu code is based on the xml driven menu. What I need is how to make every item can only be clicked once, so once clicked, it should not be able to be clicked any more.

View 2 Replies

Actionscript 3.0 :: Hit Test - Drag Each Item Around To Reorder The List

Aug 10, 2009

I am making a horizontal list that I want to be able to drag each item around to reorder the list. When one clip is dragged over another I want the one under it to move left or right to fill in the empty space left by the clip being dragged. I cannot seem to figure out how to tell which movieclip is touching or "under" the movieclip currently being dragged around. It seems that the hitTestObject method need explicity instance names to work. In summary, I want to know the instance name of any display object that the dragging moveclip touches.

View 1 Replies

ActionScript 2.0 :: Dynamic Column - Drag Item Out Of List?

Feb 21, 2004

I basically want to be able to drag any item out of that list, and when doing so, have it that item automatically go to the bottom, and have the remaining items scroll up. I can handle the drag and drop part of it, but I'm confused on how I could get the remaining column of items to dynamically move up depending on which item is taken out. I'm thinking maybe along the lines of an array? And I also suppose each item will have to be loaded in.

View 5 Replies

ActionScript 2.0 :: Resize An Item (a Vector Square Or Such) On Drag?

Oct 24, 2006

how to resize an item (a vector square or such) on drag? In other words, I want to click a side and drag that side having it resize. Sort of like WACK [URL]

View 1 Replies

Flash :: Making Dynamic Text Item Transparent For Mouse?

May 18, 2010

I'm working with actionscript 3 and have a trouble. I need to write player where users will see text on the front of the movie. The text is text field of type "Dynamic text". The problem is that I need to make this text object transparent for mouse move and clicks.

I tried:

.mouseEnabled=false;
.selectable=false;

when I click on it - it does not pass clicks through it.

View 1 Replies







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