I am basically trying to create a menu which can be dragged across the stage. I have created a main movieclip which acts as the holder. This is the movieclip that gets dragged around. Within that movieclip there are 6 buttons. I am using the MouseEvent.MOUSE_DOWN and MouseEvent.MOUSE_UP eventlisteners to control the dragging however it is not working correctly.
When i compile to SWF it is fine. I click down the mouse button on the movieclip and It will start dragging however if i let go of the button it registers a click. Obviously i don't want it to do that but i'm not sure why it is registering a click as i thought that i was just releasing the button...
The second problem is if i move the mouse cursor off of the movieclip but i still have the mouse button pressed it will continue dragging the movieclip about, even if i then let go of the button.[code]...
I have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they arent called in the function.[code]
I Have the drag and drop working where you drag a text movieclip onto a picture of an object movieclip but having some problems. I know its something to do with the hitTest function but when i drop the word "cow" onto the picture of a dog it actually says this is correct by displaying the word cow above the picture of the dog when instead it shouldnt allow me to drop the text onto the picture which doesnt match.
Basically i need to know how to seperate the drag hitTest function for the DogPic/DogText so that it has its own function to detect a hit. At the moment you can see in the below code I have 1 hittest fucntion detecting both collisions when they need seperate functions I tried making a seperate function for each but it didnt work
script that would allow the user to clikc and drag mulitple symbols- similar to this:
on (press) { startDrag (this._parent, false);} on (release) { stopDrag ()}Only that instead of using "this", it drags the following symbols on mouse click: background (a movie clip)[code]..............
I found code that enables my movie clip to have click and drag rotation.Not sure how this works exactly, but it does. Now I've placed buttons that show details when moused over, and I had to repeat them for every keyframe of the movie clip to have them follow the rotation of the images in the movie clip.My question is how do I now enable these detail buttons to be hidden and shown globally?I have enabled a hide/show button to change the visibility of one of the detail buttons as a test (on the tire of the race car), but what happens is the hide state gets lost as soon as you click and drag to a new keyframe and the button shows up again without having pressed the "show" button. What do I need to have the detail buttons stay hidden throughout the clip until the "show" button is pressed?Here's the swf for reference: http:[url].......And here's the current actionscript:
ActionScript Code: cars.stop(); var startX:Number;[code]......
I am doing a project at school which is based on google street veiw for the inside of school to enable people to have a look around the school online,I have succesfully managed to make a UI and put a 360 degree panorama of the corridors in school behind it which you can drag and drop left and right, which then loops around to the beginning when you reach the end of the panorama.My problem is that I want buttons on the doors of the corridor that you can click on to get a veiw of inside the room, but since the background is movable I need all of the buttons to move with the corridor,.
I have buttons on my main timeline which calls a MC using attachmovie(). I have placed an EmptyMC on my main timleline for the MC to be inserted. Now, this particular MC has buttons on it which work fine. However, when I add a throw component onto the EmptyMC, which basicly lets me drag/throw my attached mc, the buttons are disabled.[code]...
I have buttons on my main timeline which calls a MC using attachmovie(). I have placed an EmptyMC on my main timleline for the MC to be inserted. Now, this particular MC has buttons on it which work fine. However, when I add a throw component onto the EmptyMC, which basicly lets me drag/throw my attached mc, the buttons are disabled. How can I go about correcting this?
Here is the code for the button on the main timeline:
on (release) { _root.EmptyMC.attachMovie("Content Def", "Clip2", 1); }
Here is the code from the component I have attached to the EmptyMC:
#initclip 0 function ThrowBehaviorClass(){ // get the target var target = this._parent[this._targetInstanceName]; // set up the various properties
I'm creating a menu bar that is a movieclip and inside the movieclip consists of the buttons.Now the menu bar is twice as WIDE as what is visible on the stage.The only part you can see is the text 'menu' on a bar.Then when the mouse hits the bar, it flies across the screen to the otherside of the bar where the menu buttons are.Now the menu bar does its animation over 20 frames - the last frame being the frame where the menu buttons are now visible.
I have a file where there is a magnet being dragged horizontal. When the magnet is on the left there is a electrical current flowing down, when it's at the right the current flows up. What I want is to have the two electrial currents play at certain points during the drag.So in the beginning the 1st current plays, which is a separate MC. Then once the user drags the magnet to the right the 2nd current MC begins to play and the 1st one becomes invisible. Then the cycle needs to repeat once the magnet gets dragged back to the left.[code]
I need to drag more than one Mc at the time: n.b. emc2 is a mc on the main timeline. This code is in a nested MC. prnt: MovieClip = this.parent as Movieclip; function drag(e:MouseEvent):void{ if((e.type == "mouseDown") && (GlobalVar.stat == "clicked")){ this.startDrag(); prnt.emc2.startDrag(); } if((e.type == "mouseUp") && (GlobalVar.stat == "clicked")){ this.stopDrag(); prnt.emc2.stopDrag(); GlobalVar.drag = false; }} This.startdrag() stop to works when I add prnt.emc2.startDrag().. why?
I have a toolbar with some cars on the left of the window, and I want to click on one element and drag it to the board creating a clone of it, but I can't do it.[code]...
I'm attempting to make an AS3 class that allows me to drag an object with easing. I've looked around the net and put this together.I have created this class as startDrag() doesn't allow easing. I've almost got it working but there is a problem where the registation point of the movielclip snaps to the mouse position (this is the equivalent of having "lockcenter:boolean" in startDrag() set to "true")this is the problem bit in my script:
Goal: Now, I want to be able to drag and drop this character movieclip around the stage as I please, leaving him wherever I want, with all of his movements still going on AND the mouseover movements as well.Logic: Since, when the mouse is over this character, I need the drag option area to be a little x or any object close to him, so it doesnt interfere with the movieclips mouse over effects. (could simply be a little rectangle saying: drag me)Problem: Iave no idea how to do this... I am only now starting with this Actionscript world! Donī get me wrong, I am not lazy, Ive been researching but couldnt find exactly what Im looking for.
I have a movie clip that I am dragging onto another movie clip and i want it to stay put. But once I add in another 'OR' statement in the if statement, it freaks out and doesn't work. Why is this?
This code DOES NOT work: Code: btn1.onRelease=function(){ stopDrag(); if( (eval(this._droptarget) != btn1Hold) || (eval(this._droptarget) != btn2Hold) ) {//CHANGED LINE [Code] ..... For whatever reason it doesn't like the extra 'OR' in the if statement! why!?
I created a movie clip (which I add to the main class of the scene in FlashCS5 with addchild). Its registration point is on its upper left. Its class is:[code]The problem is that it is not moving properly, like jittering.
I'm trying to create a Game of the Generals flash game. I'm only on the early stages of development and I'm still learning how to make games on actionscript.my current problem is how to remove a movieclip when i drag another to it? something like eating a pawn. but if you are playing the board game 'game of the generals',its not the easy.in simple terms, if the rank of my piece is greater than the piece im trying to drop on, it will die.here are my current scripts:
I have a Tile List wich all my movie clips, and i want to 'drag' the movieClip from Tile list and drop it into my movieClip called "palco", [URL] that my code to populate my TileList:
i have like more than 5 movieclips on the stage .. and it is draggable and when you drag it and hit the target movieclip this movieclip set to _visible = false; i want to know how i can remember this movieclip so when a new movieclip is drag to the target the last movieclip that was set to _visible = false now can be true and the new movieclip is the one that would be set to false
I am using this simple code to startDrag() drag.addEventListener(MouseEvent.MOUSE_DOWN, dragD); stage.addEventListener(MouseEvent.MOUSE_UP, dragU); function dragD(event:Event):void { this.startDrag(); } function dragU(event:Event):void { this.stopDrag(); } I need to drag only horizontally.
Originally, the client wanted to control "hero_mc" using the keyboard but now they would like to control him with buttons only. Here is the original code on the "hero_mc" which works as expected: