Hey guys, not sure if this is possible but i'd like to get the X,Y coordinates of a button I drag. here's my problem:
PHP Code:
public function backbuttonDown(e:MouseEvent)
{
backbutton_btn.startDrag();
}
public function backbuttonMove(e:MouseEvent)
{
trace(backbutton_btn.x +","+backbutton_btn.y);
}
the x and y coordinates remain the same even though i'm clearly dragging my button all over the stage. I did code my own by putting events and whatnot around the button but startDrag seemed smoother and faster. is it even possible?
^ I tested that code before posting it, and it's a 100% working code.
If it didn't work for your then obviously you are doing something wrong.
Try again.
Alright, I tested it again and nothing. I'll tell you what I did:
Create new flash 3.0 file, create new actionscript file called test.as. From here I linked in the document class to be this test.as file. I also included the Button component into the library so I can see it. in the test.as file is the following code, please try these steps and tell me if it works for you.
k, you are right about the movie clip, that works great. but try a fl.controls.Button. Tried Simplebutton but unfortunately there's no drag on that guy. maybe it's just a flaw in the actionscript code?
^ You can't do that with button symbols. Button symbols are primitive and were design to do things fast... if you are planing on complex stuff in the future, then try not to use button symbols ever again... your best friend is the Movie Clip, stick to it.
| Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro | WebLog:http://blog.wisebisoft.com/ |
| Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
| Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/ | By perseverance the snail reached the ark. |
Hi, I have a query similar to one that you have and someone kindly solved for you.
I'm trying to create a stickman that can be manipulated by the user into various positions, save the positions on the timeline and the user should be able to pay back the sequence of movements.
I figure I need to get the xy coordinates somehow and enter them in an array or something like that but have no idea where to begin....
any help on how i can achieve this is very much appreciated.