Can someone help me? I have a file that i downloaded from a previous thread. It was in Action Script 2.0, i tried to make it Action Script 3.0. I thought i did everything right. But i guess not. So i does anyone think they can tackle this? And make it work?
Ive attached a zip folder that contains the original file and my files.
Why do i have to have php. That has nothing to do with my project. What im trying to do is create a flash project with two forms that you can take and move around. Im not sure how to do it in AS3.
cancerinforms code is written in Actionscript 3.
And he showed you some things you needed to do to make it AS3 compatible.
It just says php code because that's what the forum software supports for code highlighting, and since PHP and Actionscript 3 share some similarity many people use that option.
As for what you want to do, I'd do something along these lines.
Create your Components in flash, give them instance names.
Then in Actionscript add event listeners for mouseDown, mouseUp and enterFrame.
When downHandler is fired set a boolean var to true, when up false.
Then in the enterFrame, if the bool is true then form pos = mouse pos.
Well i have done the mouse up and mouse down. and they already have instance names. If someone would acually download my file and look you might understand. Its in CS4 though. Ill post another one is CS3. Its more than just all that. When you read the errors you might understand. Cuz i sure dont. As for enterFrame. When and where would i put that?
I edited the one in your first post.
Commented things out that were causing errors.
And basically got the dragging of the two components working.
There were a lot of errors with _parent and _root still being used. In AS3 it's parent and root, without the _. And many times you have to cast these as MovieClips, or cast them as what they are on their highest level.
Don't worry about that enterframe thing I mentioned earlier. I see that you are using the startDrag, and StopDrag methods.
Anyways look over the commented code and see why it was causing errors and then look at the correct version.