Shop Mobile More Submit  Join Login
My first official tutorial. Hope it;s actually helpful ^^;

This isn't exactly under my usual theme in this gallery, but I decided Ched was small enough to count XD

I know it's more programming than design oriented, but I think it's important for people to understand what's exactly happening in the actionscript for a change ;)
One note though, the code isn't mine. I based myself on a tutorial I found over the net. Very good code wise, but not very helpful for those who don't know what was happening there

If you have any questions, suggestions or comments don't be afraid to post them bellow. Any feedback is most useful ^^

Source: [link]
Add a Comment:
 
:iconpayden174:
payden174 Featured By Owner Oct 11, 2011   Artist
actully i dont know how to use flash in general
Reply
:iconsfcelebnaur:
SFcelebnaur Featured By Owner Aug 4, 2011  Student General Artist
Greetings, thank you for the tutorial, it was very useful. :3 Its great having some more advanced flash tutorials that are easy and simple to follow.
I wanted to let you know for the multiple Drag and Drop objects, your red A and B circles don't always center them selves when even directly placed onto the blue A and B. however, lot of of times it does center. I just wanted to make sure you were aware of that, and if they would have the same effect on my animation?
Reply
:iconevolvd-studios:
evolvd-studios Featured By Owner Feb 19, 2010
Would you like to Join EvolvdStudios Online? Here you can share all your latest flash animations and games, as well as ask questions and watch our new tutorials that will help you on new animating tricks as well as actionscripting faqs (You can also upload your own tutorials, otherwise what would it all be about?). You can also access our newly created ANIMATED SPRITE DATABASE, Here you can download spritepacks from many famous characters, for example, sonic and mario. These are added weekly, but to enjoy all this, all you have to do is this:
CLIC ON THE CLUB BELOW, FIND THE JOIN NOW BUTTON, PRESS IT, AND VOILA!!! UR IN!
:iconevolvdstudios-online:!!!JOIN NOW!!!:iconevolvdstudios-online:

PS: Had to do a personal invitation scince all our actual invites are now used up >.>
Reply
:iconresizer:
resizer Featured By Owner Feb 28, 2010
I'll ponder on that
Reply
:iconevolvd-studios:
evolvd-studios Featured By Owner Mar 2, 2010
lol =p
Reply
:iconmmwoodcock:
MMWoodcock Featured By Owner Feb 13, 2010  Professional Digital Artist
when i want the circle to return to its original spot (without slowing the speed) am i supposed to enter the X and Y positions of the circle in the script?

i was able to make the code work for drag and drop and i pasted the code after the first one (like you said, unless i misunderstood) but it only continues to do drag and drop. It does not return to original position.

i've only been using flash for a few months and only know how to do buttons :XD: so yeah <<
Reply
:iconresizer:
resizer Featured By Owner Feb 28, 2010
Better if you check the final section of the tutorial. It shows how the full code looks

