Hi,
 
Put Image in Canvas container, your code should work.
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%" height="100%">
<mx:Canvas width="100%" height="100%">
    <mx:Image contentPath="ph_1.jpg" id="ph_1_mc" width="100" height="100" mouseDown="event.target.startDrag();" mouseUp="event.target.stopDrag()"/>\
</mx:Canvas>
</mx:Application>
 
Search the archives also, in case you have further queries. I had posted a drag and drop example using startDrag(..) and stopDrag(..). I believe, there are better ways of doing drag-drop in flex.
 
-abdul


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Philippe Maegerman
Sent: Wednesday, August 03, 2005 8:08 PM
To: [email protected]
Subject: [flexcoders] startDrag() not working

Hi,
trying to implement drag functions to move images in a configurator but my code doesn't seem to do anything.
 
Here's an example code:
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%" height="100%">
<mx:Image contentPath="ph_1.jpg" id="ph_1_mc" width="100" height="100" mouseDown="event.target.startDrag();" mouseUp="event.target.stopDrag()"/>
</mx:Application>
 
If I use event.target.startDrag(true), it will move its origin to the mouse, first that's not what I'm looking for, second it doesn't even drag after moving :(((
This was something piece of cake in flash, what am I doing wrong?
 
Philippe Maegerman
 

------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**

This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.
------------------------------------------------------------------



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to