ActionScript 3.0 :: Dragging Items Into A Target Area And Display A Button
Feb 25, 2012Having problems in dragging three objects onto a target, which will make a button appear. This is my code so far:
[Code]....
Having problems in dragging three objects onto a target, which will make a button appear. This is my code so far:
[Code]....
Having problems in dragging three objects onto a target, which will make a button appear.
This is my code so far:
Code:
cookingarea.visible = false;
page2Button.visible = false;
milk.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_5);
[Code]....
Flash MX 2004. My drag and drop is working fine, but now I want the target area to highlight or something while the mouse is over it but not released yet, like its confirming the target area I want to drop in. The target area is several irregular polygon shapes. I would prefer if the target area would show an outline around the area.
My button try didn't work because I'm already pressed down on another button (the one I'm dragging).
Flash MX 2004. My drag and drop is working fine, but now I want the target area to highlight or something while the mouse is over it but not released yet, like its confirming the target area I want to drop in. The target area is several irregular polygon shapes. I would prefer if the target area would show an outline around the area. My button try didn't work because I'm already pressed down on another button (the one I'm dragging).
View 1 RepliesI want the user to be able to drag 3 items onto a target area, which will then activate a button.All i'm after is the code rather than a complete guide
View 5 RepliesOn the attached exercise, is it possible to stop further items being dragged onto a target when the target box is full?
View 1 RepliesOk so I've been battling with this code for 2 days now. I simplified my post and deleted my other thread.Here goes
Code:
//temp assuming DefaultValue1 is being passed to flash
// which it will be if this was published[code].....
At this point I either need to figure this out or find another option.I need to display the 1st 6 items in my array and on press of the next button i need to display the next 6.
I am using tell target with a button to display information when you rollover as follows
[Code]...
This works fine when I test the movie, but when I load this movie into another movie, it does not work.
I'm using the Flash ScrollPane component to hold a vertical stack of movieclips. I have implemented functionality to allow the user to drag and drop these movieclips up and down within the vertical stack so they can rearrange the order. My problem occurs when the user drags a movieclip towards the bottom of the scrollpane, I want the content to scroll so the user can drop the dragged movieclip below items which don't fit within the viewiable area of the scrollpane.
I attempted to automatically scroll the pane by incrementing the verticalScrollPosition when the dragged movieclip is towards the bottom of the pane, but this doesn't work as the dragged movieclip is part of the content of the scrollpane and gets moved with the rest of the content. The dragged movieclip moves up with the rest of the content and is no longer under the users cursor:
private function onDragged (e : Event) : void {
var draggedY : Number = ComponentHolder(e.currentTarget).y;
if(draggedY > this.height - 30 && draggedY > this.height - 25){
[code]......
I have a function that recognizes the ESC key being pressed. At which point, I want to stop dragging all items.
I"ve tried this.stopDrag() but it wont override the MOUSE_DOWN event.
It there a way to force it to "drop" the item being dragged?[code]...
I am trying to drag these items but i dont want then to be able to go inside one another, the code I have the movie clips that you drag:
[Code]...
how do i make it so that they dont converge into one another? Could you edit my code?
I know I'm using an older version of Flash (still using Professional 8) but I'm wondering if it's possible to have items be able to be more interactive in that the user can select an item with their mouse and drag it over another item and drop it on there.
View 3 RepliesDoes anyone has a modified version of this awesome tool that can limit the dragging of the objects to a given area? me in the right direction on how to accomplish this, which class i need to modify.
View 1 Replieshow would you prevent dragging for some items of your List or DataGrid?
Let's say I had a list with two items: 'Tom' and 'Jerry'. Only 'Tom' should be dragable, not 'Jerry'.
Ideally I had a 'isDragEnabled(item:Object):Boolean' function, which is being queried by the drag source.
My difficulties start with the fact that the 'dragStart' event handler has a null value for the dragSource, so right from the start I find it hard to find out what the drag-start is about..
PS There have been a few discussions on preventing or canceling a drop, but I haven't seen much about preventing the drag start, hence this question.
I'm making a Matching Game where I have some images on my left and I can drag them onto images on my right and if they are matching, they should both disappear from the stage.
[Code]....
findMatch() is a function that finds in my XML file the path of the file that matches the file that is being dragged. Having that path, I send it to dragEnterHandler where it compares it with the path of the dropTarget file and if they are the same, it accepts it. Then in dragDropHandler, I'm changing the source path of my second image to "", so that it disappears from the stage. How can I access the first file (the one that was being dragged), so that I can change its path to "", to get rid of it?
Is there any way to display flash objects which are outside the display area when flash is embeded in HTML
The reason i ask is my current project has a rotating + enlarging effect which is largely dynamic so sometimes an object may clip the edge of the stage areathis looks messy but i dont want to increase the stage area to cover the largest possible area any object could enter because most of the time the objects are at the center and small so i would end up with a lot of white space
I have a movieClip, with other movieClips inside of it, objects that I want when hit to lose points. But when I have the movieClips inside that one, it just has a giant "boundry box". I want the points to go down when you hitting only one of those items, intead it just goes does throughout the entire thing.
There is no way for me to scroll all those objects across the screen without either making a tween on the main timeline for each object (almost 20), or somehow making a giant movieClip scroll all of them all the way across, bypassing the first boundry box, and acknowledging the movieClips.
I have a project underway where I am making an interactive game. It is a personal character creator game and I need Actionscript 3 help with this.Something similar here:http:[url]....
I have tried already with toggling visibility and 'gotoAndStop()' to make items appear over other items when the corresponding button is pressed, for example, when the user tries out different pants/shirts on their character.
if this is posted elsewhere I searched but could not find topic. I would like to know if there is a way to enlarge the size of the target drop point. Seems the users have to be spot on or the shape snaps back.
Any way to give users a little more wiggle room with target drops?
I'm trying to modify a mouse trailer I've found somewhere else so that it only reacts within a specific area on the flash page - say an area 780x549 on a 1024x700 flash file.Here is the code I am starting with - The file is written in AS2 for Flash 8+
//mouseTrailer
i=0
onMouseMove = function () {
var cur_x = _xmouse;
[code]...
Is there any way I can target the next and previous items in an array? For example, if I wanted to make a gallery where there's one main image and next/prev buttons to switch between the images in the array.
View 3 RepliesI am trying to create an application for students to visualize their course schedules.I have rectangles representing each class, which students can drag and drop to build their schedule.I would like the students to be able to type in the course number and name before adding it to the schedule.I have the drag-and-drop working, and editable text working. owever, when I try to edit the text, it drags the box as well.Therefore, I would like to be able to limit the "drag" functionality to one corner of the rectangle.So the user would have to click that part in order to drag the movie clip. Please see the attached image to get a better idea of what I'm talking about.
View 5 RepliesI'm trying to create an interactive game where multiple movieclips can be dragged onto a single target. I understand that the target and the movie clip have to have the same name, like "book_mc" has to have a target of "targetbook_mc", but is there another way to do this so that "book_mc" and "pencil_mc" can both have the same target?
View 4 RepliesI am a bit new to AS3.0 and I created a fairly simple drag and drop type game based on this tutorial: [URL]. And it works wonderfully with my graphics however I need to add a "checklist" that keeps track of which items have been correctly placed on the targets after they are placed how do i go about this? For example: the square get's placed and in a list the text appears "the square has been added", next the circle gets placed and in the list under the text for the square the text" the circle has been added" etc... I would need the list to be able to be arranged automatically regardless of which item the user is selecting. How do I go about making this happen?
View 11 RepliesI wanna to restrict some area in a movie of dragging a movie clip. eg . if there's a square (or a mazed shaped area) in the movie. a movie clip cannot entered inside the square while dragging. but it can be dragged rest of the space.
View 1 RepliesThis animation is for a kindergarten course. I have 6 different colored teddy bears on the
floor and the bears are to be placed on the middle shelf in the room, in no particular order. I have the code in place to drag the bears, and they return to their original location if dropped in the wrong area. Everything works, except I can't make the bears stick to the target area. The target area has to be the same for all 6 bears.
I am animating a number of items using the Move effect. I am adding each item to an array after it has been added to the display list and once all items are added calling the play method, passing an array of the items to it. Only the last item plays in my animation.
Here is my code:
MXML: s:Move id="coinFall" yFrom="-400" duration="2000" />
public function showCoins(n:Number):void{
holder.removeAllElements();
var targets:Array = [];
if (n>=2.5){
[Code] .....
how can i stop the object from dragging when the object was already dropped to its target =)
here is my code :
var pointsCtr:Number=0;
s1_mc.onPress = function()
{
s1_mc.startDrag(false);
[Code].....
I'm having different elements on stage which can be dragged using startDrag.The elements themselves are buttons. OnPress will startDrag, onRelease will stopDrag.
All works fine except when I release the mouse button while my dragging element is underneath another element (lower depth), which is a button also.Result is that my dragging element keeps being stuck at my mousepointer..I was thinking of temporarily disabling all other buttons on stage while dragging but is there something I overlooked maybe?
how do you find the display area and/or resolution of the screen in actionscript 3?
View 1 Replies