I need to redo this anyway
Reply
:iconhello-pebbles:
Hello-Pebbles Featured By Owner Oct 17, 2009
Erm , may I know is there a way to drag as many copy of that object as I want , just from ONE of that certain object? (:
Reply
:iconresizer:
resizer Featured By Owner Nov 15, 2009
If you mean by clicking on the original (or one of the copies) dragging all of the objects, yes it would be possible but it would involve 2 things
One having all the objects share the same name (obj1, obj2, obj3, etc) and using _root["obj"+i] in a cycle. Two would be having a function that would call all the objects

Hope this makes sense
Reply
:iconthezephyr81:
Thezephyr81 Featured By Owner May 16, 2009
It didn't work. I have two layers, Actions and Layer 1.

Layer 1 has a circle which has been converted to a movie clip.

Actions has nothing on it except for the code:

circle.onPress = function() {
startDrag(this);
}


circle.onRelease = circle.onReleaseOutside = function () {
stopDrag();
}
Reply
:iconresizer:
resizer Featured By Owner May 17, 2009
Have you given the instance name 'circle' to the movieclip?
Reply
:iconthezephyr81:
Thezephyr81 Featured By Owner May 17, 2009
I didn't xD

I named the layer instead. :p But I figured that out already.

And the code for it to pop back won't work. :/
Reply
:iconresizer:
resizer Featured By Owner May 17, 2009
It happens, even to pros =p

Hm.... it's hard to judge without having a look at the actual file Xp
Reply
:iconthezephyr81:
Thezephyr81 Featured By Owner May 17, 2009
Oh well. I gave up anyway. Dx

:p
Reply
:iconthezephyr81:
Thezephyr81 Featured By Owner May 16, 2009
nm, I got it.
Reply
:iconjtb-x:
Jtb-X Featured By Owner Apr 24, 2009  Professional Interface Designer
Awesome! was looking for this kind of tutorial.. Is it also possible that when you drop the ball into the circle it will launch a picture or something?
Reply
:iconresizer:
resizer Featured By Owner Apr 24, 2009
Sure, you just need to have a flag or a function to trigger that event
Reply
:iconprincesstita:
PrincessTita Featured By Owner Mar 2, 2009
Hey there. Im looking for a parnter on DA who can help with me codes and actionspricts. I have flash mx. I been having such a hard time.

If you can I help out I can send you the files what im doing.
Reply
:iconresizer:
resizer Featured By Owner Mar 2, 2009
Going to be honest with you, I have no free time to go around and teach people beyond the tutorials I do. The best I can do is recommend you to learn more about algorithms and actionscript (there are tons of tutorials out there) and give feedback on the works you produce

Here are some sites for you to start on, just to name a few [link] [link] [link] [link] [link]

Best of luck
Reply
:iconredgryphonart:
RedGryphonArt Featured By Owner Feb 8, 2009
Will this code work in Flash CS3?
Reply
:iconresizer:
resizer Featured By Owner Feb 8, 2009
If you use actionscript 2, yes
Reply
:iconredgryphonart:
RedGryphonArt Featured By Owner Feb 8, 2009
Cool. Thank you. It worked btw. Great tutorial.
Reply
:iconresizer:
resizer Featured By Owner Feb 8, 2009
Glad to know I could be of help ^^
Reply
:iconcarmiecarmela:
carmiecarmela Featured By Owner Aug 24, 2008
Thanks,very helpful. Do you know how to do this ( the one whre you drag the thing to another thing and i detects it, collision detection) but instead of dragging it with your mouse cursor, can you just move like a movable character and so on so forth? Thanks
Reply
:iconresizer:
resizer Featured By Owner Aug 24, 2008
You'll have to set up a key listener so every time you press the arrow keys it moves the object along the axis
Reply
:iconeva-ve:
Eva-ve Featured By Owner Jun 7, 2008

this is very, very helpful and i'll make sure to test it. thanks. :>
Reply
:iconresizer:
resizer Featured By Owner Jun 7, 2008
Glad I could be of service ^^

Do tell me if you bump into any problems ;)
Reply
:iconeva-ve:
Eva-ve Featured By Owner Jun 8, 2008

will let you know for sure. :>
Reply
:iconresizer:
resizer Featured By Owner Jun 8, 2008
Thankies ^^
Reply
:icontomochiro:
Tomochiro Featured By Owner May 24, 2008
I have to say that this was a great tutorial!
Reply
:iconresizer:
resizer Featured By Owner May 24, 2008
Yay, it was useful to someone XD
Reply
:iconscarabsi:
Scarabsi Featured By Owner Jan 10, 2008  Hobbyist Traditional Artist
Hee, if I drag the returning circle a certain way, it starts avoiding my cursor like a repulsed magnet. It's pretty funny, actually, but I really don't think it's supposed to be doing that. . .

Sorry you can't fix it, though. D: You should back up your files. Or burn them onto CDs. Or something. *shrug*

