Re: [Flashcoders] Drag and drop from desktop to browser

2009-11-04 Thread Dave Watts
 If Google Wave, can do it, how can the rest of us pull it off =)

Get yourself a REALLY BIG company and influence the next version of HTML?

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Drag and drop from desktop to browser

2009-11-03 Thread Peter B
You can drag images from your local drive to Google Wave already -
does need gears too though...

2009/10/31 Pedro Kostelec pedrok...@gmail.com:
 Hm...as far as i know they are trying to integrate the drag and drop
 technology in Google Wave, but i think it is only a feature of HTML5.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Drag and drop from desktop to browser

2009-11-03 Thread AutGlass Jobs
If Google Wave, can do it, how can the rest of us pull it off =)



On Tue, Nov 3, 2009 at 4:53 AM, Peter B pete...@googlemail.com wrote:

 You can drag images from your local drive to Google Wave already -
 does need gears too though...

 2009/10/31 Pedro Kostelec pedrok...@gmail.com:
  Hm...as far as i know they are trying to integrate the drag and drop
  technology in Google Wave, but i think it is only a feature of HTML5.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Drag and drop from desktop to browser

2009-10-31 Thread AutGlass Jobs
Hello,

I was wondering would there be a way to drag and drop a file from the
desktop to a an area on a webpage within a browser?  If so, anyone know how
that might be done?  I know AIR can do this, but I want to try to allow file
sharing to be done specifically from the desktop to within a browser.

Thanks,

Phil
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Drag and drop from desktop to browser

2009-10-31 Thread Pedro Kostelec
Hm...as far as i know they are trying to integrate the drag and drop
technology in Google Wave, but i think it is only a feature of HTML5.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Drag and drop in AS3

2008-09-23 Thread Lord, Susan, CTR, DSS
Hi there,

I am programming a drag and drop using a instance array.   The problem I
am having is that the instances have dynamic text within them.  I am
trying to track what symbol the user clicked so that I can drag that
instance.  Well... sometimes, the program registers the button name, and
sometimes it registers the text within the button.  Is there a clean way
to prevent this from happening?

Any help you can provide is appreciated!  

Thanks!
Susan

~~

var aButtons:Array  = new Array(b0, b1, b2, b3);
aButtons[0].txDrag.text= Drag 1;
aButtons[1].txDrag.text= Drag 2;
aButtons[2].txDrag.text= Drag 3;
aButtons[3].txDrag.text= Drag 4;

//var _rectangle:Sprite;
var i:Number;


for (i= 0; i  aButtons.length; i++) {
aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN,
startDragging);
aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging);

}



function startDragging(event:MouseEvent):void {
var count:Number = aButtons.length;
var index:Number;
trace(event.target.name)
for (i = 0; i  count; i++) {
if (evt.target.name == aButtons[i].name ) {
//drag code to be added...
aButtons[i].startDrag();
}



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Drag and drop in AS3

2008-09-23 Thread Glen Pike

Hi,

   Try something like the following - choose one or the other depending 
on your implementation...


//loop...
aButtons[i].mouseChildren = false;
//or
aButtons[i].text.mouseEnabled = false;

HTH

Glen

Lord, Susan, CTR, DSS wrote:

Hi there,

I am programming a drag and drop using a instance array.   The problem I
am having is that the instances have dynamic text within them.  I am
trying to track what symbol the user clicked so that I can drag that
instance.  Well... sometimes, the program registers the button name, and
sometimes it registers the text within the button.  Is there a clean way
to prevent this from happening?

Any help you can provide is appreciated!  


Thanks!
Susan

~~

var aButtons:Array  = new Array(b0, b1, b2, b3);
aButtons[0].txDrag.text= Drag 1;
aButtons[1].txDrag.text= Drag 2;
aButtons[2].txDrag.text= Drag 3;
aButtons[3].txDrag.text= Drag 4;

//var _rectangle:Sprite;
var i:Number;


for (i= 0; i  aButtons.length; i++) {
aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN,
startDragging);
aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging);

}



