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:
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
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
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]
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){
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.
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.
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.
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 {
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.
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.
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.
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
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.)
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.
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.
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() {
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.
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?
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]...
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.
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.
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.
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]
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.