all groups > flash (macromedia) > august 2006 >
You're in the

flash (macromedia)

group:

Scrolling image jumps at odd times


Re: Scrolling image jumps at odd times tralfaz
8/3/2006 4:10:01 PM
flash (macromedia): [quoted text, click to view]

I recommend getting rid of the timeline tween. It's not smooth for big bitmaps. If you keep bitmaps landed on whole pixels they
don't jump so much. If you tween bitmaps, they will land on uneven pixel numbers like 77.4 instead of 77. A bitmap displayed at
77.4 would be displayed at 77. If it was at 77.7 it would shift to 78. (because you can't spit pixels)
That decimal shift makes tweening bitmaps jump sometimes.

To get smooth tweening bitmaps, keep them on whole numbered pixels at all times. To do that requires just a little bit of code.
Make a single frame movieclip of your image. Give it an instance name like mc. Then use some actionscript to make sure that the
movements stay on whole pixels all the time like this..

// code at frame 3 after your preloader.
stop();
ypos = 0; // set initial value of zero
dir = -1; // initial direction is up (negative)

// once per frame, run this code
this.onEnterFrame = function()
{
if ( (ypos - dir) < -348) // after it goes up to pos -348 start down again
dir = 1; // will add 1 to the ypos now
else if ((ypos + dir) > 0) // has reached the bottom, start up again
dir = -1; // direction is now negative

ypos += dir; // change the ypos value by the direction number
mc._y = ypos; // and apply it to the bitmap movieclip
}


The variable ypos is used to keep the position numbers even. If you used the code directly on the clips y value, it will soon be
off the whole numbers.
Use higher frame rate, like 30 for improved smoothness.
This code is AS1.. you may have to change it a little bit for AS2.
tralfaz

Scrolling image jumps at odd times aubiera
8/3/2006 9:52:23 PM
I built a series of very simple Flash animations for the following site:
http://www.fishinglodgecapcana.com
The animations consist of rather large images that slowly scroll down then up
across the narrower stage. My problem is that after the first loop which
displays fine, some of the animations are displaying a jump behaviour after
they transition from down direction to up. You can observe this behaviour on
"The Lodge" page and the "Gallery" page. I've tested them in the flash file,
but they seem to work fine through all loops. Only when inserted into the
webpage do they show the problem. I doubt that the use of SWFobject script has
anything to do with it. I did try using bitmap caching with a view to making
the scroll smoother and wonder if this is provoking the behaviour. If someone
would like to take a look at one of the FLA files, they can download it from:

Please help! http://elizayoung.com/downloads/lodge2.fla.zip
Re: Scrolling image jumps at odd times tralfaz
8/22/2006 3:36:21 PM

[quoted text, click to view]

No attachment is there. Anyway, last time you provided a link to the fla. I also found the swf at that location.
Because I use Flash6, I cannot open files made with version 7 or 8. I can convert a version 7 or 8 swf file into a version 6 fla
though. That's how I looked at your file the first time.
If you put the fla and swf up on your website and post a link to it, I or someone with a newer Flash version can look at it.
tralfaz

Re: Scrolling image jumps at odd times aubiera2
8/22/2006 8:44:26 PM
Thanks for the reply. Sorry for taking so long to follow up; I did try, but
got snagged with that nickname login thing.

I've tried implementing your suggestions, and have got so far as to get the
image scroll up and down. But I can't seem to get it to start where I want it
to. It seems to jump to the middle before starting to scroll.

I've attached the file and ask that you take a look at it. I will be
exporting this file to a swf and importing that to the library of the preloader
file.

Thanks very much for the help.
Re: Scrolling image jumps at odd times tralfaz
8/23/2006 10:36:34 AM

[quoted text, click to view]


It's mainly about getting the registration points on the corner instead of the middle. Also, onEnterFrame should only be on a
single frame because it repeats once for each frame. Since the movement is done with Actionscript, you won't need more than one
frame.

http://members.cox.net/kompanionkare/flash/tralfaz_v6.zip
tralfaz

Re: Scrolling image jumps at odd times aubiera2
8/23/2006 4:12:04 PM
Sorry about the nonexistent link, I've uploaded the fla in version MX 2004(v7) and the swf in v6 as1.

Here's the link:

AddThis Social Bookmark Button