function startDragging(event:MouseEvent):void {
var count:Number = aButtons.length;
var index:Number;
trace(event.target.name)
for (i = 0; i  count; i++) {
if (evt.target.name == aButtons[i].name ) {
//drag code to be added...
aButtons[i].startDrag();
}



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Drag and drop in AS3

2008-09-23 Thread Matt S.
I find that sometimes if the font for the dynamic text isnt embedded
it can cause weird mouseover issues, where the mouse is affected by
the dynamic text, even if I set mouseChildren and mouseEnabled to
false.

2¢...

.m

On Tue, Sep 23, 2008 at 10:58 AM, Lord, Susan, CTR, DSS
[EMAIL PROTECTED] wrote:
 Hi there,

 I am programming a drag and drop using a instance array.   The problem I
 am having is that the instances have dynamic text within them.  I am
 trying to track what symbol the user clicked so that I can drag that
 instance.  Well... sometimes, the program registers the button name, and
 sometimes it registers the text within the button.  Is there a clean way
 to prevent this from happening?

 Any help you can provide is appreciated!

 Thanks!
 Susan

 ~~

 var aButtons:Array  = new Array(b0, b1, b2, b3);
 aButtons[0].txDrag.text= Drag 1;
 aButtons[1].txDrag.text= Drag 2;
 aButtons[2].txDrag.text= Drag 3;
 aButtons[3].txDrag.text= Drag 4;

 //var _rectangle:Sprite;
 var i:Number;


 for (i= 0; i  aButtons.length; i++) {
aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN,
 startDragging);
aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging);

 }



 function startDragging(event:MouseEvent):void {
var count:Number = aButtons.length;
var index:Number;
trace(event.target.name)
 for (i = 0; i  count; i++) {
if (evt.target.name == aButtons[i].name ) {
//drag code to be added...
aButtons[i].startDrag();
 }



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Drag and drop in AS3

2008-09-23 Thread Gerry

Susan,
Try...

aButton[i].buttonMode = true;
aButtons[i].mouseChildren = false;



On Sep 23, 2008, at 10:58 AM, Lord, Susan, CTR, DSS wrote:


Hi there,

I am programming a drag and drop using a instance array.   The  
problem I

am having is that the instances have dynamic text within them.  I am
trying to track what symbol the user clicked so that I can drag that
instance.  Well... sometimes, the program registers the button name,  
and
sometimes it registers the text within the button.  Is there a clean  
way

to prevent this from happening?

Any help you can provide is appreciated!

Thanks!
Susan

~~

var aButtons:Array  = new Array(b0, b1, b2, b3);
aButtons[0].txDrag.text= Drag 1;
aButtons[1].txDrag.text= Drag 2;
aButtons[2].txDrag.text= Drag 3;
aButtons[3].txDrag.text= Drag 4;

//var _rectangle:Sprite;
var i:Number;


for (i= 0; i  aButtons.length; i++) {
aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN,
startDragging);
aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging);

}