Is there a way I can drag the object with a replacement cursor without putting the object on TOP of the cursor? Right now it will only drag if the replacement cursor is underneath it. . . D: It's not working for the game I wanna make.
Reply
:iconresizer:
resizer Featured By Owner Jan 10, 2008
I thought that was a glitch when using a tablet (doesn't use mouse) Xp

No, that's not the reason I can't fix it. It's because the code isn't originally mine. As I said in the description, I only picked a good tutorial on drag and drop and decided to make it clearer to non-programmers ;)

I don't understand what you mean by replacement cursor ^^;
Reply
:iconscarabsi:
Scarabsi Featured By Owner Jan 13, 2008  Hobbyist Traditional Artist
Ohhhhhh. o_o;; Okay, then. . . I guess it'd just be a matter of trying to figure out what the code is saying, eh? ^^;

Replacement cursor, like when you hide the mouse and draw a symbol (movie clip) that will go where the mouse will go. It's a common trick for programming games. . .? Well, I figured out the problem anyway, so nevermind about that. :invisible:
Reply
:iconresizer:
resizer Featured By Owner Jan 15, 2008
Yeah. But it's a bit harder when you don't have formal training on it Xp

Ah, I know what it is.... just not by that name ^^;
No, I didn't use it here. But am glad you got it fixed X3
Reply
:iconscarabsi:
Scarabsi Featured By Owner Jan 16, 2008  Hobbyist Traditional Artist
Yeah, the only reason why I know anything is because I read Flash Programming for Dummies. ^^; The teacher gives assignments, and that's just about it. . . *fail* It's a pretty useful book, though, if you haven't read it yet.
Reply
:iconresizer:
resizer Featured By Owner Jan 16, 2008
I had to learn all mine from scratch. None of my teachers knows a ting about flash Xp

I have a pretty awesome book called "Flash MX ActionScript for Fun and Games" and another one that's "Flash MX Game Design Demystified". Even being for MX they're very good flash manuals to have. I highly recommend them ;)
Reply
:iconscarabsi:
Scarabsi Featured By Owner Jan 17, 2008  Hobbyist Traditional Artist
Ooooh, cool! Thanks! :D
Reply
:iconresizer:
resizer Featured By Owner Jan 17, 2008
Anytime ;)
Reply
:iconb0rn-t0-die:
B0RN-T0-DIE Featured By Owner Dec 5, 2007  Professional Digital Artist
great job..i'm going to use this^^
Reply
:iconresizer:
resizer Featured By Owner Dec 5, 2007
Please do X3
Reply
:iconposiechan:
posiechan Featured By Owner Oct 23, 2007  Student General Artist
great job resizer! i just bought myself flash and this will really help :heart:
Reply
:iconresizer:
resizer Featured By Owner Oct 23, 2007
Yay, can't wait to see the result XD
Reply
:icon5ft-2-eyes-of-blue:
5ft-2-Eyes-of-Blue Featured By Owner Oct 23, 2007
I took a Flash class. It was cool, but the whole coding things made my head spin. I always had to have m prof help me. Props to you for having such a firm grasp on it.
Reply
:iconresizer:
resizer Featured By Owner Oct 23, 2007
If I actually had a firm grasp on it I would write code from scratch instead of studying other people's code Xp
I took the computer science course, so it's nothing special for me to decipher code ;)
Reply
:iconcollectable:
collectable Featured By Owner Oct 22, 2007   Interface Designer
I used to have flash but now gone. very well done.
Reply
:iconresizer:
resizer Featured By Owner Oct 23, 2007
Thanks =D
And out of curiosity, how that happened?
Reply
:iconcollectable:
collectable Featured By Owner Oct 23, 2007   Interface Designer
??? What happend?
Reply
:iconresizer:
resizer Featured By Owner Oct 23, 2007
You losing flash
Reply
:iconcollectable:
collectable Featured By Owner Oct 23, 2007   Interface Designer
Cause i just had the version of the internet i found it for free but we wiped computer and we cant find it anymores
Reply
Add a Comment:
 
×




Details

Submitted on
October 22, 2007
Image Size
25.2 KB
Resolution
550×400
Thumb

Stats

Views
4,068 (2 today)
Favourites
91 (who?)
Comments
59
Downloads
182
×