Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Smooth Image Scroll in Flash

Status
Not open for further replies.

orlNewbie

Programmer
Jan 15, 2003
15
0
0
US
what's up forum...


many flash ads these days, incorporate an image...scrollling across the window....i'm trying to get this effect (which is quite simple), but it's not turning out very smooth...i have a frame rate of about 35 and have spanned the movement over about 250 frames, i'd rather not use this many frames...but i want the image to move across very slowly...but very smooth...right now..all i could get is a very jerky motion...hope my explanation was clear...

any ideas?
 
35 is a high frame rate for web based applications however you will get a much smoother effect using actionsript to control the movement of the image rather than all those frames. just build a loop that incrementally alters the _x and _y properties of the image
 
Hi there

There shouldn't be a problem. How big is your image? Is this movie embeded in another one? If so you may set the frame rate high for the scroll but it will take on the frame rate of the parent movie. Otherwise , without more information, I can't see why there would be any problem.

ogm
 
Bill, thanks so much for your qucik response and advice..
however, i'm still quite unfamiliar to action scripting...
do you think you could provide me some example to assist in achieving my objective...how to create the script..what the parameters might be etc...?

thanks again very much for the assist
 
oldgrey, no it's not embedded in any other movies...i just used a high frame rate, as i imagined the scroll would be a lot smoother than if it were lower...however it's still turning out somewhat jerky...the images are about 450x300...
 
Like this:

Regards
David Byng
bd_logo.gif

davidbyng@hotmail.com
 
Who's that woman?

She has that look in her eye... like she knows something we don't. frozenpeas
 
i havent had a chance to try this out but something like

clip._x=0;
clip._y=0;
for(i=0;i<640;i++){
//keeping y constant
clip._x=i;
//delay suggest using gettimer()if needed
}

play around with the values and you ought to get a smooth scroll. it may be necessary to introduce a delay as code as written above will flash the clip across the screen. you could also try increasing the number of loops and reducing the value of i.
 
dave, bill...all of you guys...i only found this forum today, but have been seeking the answer to this question for some time now...thank you so very much for sharing your knowledge!

greatly appreciate the help...
 
Code:
updateAfterEvent();
will smooth it out some, too. frozenpeas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top