Flex :: Ability To Drag+drop A Movieclip
Apr 29, 2011
In order to improve user experience we want the ability to have an animated movieclip of a turning wheel- and have the ability to drag and drop it anywhere on a defined area
We have built the rotating wheel as a swc file.
How do we do the drag+drop. Examples that I have seen, cater to only dropping of images.
View 2 Replies
Similar Posts:
Feb 17, 2010
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 works:
btn1.onRelease=function(){
stopDrag();
if(eval(this._droptarget) != btn1Hold) {
this._x=this.startX;
this._y=this.startY;
} else{
//CODE
}}
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!?
View 1 Replies
Mar 30, 2011
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.
View 1 Replies
Mar 17, 2009
I dragged and dropped my movie clip on to the stage, and it doesn't play. Other movie clips play, but the one I need to use doesn't play. I even added a function that is supposed to play the clip when you click on another clip, and it doesn't work although others do. I've attached the fla for reference, the clip that I'm trying to use is wipe3.
View 1 Replies
Oct 26, 2009
But I do not want to Drag and Drop the original movieclip (A). But a copy of the clicked movieclip (A1).To do this I make a copy of the clicked movieclip and put in on the same place as the original one. And set function A1.startDrag();The problems which i have now is the handling of the mouse events. Because Flash was bussy with movieclip A, and is now interrupted by movieclip
.onPress {
make moviclip 1
set location A1 under the mouse cursor
[code].....
View 1 Replies
Jul 17, 2009
I'll try to make a movieclip for drag and drop event this is a code that I've find on the web:
Code:
package
{
import flash.display.Sprite;
[code]....
But this one make a vectoriale circle on the stage and makes it draggable.Now I've a movie_clip called "mc_Image" on my stage (that have inside a image background and some transparent button).
View 1 Replies
Nov 8, 2010
I am trying to recreate a drag and drop effect that seems like you are dragging the whole screen to navigate around... like this-->I'm assuming its a huge movieclip that is being dragged around the stage with a nice tween effect to it. Please correct me if I'm wrong.I am trying to tween it to look pretty, but when i drag, it tweens it in relation to 0,0 of the movie clip. So the upper left corner moves to the mouseX, mouseY position.I think there is a math to figure this out, but I suck at math.
Code:
holder_mc.addEventListener(MouseEvent.MOUSE_DOWN, DragImage);
stage.addEventListener(MouseEvent.MOUSE_UP, DropImage);
[code].....
View 5 Replies
Mar 12, 2004
I need to drag and drop a movie clip onto a certain area and if the position it landed is right I do not want the users to be able to drag the clip again. How can I stop the clip being dragable?
View 2 Replies
Sep 14, 2009
I'm trying to create this drag and drop sequence where the "temperature_small" movie clip is dragged and dropped onto a spot on the stage. I've got the drag and drop part of the ActionScript ready, but the trouble comes when I want to re-size the movieclip to make it smaller, I keep getting the error code:
[Code]...
View 4 Replies
Oct 14, 2009
Im building a game, where the user has several images as movieclips. He can drag them to an area of the stage, and selecting them, he could rotate it. Does anybody knows some tutorials on hoe to start?
View 2 Replies
Jun 9, 2010
Lately im trying to do some experimental things with JSFL, and i was wondering if it is possible to listener for an event when a component (that i have made) or movieclip is dragged from library on the stage.i want to create something that i'll get a component and drop it on a mc. when the component is dropped on the mc the component will save the mc as a reference in some var.maybe with events isnt the way to go but i have no clue if this is possible or how to do it another way.
View 1 Replies
Jun 28, 2009
I am having problems with optimizing a code. I am not new to Flash (not an expert though) but as much as I work and read it seems that there are lots of things I don't know. I hope you could help me with this.
So..I have 192 buttons (each in different colors) and 192 arrows. The arrows are invisible in the first place. When I press one of the buttons I want the coresponding arrow to appear, hide the mouse and make it act like a mouse. I also want to be able to drop the color of the button on an external movieclip.
[Code]...
View 0 Replies
Oct 25, 2009
I want to make a drag and drop movie clip with rotating control in 360 degrees.I made a movie clip with 30 frames with a button in centre which can rotate the object in 360 degrees.At this stage it is functioning.when i tried to add the drag and drop action to the movie,the button for rotation is not working.
View 0 Replies
Mar 27, 2008
I am wondering if I can write an IF statement that is a movieclip is drag and drop into a certain area that an event occurs. Everything I try seems not to work any idea?
View 2 Replies
Mar 10, 2009
I've been making a drag and drop by using the following code:
Code:
plank0_mc.onPress = function() {
startDrag(this);
this.gotoAndStop(2);
//this._rotation = 33;
};
plank0_mc.onRelease = plank0_mc.onReleaseOutside=function () {
StopDrag(this);
}
It works fine apart from the rotation - when it rotates the movieclip the mouse can technically no longer be on the plank anymore. And the mouse is dragging the plank but is not actually on the graphic. Is there any way of snapping the mouse to the centre of the movieclip no matter where they click?
View 1 Replies
Sep 14, 2009
I have been working with a very simple tutorial over at [URL], where you drag objects onto a target movieClip. My question is this, how do you target a movieClip inside a movie clip? What I have are 4 color squares that I want to drag and drop onto a pattern_mc. I put the target mc's with in the pattern_mc. In the tutorial the target mc's are not in a movie clip. I put my target mc's in a movieClip because I want to use the pattern_mc as a material, and I thought this was the correct way to this.
Code:
//record objects starting position
var startX:Number;
var startY:Number;
//activate objects to be moved
square1mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
square1mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
[Code] .....
View 11 Replies
Feb 15, 2012
Going from AC2 to AC3. I have made a script that creates a dot (myTag) and a text label (nameLabel) when a button is pressed. Then the user is able to drag and drop the dots. This is what my script does so far. I want the text label to be hidden when dragging and displayed at the place where the dot is when user stops dragging.
Here is my code:
var tagArray:Array = [];
var labelArray:Array = [];
var nameCounter:int = 0
addLabelKnapp.addEventListener(MouseEvent.MOUSE_DOWN, addLabel);
function addLabel(event:MouseEvent):void {
[Code] .....
View 9 Replies
May 18, 2009
I've got 3 coloured balls and 3 zones which any of the balls can be dropped in. The idea is that once a ball is placed in a zone, it stays in that zone and no other ball can be added to that zone until the current ball is removed.
I've got to a point so that any ball can be placed in any zone. However, the problem is there seems to be some hierarchy with regards to the balls. ball0_mc seems to be the chief ball, and will replace any of the other two balls if there placed in a zone, instead of snapping back to it's original position because the zone is full. ball0_mc also can't be replaced by any of the other balls if its placed in a zone. ball1_mc is the next one down the line and when in a zone, can be replaced by ball0_mc if its dragged over it, but it cannot be replaced by the third and final ball2_mc. ball2_mc seems to be the runt of the pack and can be replaced by either of the two other balls when its in a zone and cannot replace any of the other balls when they're in a zone.
Hope you're still with me?! So, what I'd like to do is make it so each ball is equal, so when any ball is placed in a zone, it can't be replaced with another ball until the current ball has been removed...and they live happily ever after in the land of ballshire.
Here's my code. I've created two classes, one linked to the movie clip balls called 'Ball', and another called 'EgoGame' which is being used as the document class for the main .fla file.
[Code]...
View 3 Replies
Sep 18, 2008
I have written the drag and drop function for a movie clip this movie clip has a animation inside of it, this is on a seperate layer. When i play the swf, the animation and the movie clip it was inside become individual objects. How do I make these two objects into one entity?
View 1 Replies
Jun 11, 2010
I have one movieclip inside which I created few movieclips...I applied drag drop functionality to main movieclip with which all movieclips inside of it also get dragged along with it..and I want inside movieclips to act as buttons meaning on clicking perticular movieclip it should perform perticular event assigned to it... How to make movieclips into buttons and the main movieclip containing these buttons with drag drop functionality?
View 2 Replies
Mar 22, 2011
Once I drag and drop the movie clip symbol it will not release the symbol in sum cases I am sending the code. See code below:
f(subject2);
function f(mc:MovieClip):Void{
mc.onPress =function(){
if(!this.index){
this.index=1;
[Code] .....
View 6 Replies
Dec 8, 2009
I have a full page calendar that uses a duplicate movieclip to add the day squares (actionscript adds the day number)
I want to add a target to that "day" movieclip. (I can do this)
Now the part i don't know how to code:
I want to add a star at the top that can be dragged to the target "day". BUT... On any of the days and multiple days.
So i guess the star needs to duplicate movieclip and be able to drag and drop to any of the targets. The target is on a duplicate movieclip itself so the instance name will need to be the same on all days (or i could have it append 1,2.3 ect to the end of the instance name like: target_mc1, target_mc2...)
View 1 Replies
May 6, 2011
I have created a movie clip called mc_Border comprising of a rectangular border and an empty movie clip called mc_SpriteContainer.I am trying to dynamically add a sprite to mc_SpriteContainer.Everything works fine until I drag the mc_Border.mc_Border behaves as it should but the sprite remains in position when mc_Border is dragged.I know this can be solved by adding a line to move the mc_SpriteContainer, but I thought that as it has been added to a MovieClip, its position should remain relative to the movie clip.Just wondering if I'm missing something. Below is the code that I am using to add the MC and the Sprite to the stage.[code]
View 0 Replies
Mar 29, 2011
I am looking for a way to remove a movieclip from the stage when it is dropped (after a pause) and then have a new random movieclip appear at a specific point on the stage, which can then be dragged and dropped onto its own target (which repeats the process).
Code:
var movieArray:Array = new Array();
movieArray = ["Red", "Green" , "Blue"];[code].....
View 6 Replies
May 19, 2009
I am trying to do a flex drag and drop. It is very similar to this first example.url....The problem is that event.currentTarget.mouseX,mouseY is showing the position where I put the mouse down rather than the position where I had finished dragging.
View 1 Replies
May 5, 2010
we want to drag a button with a css layout from one grid to the other. On the second grid should be the same button with this layout. The grids are in different mxml files.
View 2 Replies
Feb 1, 2011
I'm doing an application in flex where I draw different sprites inside a canvas. Depending of the dimensions, scrollbars can be appear. I would like to move the "image" with the movement of the mouse as you can see at the Adobe Reader when you are reading a document with zoom (hand mouse icon). In this way, you dont have to touch the scrollbar.I'm start trying with drag and drop properties of the canvas, setting the position of the scrollbar according with the movement of the mouse but that is not as I expect.
View 2 Replies
Mar 7, 2011
I am dragging item from a datagrid and while dragging I could see all of the columns in the selected record, being getting dragged. However I only want to show one column (maybe name or id of the record)? Is there a way to achieve this? Also, could I show an icon or image instead of the record while dragging.
View 1 Replies
Apr 27, 2011
I am building a flex project involving drag+drop of fxg graphics. My graphic is instantiated as below:
<graphics:arrow2 id="object" mouseMove="mouseMoveHandler(event);" />
I get an error: "Call to a possibly undefined method Graphic."
This works if I change my drag-object to Image and replace the 'Graphic' below with 'Image'. What should I use to be able to reference the fxg graphic in the drag-drop? My drag drop functionality is as follows
private function mouseMoveHandler(event:MouseEvent):void {
var dragInitiator:Graphic = Graphic(event.currentTarget);
var ds:DragSource = new DragSource();
ds.addData(dragInitiator,"gph");
DragManager.doDrag(dragInitiator, ds, event);
[Code] .....
View 1 Replies
Apr 28, 2011
We need a capability by which we can drag and drop swc components in our Flex Application.
View 1 Replies