[quoted text, click to view] MShetler wrote:
> Hello all,
>
> I am currently working on a flash file and I'm an intermediate user. My
> actionscript abilities are probably close to beginner, but I'm a quick learner
> (most of what I have learned with actionscript has been self taught).
>
> In my flash file I have an animation of a rotating globe. Each frame of the
> rotation is a separate raster image - I don't know how you would represent a
> rotating globe otherwise, not really something that can be tweened (suggestions
> are welcome).
>
> I have different locations off to the side of the globe. When the user mouses
> over a location, the globe spins to that location. When they roll out, the
> globe spins back to a static starting point.
>
> I wanted the animation of the globe to be as smooth as possible, so, I have a
> }else{ statement for every possible frame. IE - if the globe animation is
> rotating back from a position and the user mouses over a new location before
> the animation stops, it doesn't jump back to the starting static position, it
> seemlessly flows from the position it is currently at to the new position the
> user has moused over.
>
> Make sense?
>
> It works flawlessly as is. I've spent quite a bit of time testing it.
> However, the code is bulky in appearance and according to the size report bulky
> in bytes as well.
>
> Is there a differnent way to set this up to cut down on size - mainly byte
> size if possible?
>
> I will include a bit of code so you can see what I'm talking about:
>
> on (rollOver) {
> if (_root.EarthClip._currentframe == 1) {
> _root.EarthClip.gotoAndPlay(140);
> } else { if (_root.EarthClip._currentframe == 160) {
> _root.EarthClip.gotoAndPlay(156);
> } else { if (_root.EarthClip._currentframe == 161) {
> _root.EarthClip.gotoAndPlay(155);
> } else { if (_root.EarthClip._currentframe == 161) {
> _root.EarthClip.gotoAndPlay(154);
> } else { if (_root.EarthClip._currentframe == 163) {
> _root.EarthClip.gotoAndPlay(153);
>
> and so on, and so on . . .
>
>
> Any help would be greatly appreciated.
>
> Thank you in advance.
>
> -MShetler
>
Little cleaner...
if ( ) {
//
} else if {
//
} else if {
//
}
Also, there is the "switch" function, which you should look up in the AS
2 dictionary.
--
x theSpaceGirl (miranda)
### future media, video, flash, animation @
#
http://www.northleithmill.com ### music industry web & promotion @
#
http://www.digitalharmony.co.uk # Remove NO SPAM to email
# This message must not be reproduced anywhere but Usenet & GoogleGroups