function startDragging(event:MouseEvent):void {
var count:Number = aButtons.length;
var index:Number;
trace(event.target.name)
for (i = 0; i  count; i++) {
if (evt.target.name == aButtons[i].name ) {
//drag code to be added...
aButtons[i].startDrag();
}



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [BULK] Re: [Flashcoders] Drag and drop in AS3

2008-09-23 Thread Lord, Susan, CTR, DSS
aButtons[i].mouseChildren = false; worked like a charm! 

Thanks!


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gerry
Sent: Tuesday, September 23, 2008 11:23 AM
To: Flash Coders List
Subject: [BULK] Re: [Flashcoders] Drag and drop in AS3
Importance: Low

Susan,
Try...

aButton[i].buttonMode = true;
aButtons[i].mouseChildren = false;



On Sep 23, 2008, at 10:58 AM, Lord, Susan, CTR, DSS wrote:

 Hi there,

 I am programming a drag and drop using a instance array.   The  
 problem I
 am having is that the instances have dynamic text within them.  I am
 trying to track what symbol the user clicked so that I can drag that
 instance.  Well... sometimes, the program registers the button name,  
 and
 sometimes it registers the text within the button.  Is there a clean  
 way
 to prevent this from happening?

 Any help you can provide is appreciated!

 Thanks!
 Susan

 ~~

 var aButtons:Array  = new Array(b0, b1, b2, b3);
 aButtons[0].txDrag.text= Drag 1;
 aButtons[1].txDrag.text= Drag 2;
 aButtons[2].txDrag.text= Drag 3;
 aButtons[3].txDrag.text= Drag 4;

 //var _rectangle:Sprite;
 var i:Number;


 for (i= 0; i  aButtons.length; i++) {
   aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN,
 startDragging);
   aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging);

 }



 function startDragging(event:MouseEvent):void {
   var count:Number = aButtons.length;
   var index:Number;
   trace(event.target.name)
 for (i = 0; i  count; i++) {
   if (evt.target.name == aButtons[i].name ) {
   //drag code to be added...
   aButtons[i].startDrag();
 }



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Drag and drop in AS3

2008-09-23 Thread Ashim D'Silva
When you recieve an event the difference between event.currentTarget and
event.target could be of much help. I can never remember which is which but
check the language reference. But nothing like disabling the childrens mouse
events with mouseChildren = false;

2008/9/24 Matt S. [EMAIL PROTECTED]

 I find that sometimes if the font for the dynamic text isnt embedded
 it can cause weird mouseover issues, where the mouse is affected by
 the dynamic text, even if I set mouseChildren and mouseEnabled to
 false.

 2¢...

 .m

 On Tue, Sep 23, 2008 at 10:58 AM, Lord, Susan, CTR, DSS
 [EMAIL PROTECTED] wrote:
  Hi there,
 
  I am programming a drag and drop using a instance array.   The problem I
  am having is that the instances have dynamic text within them.  I am
  trying to track what symbol the user clicked so that I can drag that
  instance.  Well... sometimes, the program registers the button name, and
  sometimes it registers the text within the button.  Is there a clean way
  to prevent this from happening?
 
  Any help you can provide is appreciated!
 
  Thanks!
  Susan
 
  ~~
 
  var aButtons:Array  = new Array(b0, b1, b2, b3);
  aButtons[0].txDrag.text= Drag 1;
  aButtons[1].txDrag.text= Drag 2;
  aButtons[2].txDrag.text= Drag 3;
  aButtons[3].txDrag.text= Drag 4;
 
  //var _rectangle:Sprite;
  var i:Number;
 
 
  for (i= 0; i  aButtons.length; i++) {
 aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN,
  startDragging);
 aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging);
 
  }
 
 
 
  function startDragging(event:MouseEvent):void {
 var count:Number = aButtons.length;
 var index:Number;
 trace(event.target.name)
  for (i = 0; i  count; i++) {
 if (evt.target.name == aButtons[i].name ) {
 //drag code to be added...
 aButtons[i].startDrag();
  }
 
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
The Random Lines
My online portfolio
www.therandomlines.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] drag and drop

2007-07-18 Thread Jon Bradley
Anyone attempt a DragManager class in AS3 for use with Flash CS3 (not  
the flex sources).


Specifically a singleton that takes a proxy (bitmap) and uses that  
for the dragging, with a method to have acceptable targets.


Trying to work that out and would like to know if I'm re-inventing  
the wheel here.


cheers,

- jon
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Drag and Drop

2007-05-30 Thread Lord, Susan Ms. (CONTR)
Hello,

I posted this on the newbie's list and didn't get a response, so I
figured I would try here. Sorry for the double post for those of you who
watch both lists.

I have a drag and drop and have an issue. When I roll over one of the
other pieces and click the piece stays instead of jumping back to its
original location.  It is not snapping to the target -- I removed the
target from the stage when the first piece snapped into place.  It just
gets caught behind the other drag piece and when I click the program
gets completely confused.

Is there a way to swap depths when a piece is dragged over another piece
so that the drag piece is always on top?   I know how to do this from a
button, but I don't know how to activate this event when a piece touches
another piece.

Below is my code, in case you would like a peak. Any suggestions you
have are welcome. I am very much a newbie.

Thanks,
Susan

__

import mx.utils.Delegate;
//myButton.onRelease = Delegate.create(this, traceMe);
match = 0;
function dragMe() {
this.startDrag();
trace(this);
}
function activateDrag() {
piece_mc1.onPress = Delegate.create(piece_mc1, dragMe);
piece_mc2.onPress = Delegate.create(piece_mc2, dragMe);
piece_mc3.onPress = Delegate.create(piece_mc3, dragMe);
piece_mc4.onPress = Delegate.create(piece_mc4, dragMe);
}
function checkIfMatching(dragPiece, dragTarget, originalLocation) {
trace(dragPiece = +dragPiece+ dragTarget = +dragTarget+
originalLocation = +originalLocation);
dragPiece.stopDrag();
drop = 0;
trace(dragPiece.hitTest(target_mc1));
trace(target_mc1._x = +target_mc1._x);
if (dragPiece.hitTest(dragTarget)) {
trace(*MATCH*);
match++;
trace(match);
dragPiece._x = dragTarget._x;
dragPiece._y = dragTarget._y;
trace(stop x= +dragTarget._x+ y = +dragTarget._y);
trace(dragTarget+ x= +dragTarget._x+ y =
+dragTarget._y);
dragPiece.stopDrag();
dragTarget._x = 1000;
dragTarget._y = 1000;
} else if (dragPiece.hitTest(target_mc1)) {
trace(else 1);
dragPiece._x = target_mc1._x;
dragPiece._y = target_mc1._y;
drop = 1;
target_mc1._x = 1000;
target_mc1._y = 1000;
} else if (dragPiece.hitTest(target_mc2)) {
trace(else 2);
dragPiece._x = target_mc2._x;
dragPiece._y = target_mc2._y;
drop = 1;
} else if (dragPiece.hitTest(target_mc3)) {
trace(else 3);
dragPiece._x = target_mc3._x;
dragPiece._y = target_mc3._y;
drop = 1;
} else if (dragPiece.hitTest(target_mc4)) {
trace(else 4);
dragPiece._x = target_mc4._x;
dragPiece._y = target_mc4._y;
drop = 1;
} else {
//trace(originalLocation._x++originalLocation._y);
//trace(dragPiece._x++dragPiece._y);
trace(***Jump Back***);
dragPiece._x = originalLocation._x;
dragPiece._y = originalLocation._y;
}
if (drop == 1) {
trace(***Deactivate Drag***);
dragPiece.onPress = null;
}
}
piece_mc1.onRelease = function() {
checkIfMatching(this, target_mc1, original_mc1);
};
piece_mc2.onRelease = function() {
checkIfMatching(this, target_mc2, original_mc2);
};
piece_mc3.onRelease = function() {
checkIfMatching(this, target_mc3, original_mc3);
};
piece_mc4.onRelease = function() {
checkIfMatching(this, target_mc4, original_mc4);
};
function reset() {
match = 0;
activateDrag();
for (i=1; i=4; i++) {
piece = eval(piece_mc+i);
target = eval(target_mc+i);
targetLoc = eval(targetLoc_mc+i);
original = eval(original_mc+i);
trace(piece._x +piece+  +piece._x);
piece._x = original._x;
piece._y = original._y;
target._x = targetLoc._x;
target._y = targetLoc._y;
}
}

activateDrag();
reset_btn.onPress = Delegate.create(this, reset);




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Drag and Drop: Need help creating 1 drag for Multiple drops. Willing to pay. Need help ASAP.

2006-10-05 Thread newbie133
Need help Creating 1 drag for Multiple drops. Example
of code below.

I want to drag fruit into multiple (targets)
containers that lock. Fruit can have multiple correct
targets. I can this to work 1-on-1 but not multiple.
Thanks!  

This is code on frame 1. 
Movies Clip: Fruit 
Target: apple(correct), orange(correct), chair(Wrong)
---
// Create 1 drag for Mutiple drop functionality

fruit_mc.onPress = function() {
this.startDrag();
};
fruit_mc.onRelease = function() {
this.stopDrag();
if (this.hitTest(_root.fruit_targ_mc)) {
this._x=555.6;
this._y=123.5;
_root.drag_txt.htmlText = bCorrect!;

} else if (this.hitTest(_root.start_targ_mc)) {
this._x=556.6;
this._y=302.4;
_root.drag_txt.htmlText = bIncorrect/bbrPlease
Try again!;
} else {
this._x=556.6;
this._y=302.4;
_root.drag_txt.htmlText = bIncorrect/bbrPlease
Try again!;
}
};

fruit_mc.onPress = function() {
this.startDrag();
};
fruit_mc.onRelease = function() {
this.stopDrag();
if (this.hitTest(_root.apple_targ_mc)) {
this._x=555.6;
this._y=123.5;
_root.drag_txt.htmlText = bCorrect!;

} else if (this.hitTest(_root.start_targ_mc)) {
this._x=556.6;
this._y=302.4;
_root.drag_txt.htmlText = bIncorrect/bbrPlease
Try again!;
} else {
this._x=556.6;
this._y=302.4;
_root.drag_txt.htmlText = bIncorrect/bbrPlease
Try again!;
}
};

fruit_mc.onPress = function() {
this.startDrag();
};
fruit_mc.onRelease = function() {
this.stopDrag();
if (this.hitTest(_root.chair_targ_mc)) {
this._x=555.6;
this._y=123.5;
_root.drag_txt.htmlText = bCorrect!;

} else if (this.hitTest(_root.start_targ_mc)) {
this._x=556.6;
this._y=302.4;
_root.drag_txt.htmlText = bIncorrect/bbrPlease
Try again!;
} else {
this._x=556.6;
this._y=302.4;
_root.drag_txt.htmlText = bIncorrect/bbrPlease
Try again!;
}
};



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Drag and drop with Multiple targets function

2006-09-15 Thread J ROWLEY
Hello,
  I am trying to create a concise piece of code for a drag and drop that I can 
reuse again and again. The dragged item should be able to land on any target 
(but only one target is correct - although I would like it to be easy to set 
more than one target).
  I want it to be customisable just by changing parameters in functions (so 
people that don't know actionscript very well can use it). I am not really an 
expert at actionscript so any help would be gratefully received! 
   
  This is as far as I have got although the drag items only stay on the correct 
targets:
   
  _root.result=0;
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged=true; 
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false; 
if (eval(this._droptarget) == targ) {
this.onTarget = true;
_root.result++;
_root.targ.gotoAndStop(2);
} else {
this.onTarget = false;
_root.targ.gotoAndStop(1);
}
};
clip.startX = clip._x;
clip.startY = clip._y;

clip.endX = targ._x;
clip.endY = targ._y;
  
clip.onEnterFrame = function() {
if (!this.beingDragged  !this.onTarget) {
this._x -= (this._x-this.startX)/2;
this._y -= (this._y-this.startY)/2;

} else if (!this.beingDragged  this.onTarget) {
this._x -= (this._x-this.endX)/2;
this._y -= (this._y-this.endY)/2;
}
};
} 
dragSetup(option1,target1); 
dragSetup(option2,target2);
dragSetup(option3,target3);
dragSetup(option4,target4); 
dragSetup(option5,target5);
dragSetup(option6,target6);
dragSetup(option7,target7);
   
  thanks
  Jo
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Drag and drop with Multiple targets function

