Jump to content


Photo

rotate in place smoothly


  • Please log in to reply
18 replies to this topic

#1 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 19 April 2007 - 12:09 AM

G'day guys,

I've been trying to use Flash's built in rotate tween to rotate a circle in place (spinning disc), but as it approaches 360 degrees there's a little skip - is there a way of getting it to rotate 100% smoothly?

Cheers!

Boog :hitit:

#2 Bug

Bug

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 3,611 posts
  • Gender:Male
  • Location:Perth, Australia

Posted 19 April 2007 - 01:17 AM

I believe you'd have to make it turn 359 degrees, because the first degree is the same as the 360th :hitit:

#3 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 19 April 2007 - 01:52 AM

I tried that, unfortunately.

:hitit:

#4 bezz

bezz

    Young Padawan

  • Members
  • Pip
  • 23 posts
  • Gender:Male
  • Location:Berlin, NJ
  • Interests:Flash, Snowboarding, Paintball, Learning Guitar

Posted 19 April 2007 - 03:30 AM

You could always use actionscript to do it.
code:
onClipEvent(enterFrame){
this._rotation+=5;
}


#5 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 19 April 2007 - 05:04 AM

That's close to what I did! I found a thread somewhere which showed me how to speed up and slow down the rotation, too B)

I've got a different issue now... :hitit:

If you would kindly look at the swf on the below link:

http://www.simonwats...au/sb/sbee.html

...you can see how the left edge of the album cover and the right edge of the record get cut off to the size of my swf - is there something I can do to make it not look so bad? I don't really want to resize my swf's width to 1300px or whatever it'd need.

Also, there's a little glitch on my machine when you press stop on the turntable - does that happen for anyone else?

Cheers, guys :)

#6 Pax

Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 19 April 2007 - 08:27 AM

You could try doing fullscreen flash with it if you need that much space. Either the people see the animation, or it gets cut off by the edge of the browser window. There should be some tuts listed here for that kinda stuff. Let me know if you need any help...if youre trying to reposition stuff, it can be a bit of a headache...if you want an example of it, I just posted a flash website in the site showoff and feedback part of the forums here that uses it. I can show you the code that takes care of it all if need be.

#7 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 19 April 2007 - 12:38 PM

Thanks Pax - I did the full screen thing, and it's much better - you can see it at the same link.

:D

#8 bezz

bezz

    Young Padawan

  • Members
  • Pip
  • 23 posts
  • Gender:Male
  • Location:Berlin, NJ
  • Interests:Flash, Snowboarding, Paintball, Learning Guitar

Posted 19 April 2007 - 08:39 PM

Cool idea for a music player.

#9 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 19 April 2007 - 09:54 PM

Thanks mate :P

I've actually refined it a little again, if you're interested - very happy now :)

#10 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 20 April 2007 - 01:23 AM

Actually, I've thought of another thing I'd like to do, which of course is something I don't know how to do :P

I've created a few extra pngs of the turntable arm, as if you rotate away from its original postition, it looks terrible. Anyway, I'd like to get some actionscript into the mp3 player, which does a tween between randomly chosen pics (arm1, arm2 etc), so that you get the effect of the arm moving to a different position when the next song plays (doesn't have to start at the edge and work through).

Any ideas? Sorry I ask so many questions - at least I'm adding to the general store of knowledge, I guess :)

It'd be a rotation tween, btw :)

#11 Pax

Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 April 2007 - 07:53 AM

Check out Fuse...easy tweens and it can sequence it for you. Makes making a series of tweens easy.

www.mosessupposes.com/fuse/

I think thats the url.
You'll just need to put your animations into a function and call that function on the start or finish of every song.

#12 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 20 April 2007 - 09:26 AM

G'day mate,

Actually, I've been using Fuse, which is really cool! I didn't realise you could tween between two different pics using it, though - I'll check it out :D

#13 Pax

Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 20 April 2007 - 10:04 AM

Well, you cant tween from one and morph it to another, but you can tween one to the start of the other, drop the alpha than use the other pic and tween it. Fuse is easy because you can sequence things nicely...dont need all the listeners and onMotionFinished garbage.

#14 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 20 April 2007 - 10:15 AM

I'm happy enough with how it looks when it tweens (doesn't have to go far, anyway), but it's the end position I don't like the look of - is there some way of tweening the first pic, and then replacing it at the end with the second, all using actionscript?

:D

#15 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 20 April 2007 - 12:00 PM

Sorry about me talking to myself - I'm just working things through and then posting lol

I've realised I've got some issues with this concept. I'm starting to think it's too hard, but I'll at least go through it to the best of my ability!

Firstly, the pngs of my turntable arm don't look good rotated at all, so generating a random destination for the tween won't work (unless I do pngs of every degree, which would be ridiculous). Therefore, I think the most logical way to do this would be to add a node to the player's XML, and every time a new song plays, rotating the current png to the new png's position. This all sounds very complicated!!! The other option would be to design the arm in Flash, so it looks fine rotated - obviously, it wouldn't look quite as cool!

I think, regardless of which I chose, I'd have to use the XML to control where the arm tweens to, only because you'd want it to go to a certain place every time you played a certain song. I'd imagine something like this:

* the XML would have a node added (ie position A, position B, etc) to each song
* there would be a different png for each position in the XML (if we used pngs)
* not sure how this would work, but when the player goes to the next song, somehow it would have to read where to tween the arm to. Can we use information from the XML? It'd be great if a variable could check the XML and then tween from the current postition to the destination position.

Anyway, if this isn't interesting enough for anyone to help me with (especially Pax, who's been way too nice to me), I won't worry - I think it'd be a very interesting exercise, though!

Sorry about the long post! It's 3am here (I'm watching the cricket and working), so I hope I've made sense!

:D

#16 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 21 April 2007 - 05:05 PM

Update: posted at the Fuse forum, and was told about smoothing (something I'd never heard of!), which I applied to the png, and it looks fine rotated now :)

So my only issue is the rotation using XML, if anyone could be bothered :rolleyes:

#17 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 22 April 2007 - 04:29 AM

Got it done!!! A guy on the Fuse forum (Andrew Fitzgerald) has a class called FuseXML, and he very generously spent time with me getting it to work.

http://www.simonwats...au/sb/sbee.html

:D

#18 Pax

Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 22 April 2007 - 09:00 AM

Sweet stuff mate, glad you could get it working :D Animation looks very smooth. Hope you learned some decent stuff with the xml loading and whatnot. Now go replace your content with xml driven stuff! :D

#19 boogooloo1

boogooloo1

    Young Padawan

  • Members
  • Pip
  • 116 posts

Posted 22 April 2007 - 05:49 PM

Cheers, mate! Actually, it's funny you mention that, because this guy has a completely XML driven photo gallery which is really nice - didn't even occur to me you could have pretty much EVERYTHING (number of columns, colour schemes, etc) in an XML, which is pretty bloody cool.

Anyway, I'm rapt with the turntable - I think it's the best thing I've done to this point. The only thing which still bothers me is that volume issue, so if you find time to look at it, please do :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users