View Full Version : If you know this, I'll eat my hat.
brintonwhite
July 24th, 2003, 04:00 PM
I want to create a coin flipping in the air sort of effect from a circle drawing. I feel sure that actionscript would be the best way but don't know how. I did a very basic tweened version of the coin spining upwards once. Here it is:
http://www22.brinkster.com/tallpox
If you know how, seen a tutorial or just about anything, I would be delighted.
Thank you
jay-em
July 24th, 2003, 04:51 PM
Will it actually be a coin? What type of object will it be? Will it have two different sides?
___:block: jMkM
brintonwhite
July 24th, 2003, 05:02 PM
It will be just a circle in yellow and have a drawing on it. Probably turned into a graphic symbol. It does not have to look 3d and it does not need seperate drawings for each side. I want it to move pretty quick so that two pics wont matter. Does this help at all?
Thank you.
Meridian
July 24th, 2003, 11:48 PM
Animating it in Swift3d might be your best bet for the most realistic looking motion
http://www.swift3d.com/
aurelius
July 25th, 2003, 01:28 PM
Draw a circle with actionscript, then do this:
circle_mc.onEnterFrame = function() {
this._y -= 2;
this._yscale -= 2;
} // end onEnterFrame()
This will move the circle upwards 2 px on every frame, and it will make the vertical scale 2 percent less each frame. When the vertical scale reaches 0, it will start into negative values, which causes the clip to be flipped and start scaling bigger in the opposite direction. That's exactly what you want, me thinks.
PS. Love the Homer reference in the subject. ;)
brintonwhite
July 25th, 2003, 01:52 PM
I am not sure where to put this actionscript. Do I put it on one of the frames?
Thank you for your time.
Meridian
July 25th, 2003, 01:54 PM
on the Movie Clip wich he's calling "circle_mc"
brintonwhite
July 25th, 2003, 01:56 PM
Thanks, I know nothing about actionscript. so forgive my ignorance.
Meridian
July 25th, 2003, 01:58 PM
That's ok I didn't know anything 2 months ago, and now I know a lot and am learning more everyday and it's all thanks to the super nice people who are on these boards.
pom
July 25th, 2003, 02:05 PM
aurelius >> Are you Retrotron from as.org?
senocular
July 25th, 2003, 02:09 PM
Originally posted by Ilyas Masa
aurelius >> Are you Retrotron from as.org?
yes ;)
aurelius
July 25th, 2003, 02:59 PM
Hey there Ilyas Masa, as senocular said, yep, that's me. ;) Are you somebody I'd know from as.org?
brintonwhite
July 25th, 2003, 07:22 PM
Thanks guys for all the responses. Something really wierd happened when I went and enrolled at the flashkit forums: I got barred and didn't even do anything wrong. All I did was ask about a site that I liked at the time. Very odd. It was on the cool site bit. Very strange. I am now not allowed to log on!!!
Thank again for all the bits of info
senocular
July 25th, 2003, 08:21 PM
FK is wacked :) I was asked to mod there but I said no. I didnt want to mess with it. So instead, gparis got the job. Good for her. Shes cool and very helpful in the forums (though her site goes full-screen on you without warning so its instant poo, but whatcha gonna do?).
You're in good hands here... for the most part ;)
Meridian
July 25th, 2003, 08:46 PM
Nothing beat a warm piping hot cup of "Instant Poo" in the morning.
Just add water! :)...........and poo
brintonwhite
July 25th, 2003, 09:32 PM
Senocular,
You say you were asked to be a moderator at flashkit?
How does a person get good enough to be asked this sort of thing and who exactly asks?
Just curious, thats all.
aurelius
July 25th, 2003, 10:18 PM
I'll add some more to that question: senocular how long have you been Flashing? How did you learn Flash (in particular AS)? And what do you do professionally? You needn't answer these questions if you don't want to, all your fans are just so curious. ;)
senocular
July 25th, 2003, 10:46 PM
Flashing since release of Flash 4. Actionscripting since 5 (I avoided it for the most part in 4 since it was a pain in the *** to deal with, sticking to Director for the most part).
Currently I work at a small multimedia company doing Flash, Director and HTML related things. :)
Scootman
July 26th, 2003, 04:56 AM
i made a quick fla of the coin flippy thing... you can mess with the variables to change the rotation speed and height it flies up...
Scootman
July 26th, 2003, 05:03 AM
o ya heh you gotta eat your hat now too right? lol
brintonwhite
July 26th, 2003, 09:53 AM
Scootman,
I am almost ready to start eating my hat but need to know one more thing. I need the coin to flip like you made it do. but when it lands i want it to stop. I have tried putting a stop at the end of the action script but it carries on flipping.
here is the actionscript you supplied:
onClipEvent(load)
{
_y = 400;
scale = -15;
origY = _xscale;
grav = 0.6;
velocity = -20;
}
onClipEvent(enterFrame)
{
_yscale += scale;
if(Math.abs(_yscale) >= origY)
{
scale = -scale;
}
velocity += grav;
_y += velocity;
if(_y > 400)
{
_y = 400;
velocity = -20;
}
}
senocular
July 26th, 2003, 10:01 AM
I hope this is your hat =)
http://andykaufman.jvlnet.com/an_two.gif
aurelius
July 26th, 2003, 10:26 AM
Oh man, that is classic!
aurelius
July 26th, 2003, 10:36 AM
Senocular, thanks for answering. :) I started somewhere around version 3/4 too, but grad school took me away from all development and I missed version 5 altogether. I just picked up MX a few months ago (when school temporarily let up), so it's nice to know that in a few years, one can achieve great things with hard work (although I'm fairly certain there's also a fair measure of talent in your blood). =)
brintonwhite
July 26th, 2003, 10:44 AM
Do any of you know how to stop the coin flipping?
I'm nearly there with this. So thanks
Scootman
July 26th, 2003, 03:24 PM
if(_y > 400)
{
_y = 400;
velocity = -20;
}
this if statement at the end is what makes it flip again... i just did that so you could see the effect over and over... just take that out if you want it to only go once.... i dont know how you want it to look after its done or if you even want it on the screen at all....
Scootman
July 26th, 2003, 03:32 PM
here i made it so the coin stops at the bottom of the stage... to do any sort of bouncing im not sure really...that seems like it would be sort of difficult to achieve.... unless maybe if you tweened that part and when the coin got to the bottom of the screen you set all the vars to 0 (like i did in this fla) and had it play the animation... i dont know, but hope this helps
(get ready to eat your hat)
Tempest811
July 26th, 2003, 03:35 PM
u may wanna change that scale to -6 and the grav to .4 just so it flips a little slower...gives people more time to actually distinguish whats on the coin
Scootman
July 26th, 2003, 03:57 PM
he said it didnt matter what was on the coin
Scootman
July 26th, 2003, 03:59 PM
i could do it with 2 different images though... if they are the same size put them in an mc on frames 1 and 2 and each time the coin flips you switch the frames... but yeah i guess just change the velocity and rotation speed to lower to slow it down... perhaps divide it by a number each time it hits the ground or whatever... ill try and do an fla
Scootman
July 26th, 2003, 04:29 PM
i got the 2 different images thing... but i couldnt get the bounce to work... maybe someone else can mess with it and get it to work... (i still wanna see the hat get eaten)
(with the images its too big to attach so i uploaded it)
www.freewebs.com/scottgilmore/coin%20flip.zip
i think you have to copy/paste the url into the bar for it to work
brintonwhite
July 26th, 2003, 07:45 PM
I'm eating. Chomp, munch, chomp.
Thanks guys
Scootman
July 27th, 2003, 03:27 AM
lol, glad i could help
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.