2006-09-15 Thread J ROWLEY
Hello,
  I am trying to create a concise piece of code for a drag and drop that I can 
reuse again and again. The dragged item should be able to land on any target 
(but only one target is correct - although I would like it to be easy to set 
more than one target).
  I want it to be customisable just by changing parameters in functions (so 
people that don't know actionscript very well can use it). I am not really an 
expert at actionscript so any help would be gratefully received! 
   
  This is as far as I have got although the drag items only stay on the correct 
targets:
   
  _root.result=0;
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged=true; 
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false; 
if (eval(this._droptarget) == targ) {
this.onTarget = true;
_root.result++;
_root.targ.gotoAndStop(2);
} else {
this.onTarget = false;
_root.targ.gotoAndStop(1);
}
};
clip.startX = clip._x;
clip.startY = clip._y;

clip.endX = targ._x;
clip.endY = targ._y;
  
clip.onEnterFrame = function() {
if (!this.beingDragged  !this.onTarget) {
this._x -= (this._x-this.startX)/2;
this._y -= (this._y-this.startY)/2;

} else if (!this.beingDragged  this.onTarget) {
this._x -= (this._x-this.endX)/2;
this._y -= (this._y-this.endY)/2;
}
};
} 
dragSetup(option1,target1); 
dragSetup(option2,target2);
dragSetup(option3,target3);
dragSetup(option4,target4); 
dragSetup(option5,target5);
dragSetup(option6,target6);
dragSetup(option7,target7);
   
  thanks
  Jo
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Drag-n-Drop from DataGrid to Tree Flash 7

2005-12-23 Thread Wade Arnold

http://drumbeatinsight.com/dnddatagrid

Email me off list and you can view the beta. It works great with flash 
7.


Wade



On Dec 22, 2005, at 12:52 PM, Jeff Mastropietro wrote:

Does anyone know of a good drag-n-drop script for Flash 7.  I need to 
be able to drag an item from a DataGrid, to a Tree component.


This component is really great, but it's for Flash 8:
http://www.sephiroth.it/index.php?blogId=2005_11_20_weekly.html

Thanks,
Jeff
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Drag-n-Drop from DataGrid to Tree Flash 7

2005-12-22 Thread Jeff Mastropietro
Does anyone know of a good drag-n-drop script for Flash 7.  I need to be 
able to drag an item from a DataGrid, to a Tree component.


This component is really great, but it's for Flash 8:
http://www.sephiroth.it/index.php?blogId=2005_11_20_weekly.html

Thanks,
Jeff
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders