How To Smooth The Movement (scrolling Background And Scrolling Menu ) ?
hi! i'm new here and also a beginner in flash.. i need some help on how to smooth the movement in my flash project.. scrolling background with scrolling menu.. i got this script from a tutorial and i did some adjustment on it.. but somehow both the background and menu movement are not smooth as i want. its kept jerky along their movement. this is the script that i use to move both background and menu.. hope someone can help me to repair or to alter this script.. thanks! =)
//scrolling background with scrolling menu //when mouse moves left, background and menu moves right
if ((_xmouse>-0.5) && (_xmouse<230) && (_ymouse>-0.1) && (_ymouse<450)) { _root.back._x =_root.back._x +6 ; _root.menu_mc._x =_root.menu_mc._x +10 ; }
// when mouse moves right, background and menu moves left
if ((_xmouse>400) && (_xmouse<616) && (_ymouse>-0.1) && (_ymouse<450)) {
_root.back._x =_root.back._x -6 ; _root.menu_mc._x =_root.menu_mc._x -10 ; } if (_root.back._x>1309.5) { _root.back._x = -79; } if (_root.back._x<-697.8) { _root.back._x =679; } //---------------------------------------------- if (_root.menu_mc._x>1200.5) { _root.menu_mc._x = -99; } if (_root.menu_mc._x<-730) { _root.menu_mc._x =569; }[/size][/size][/size][/size]
SitePoint > Design Your Site > Flash and Actionscript
Posted on: Jul 18, 2004, 20:14
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Smooth Scrolling Background
Does anyone know how to achieve a smooth scrolling BG as seen on the site: http://www.farcrygame.com/indexFlash.html
I've created a MC with several layers (BG, buttons, etc) that is scrolling depending on your mouse movement (25 FPS) but when I lauch it it's still not smooth.
The BG is but the layers on top of the BG are not, although they are in the same MC as the BG.
Any ideas? or even better code examples?
VMT
Smooth Scrolling Background Mouse Move
Hi,
I have been stuck on this for ages, using laco tween I have been attempting to create a background image that scrolls like this site: http://www.kingbrownmag.com and many other use.
However I am only able to create something that is clunky and moves with the mouse, there is no inertia and the movement is not great. Any hints, tips, or ideas where to look for some code that might help me achieve this effect wouldbe much appreciated.
Thanks,
Dabush
Car Movement, Scrolling Background And Hit-test
I have recently started to make a game for a driving school website where you basically take a 2d driving test. I have searched everywhere under the moon for script help on the three key points of making this sort of game (movement, scrolling background and collision detection). I use flash 8 and the scripts i have for movment works and collision detection works fine, but as soon as i try to make the background scroll its a complelty different story.
The scripts im using is
nClipEvent (enterFrame) {
//This code will advance the car forward.
if (Key.isDown(Key.UP)) {
speed += 1;
} else {
// This will make the car go backwards
if (Key.isDown(Key.DOWN)) {
speed -= 1;
} else {
speed *= .9
}
}
//The car will start to slow down after the speed of 25
if (Math.abs(speed)>25) {
speed *= .6;
}
// This will change the angle of the car
if (Key.isDown(Key.LEFT)) {
_rotation -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += speed;
}
if (Key.isDown(Key.SPACE)) {
speed -= 1;
}
// This will make the car move
speed *= .9;
x = Math.sin(_rotation*(Math.PI/180))*speed;
y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
if (!_root.move.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.3;
}
}
but the only script i can work out for scrolling background uses a different movement script and doesnt allow me to use collistion detection ...
onClipEvent (load) {
speed = 0;
topspeed = 12;
accel = 0.5;
braking = 1;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
if (speed+accel<topspeed) {
speed += accel;
} else {
speed = topspeed;
}
} else if (speed>0) {
speed -= .5;
}
}
onClipEvent (enterFrame) {
if (key.isdown(key.SPACE)) {
if (speed<=0) {
speed = 0;
} else {
if (speed-braking<0) {
speed = 0;
} else {
speed -= braking;
}
}
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT) && speed>=3) {
rotation += 3;
} else if (Key.isDown(Key.LEFT) && speed>=3) {
rotation -= 3;
}
if (Key.isDown(Key.RIGHT) && speed>=2) {
rotation += 5;
} else if (Key.isDown(Key.LEFT) && speed>=2) {
rotation -= 5;
}
_rotation = rotation;
angleRad = (_rotation*(Math.PI/180));
xSpeed = speed*Math.cos(angleRad);
ySpeed = speed*Math.sin(angleRad);
if (!_root.move.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.3;
}
_root.terrain._x -= xSpeed;
_root.terrain._y -= ySPeed;
}
So, what i am actually asking is ... either for the first script i have posted, does anyone know how to make the backgound scroll or for the second script, does anyone know how to detect collisions.
Thanx for your time
Joe
Smooth Scrolling Menu Bar
hello,
i was wondering if someone could tell me how the scrolling effect is acheived on the following site when you flick to different sections and it scrolls quicker or slower depending on how far away the section is,
nevermind probly confused you the site is at http://www.digitalfist.com
A Menu With A Scrolling Background?
Hi there, I'm having problems with what may seem like a simple menu idea, so I'd be glad if anyone could help.
I'd like to have say 4 floating link buttons constantly in the same position at the bottom of the page, but when you click on the link then the background would slide along to a desired section.
I found it hard. I'm stuck, as I don't know what to do if the user is on Section 1, and wants to go to say section 3. That means that when the background slides along, you'd see section 2 momentarily.
Does anyone know what I'm talking about, or indeed how to do this in Flash? Any tutorials or advice would be appreciated, as this is gonna be a site for my Higher Art project.
Thanks!
-Jimmy
Creating A Background Scrolling Image Which Moves With Menu Buttons
I'm having a bit of a head scratcher here. I'm trying to create something similar to http://www.barneys.com where the user clicks on a menu button and the background image will scroll to the corresponding portion of the image. I'm currently opening the menu contents as layered movies above the background, but I can't make the image slide to the appropriate section, only jump right to the spot by loading the frame of the main timeline which is using a motion tween (the only way I could make it work, but not the way I want to nonetheless.) Can anyone point me to a tutorial or point out some actionscript I should use for this? I'm using MX, relatively green to actionscripting. Thanks.
Vertical Scrolling Menu Not Scrolling
i'm using flash mx
i inserted this code from a friend who had a horizontally scrolling menu and altered it slightly to suit my vertical menu. when i test it nothing moves.
i have this action placed in frame 3 of my movie:
center = 220.5;
reelPos = reel._y;
topStop = -360;
bottomStop = 360;
and in frame 4 i have this action:
if (_xmouse<774 & _xmouse>10) {
reelSpeed = (_ymouse-center)/10;
reelPos = Math.round (reelPos+reelSpeed);
if (reelPos<topStop) {
reelPos = topStop;
}
if (reelPos>bottomStop) {
reelPos = bottomStop;
}
reel._y = reelPos;
}
what am i missing here?
Smooth Scrolling
Hey,
I'm trying to make a simple mouse-position based vertical scroller.
The movie is 180x400. Here's the code I'm using (off of a tutorial):
onClipEvent (mouseMove) {
xmousepos1 = _xmouse;
ymousepos1 = _ymouse;
if (ymousepos1<175 && xmousepos1>-10 && xmousepos1<200) {
_root.scrollclip.nextFrame();
}
if (ymousepos1>225 && ymousepos1<400) {
_root.scrollclip.prevFrame();
}
if (xmousepos1<-10 || xmousepos1>200) {
stop ();
}
xmousepos2 = _xmouse;
ymousepos2 = _ymouse;
}
what comes out is a very jerky navigation system... is there a way to make it "smoother"? Any help would be appreciated.
Thanks!
Smooth Scrolling...
Ok, Well I'm sure plenty of you have at one point our another coded some movment, the basic _x = _x + speed; etc with the keys... so heres my problem:
I have movement code setup, similar to the above, but it seems that when my object moves with the arrow keys, that its really just jumping say 10 pixels, that is specified in the speed varible. As you would imagine this is a problem with collision detection, as you can only get within 10 pixels of the target, or over shoot it. How can I create smooth motion, that will calculate pixel by pixel, or allow my object to stop directly at the specified collision detection? Would I be getting in the the hitTest(x,y, shapeflag) stuff?
Regards,
Tyler
Smooth Scrolling Help?
Hello, I hope this is in the right section.
I have query on scrolling image galleries that I believe will be fairly simple to overcome for any one of the experts on here.
I am in the middle of constructing a horizontal scrolling picture gallery. Currently I have two buttons that can scroll the gallery left or right, and these are activated on rollOver. However, to actually scroll effectively, I need to roll over the buttons numerous times.
What I want to know is how I can get the gallery to scroll in a continuous and seamless manner when the mouse is over the appropriate button. Also, I want to know how to create a limit point to the scrolling.
An example of this effect is as seen here: http://www.kraehahn.com/p1.htm
This is the "groundwork" that I already have:
Left scrolling button:
on(rollOver){
_root.gallery._x+=30;
}
Right scrolling button:
on(rollOver){
_root.gallery._x+=30;
}
What do I need to add to it?
Thanks in advance.
Smooth Scrolling
Okay, I hope this is in the right section this time. I originally posted this in the General section but I had no help, even after bumping it up to the top again.
I have query on scrolling image galleries that I believe will be fairly simple to overcome for any one of the experts on here. I'd be grateful if anybody could offer their help.
I am in the middle of constructing a horizontal scrolling picture gallery. Currently I have two "arrow" buttons that can scroll the gallery left or right, and these are activated on rollOver. However, to actually scroll effectively, I need to roll over the buttons numerous times.
What I want to know is how I can get the gallery to scroll in a continuous and seamless manner when the mouse is over the appropriate button. Also, I want to know how to create a limit point to the scrolling.
An example of this effect is as seen here: http://www.kraehahn.com/p1.htm
This is the "groundwork" that I already have:
Left scrolling button:
on(rollOver){
_root.gallery._x+=30;
}
Right scrolling button:
on(rollOver){
_root.gallery._x+=30;
}
What do I need to add to it?
Smooth Scrolling ?
hi all
i have fla file i downlaod from flashkit for scrolling text. itz very static and rough scrolling i want smooth scrolling like _y should be up and dowan very smoothly but in this its very hard plz any one can change this code....or if possible i don scroll just mouse movement will scroll my text and objects ??????? is possible
Smooth Scrolling
This is a post that has been asked and answered many times before but the search function doesn't work for me (or for everything i dont know) i can't find the posts
I have a flash website that loads an external file that in turn loads text from a text file then once loaded reattatches the scroll bar componant to the dynamic text frame so that the new parameters re-apply. However when the file is ran the scroll bar is jerky and responds slowly.
code: l = new LoadVars();
l.onData = function(r) {
_root.empty_mc.news_txt.htmlText = r;
};
l.onLoad = function() {
scroll.setScrollTarget("news_txt");
};
l.load("news.txt");
stop();
If someone could answer this for me or link me to an allready answered post it would be much appreciated!
JAK
Smooth Scrolling
Hi, how can I make a background picture continually smooth scroll from right to left ?
Thanks...
Smooth Scrolling An MC
Hi,
I'm trying to scroll some clouds across my movie, and although my framerate is at 60, there's still some slight choppiness to the movement of the clouds... a sort of pixel by pixel snap.
I was wondering if anyone knew of a good way to achieve a more silky type of motion. I'm aware of inertia, but I'm unsure how that would look with this given my clouds are supposed to move very, very slowly.
Take a look at this .fla to see what I mean.
http://crm.matmon.com/tmp/skytest.fla (419k)
Thanks for any help!
Scrolling Not Smooth
Hi,
I'm a noob and I'm trying to create a content box to load into my main movie. Everything works only that the scrolling of the text up and down is not very smooth. In fact you have to click several times to go more then one line down. How can I fix this? I'm loading my content from a txt file using this line of code:
Code:
System.useCodepage = true;
content.html = true;
myLoadVar = new LoadVars();
myLoadVar.load("content/home.txt");
myLoadVar.onLoad = function(success){
if (success == true){
content.htmlText = myLoadVar.content;
}
};
then I scroll using this (only showing code on down arrow, it's the same for up)
Code:
on(press){
content.scroll++;
}
on(keyPress "<Down>"){
content.scroll++;
}
Help greately appriciated.
-Fr33m4n
Smooth Scrolling?
Hi,
I've got a site built, and part of it i want the text ive got to scroll up and down when arrow buttons are pushed. I've done it in a slightly odd way, but i think itl be easiest for what im doing.
My problem is that when you push the arrows, the text scrolls 30 pixel (the amount i assigned) only each time you push the button, so if you hold it down it doesnt scroll smoothly.
Ive attached the file, if someone has a bit of time to look, maybe you can advise me as to how i can fix it.
thanks very much for any help!
Smooth Scrolling In As3 ..
I've made this "banner" where the user can scroll to the left / right by positioning his mouse over it.
It's basically just a canvas with an onMouseOver which calculates "speed" by checking the mouse position, and then a Timer which ticks every 10th ms to do the actual moving of the canvas.
Check it out here:
http://www.juicability.com/examples/...eryWidget.html
The thing is I think it "flickers" a little too much. Does anyone have suggestions on how to make it run "smoother"?
Here's the onMouseMove function which calculates xmove (the amount of pixels to move on next tick) in addition to the onMoveTimerTick function which actually does the moving:
http://actionscript.pastebin.com/m73979fed
- bjorn
Smooth Scrolling
Hi all,
I found this tutorial for making a smooth scrolling bar, which looks great, but I carn't get it to work (I dont think it's explained that well). Does anyone know of another tutorial for the same effect.
http://www.stilva.com/smooth-scrollbar/
Smooth Scrolling
howdy,
i'm using the following script (in a loop) to scroll a long strip of images from side to side based on the mouse position
Code:
reelspeed = (((_root._xmouse-centre)*-1)/20);
reelpos = Math.round(reelpos+reelspeed);
if (reelpos<leftstop) {
_root.arrowz.gotoAndStop ("left");
reelpos = leftstop;
}
if (reelpos>rightstop) {
_root.arrowz.gotoAndStop ("right");
reelpos = rightstop;
}
_parent._x = reelpos;
_root.arrowz.gotoAndStop ("both");
unfortunately the result is a bit jerky at times, espescially with faster movement. i'm currently running it at 12fps, tried messing with this but no luck.
any thoughts? thanks for your time
robbiem
Smooth Scrolling .flv
Is there a way to make flv files scroll as smoothly as Quicktime movies? For instance, I have a QT file that when I play it, I can scroll through it very smoothly. When I convert this same file to a flv file, I lose that. When I drag the scroll bar, there is no smooth transition. Any ideas?
Rolling Menu Smooth Movement
hello all,
I have followed this tutorial on making a rolling menu http://www.shadowness.com/tutorial.p...orial_id=43#02
The problem I am having is making the menu item scroll smoothly and stop at a picture frame when you mouse over. I would also like to load a 2nd layer of images into this menu once a picture has been selected. any help on this would be ace ..
Cheers Peeps ...
Smooth Diagonal Scrolling
Ok, I got a movie clip that scrolls diagonally. Inside the movie i'm using the script:
setProperty (this, _x, getProperty(this, _x) - .3);
setProperty (this, _y, getProperty(this, _y) - .3);
it works, but it's really shaky. It looks like its climbing stairs.. it goes left then up then left then up, and i wont it to move diagonally instead of climb. Any ideas?
Thanks
Charlie
Smooth Scrolling Flash 5
Hey, i was wondering if anybody knew how to make somthing scroll smooth instead of really joulty. Here is the code i've used and i wondered if there was a better way to do this.
Quote:
onClipEvent (enterFrame) {
if (_root.Scrollingup == true) {
_root.Scroller._y = _root.Scroller._y-3;
}
if (_root.ScrollingDown == true) {
_root.Scroller._y = _root.Scroller._y+3;
}
}
I'd appreacate any sudgestions or comments. Thank you.
Continuous Smooth Scrolling
Hi.
Can anybody tell me what should i do in order to get continuous scrolling of text on button rollover? I currently use the
on (press, keyPress "<Up>") {
text.scroll -= 1;
}
way but i don't like it so much
Smooth Scrolling Jpegs
hello
I'm trying to create smooth scrolling jpegs that move in response to buttons. After diligently searching all day I thought I found the perfect movie sample but there's no explanation and I can't quite understand it.
http://www.flashkit.com/movies/Inter...3362/index.php
I did get some jpegs moving with a real nice inertia effect thanks to help from pellepiano. I tried using the code and playing with the coordinates but to no avail. I put a file up -
http://www.glowdesignhouse.com/glowweb8.19_2.html
after the preloader you can see the big jpegs responding to invisible buttons. click on portfolio then kodak-the jpeg is about 2000 pixels wide and I want it to just slide over to the left
thanks!!
Scrolling Text Thats Smooth...
hello all
sorry to bother i no this maybe a simple one... does anybody knoe how to create a really smooth text box...? like the on at :
http://www.internettinyawards.com/
i really like the way the scroll slows down then stops... any ideas please( oldnewbe... i here you are the man)
thanks in advance ..
shrav
Smooth Scrolling (on Rollover)
Hi all, i'm pretty new to flash. I'm using Flash MX2004.
What I'm tryng do do is pretty simple (I think ) and I have seen it on a web site.
It's sort of scrolling banner that 'fast' scrolls to a fixed point when rolling over a button. I have been able to do all I wanted except for the 'fast' scrolling part.
It's like as giving a gotoAndStop() but instead of going immediatelly to the chosen frame it does it with a fast scroll (both forward and backward).
I would like to post the link to the site where i found it but I would not want to it be considered spam.
Can anyone give me some help please? Thanks
Smooth Scrolling Movieclip
Hi, I have this neat little script that I got from one of our fellow members which allows you to scroll any content grouped as a movieclip:
//note: if you change the dimensions of the mask or the location
//of the movie clip, you'll have to determine the new values of
//upperLimit and lowerLimit. Just move the movie clip up and down
//and take note of the "y" property in the properties panel.
//
var scrollAmount:Number = 10;
var scrollInterval:Number;
var upperLimit:Number = 0;
var lowerLimit:Number = -395;
up.onRollOver = function() {
clearInterval(scrollInterval);
scrollInterval = setInterval(scrollDown, 100);
}
down.onRollOver = function() {
clearInterval(scrollInterval);
scrollInterval = setInterval(scrollUp, 100);
}
down.onRelease = up.onRelease = function() {
clearInterval(scrollInterval);
}
down.onRollOut = up.onRollOut = function() {
clearInterval(scrollInterval);
}
function scrollUp() {
clip._y += scrollAmount;
if(clip._y > upperLimit) {
clip._y = upperLimit;
}
}
function scrollDown() {
clip._y -= scrollAmount;
if(clip._y < lowerLimit) {
clip._y = lowerLimit;
}
}
The scrolling however is not smooth. I was wondering if someone knows how to modify the script so that it can provide smooth scrolling of the movieclip.
I would appreciate it much..
:-)
Smooth Text Scrolling?
Is there any way to make a long text scroll smoothly using AS? I tried using a dynamic text field, but that only seems to work with integer line increments so the movement feels jumpy.
Thanks in advance for your time/help.
Can't Make Smooth, Animated Scrolling
Can anybody tell me how I would make a smoothly scrolling, text box using action script with imported text?
I need the text to scroll 30 lines per click in a smoothly animated upward or downward motion.
Any help would be much appreciated.
Smooth Dynamic Text Scrolling
I realize this is probably pretty simple, but is there an easy way to make "smooth" scroll buttons using the .scroll property in MX?
I want to be able to just hold down the button and see it scroll, instead of multiple clicks to scroll.
make sense?
thanks.
Smooth Scrolling Script Interpretation?
hey everyone
-I want to move a big jpeg (2000x280pixels)across the stage under a mask by using buttons with a nice easing effect. size of mask is 450x280 pixels wide and each time you click a number it moves the jpeg 450 pixels across to a specific xy location. I found the perfect sample in the movies section but can't get it to work.
http://www.flashkit.com/movies/Inter...3362/index.php
there's a script on the first frame
targetx = 195;
targety = 139;
then a script within a mc placed in the first frame
startx = GetProperty(/:vozi,_x) ;
starty = GetProperty(/:vozi,_y) ;
horizontalno = /:targetx-startx;
vertikalno = /:targety-starty;
setProperty(/:vozi, _x, startx+(horizontalno/2));
setProperty(/:vozi, _y, starty+(vertikalno/2));
frame2
gotoandplay(1)
the mc is in the first frame in its own layer.
It may be a language barrier-can anyone help me with this script? I don't understand what vozi is?
If you need to see what I'm trying to do here's my link-
http://www.glowdesignhouse.com/glowweb8.19_2.html
go to portfolio then kodak-
thanks
Dynamic Smooth Scrolling Textbox
I'm making a Flash Guestbook that retreives entries from a MySQL database, and I want them to be displayed in a dynamic text box...Which I can do that...I can also make scroll bars based on textbox.scroll-- and stuff, but that scrolls one text line at a time...I've also made static scroll bars that moved the whole textbox up and down based on its _x values so its a smooth scroll...But how can i make it scroll smooth if its dynamic text? How can I tell what the max _x position will be based on the length of the text? Any tutorials or examples would be appreciated, thanks!
Smooth Vertical Scrolling Problem
Hi everyone
I have created with flash 6 nice smooth vertical scroller but it not works with flash version 8
please help, i have attached the source code
Thank's ahead
David
Smooth Scrolling Effect For This Actionscript
Hello Members
I have this actionscript that can be used for scrolling a movieclip regardless of the dimensions.
I got it from one of the members on flashkit (Thanks so much :-) )
I was wondering if anyone has an idea on how to incorporate a smooth scrolling effect into the actionscript.
Here it is:
//note: if you change the dimensions of the mask or the location
//of the movie clip, you'll have to determine the new values of
//upperLimit and lowerLimit. Just move the movie clip up and down
//and take note of the "y" property in the properties panel.
//
var scrollAmount:Number = 10;
var scrollInterval:Number;
var upperLimit:Number = 0;
var lowerLimit:Number = -395;
up.onRollOver = function() {
clearInterval(scrollInterval);
scrollInterval = setInterval(scrollDown, 100);
}
down.onRollOver = function() {
clearInterval(scrollInterval);
scrollInterval = setInterval(scrollUp, 100);
}
down.onRelease = up.onRelease = function() {
clearInterval(scrollInterval);
}
down.onRollOut = up.onRollOut = function() {
clearInterval(scrollInterval);
}
function scrollUp() {
clip._y += scrollAmount;
if(clip._y > upperLimit) {
clip._y = upperLimit;
}
}
function scrollDown() {
clip._y -= scrollAmount;
if(clip._y < lowerLimit) {
clip._y = lowerLimit;
}
}
I will appreciate it so much.
I want to thank all the members that have helped me in the past.
Ciao Ciao
:-)
[F8] Smooth Scrolling Movieclip Problem
Hi there guys and gals,
I have a small problem that I'm hoping you AS experts can help solve.
I've created a smooth scrolling movie clip (courtesy of a lovely person here at Flashkit) which moves dependent on where your mouse is in relation to the movie clip. This works fine, however I want to add a further complexity of adding buttons which when pressed will move the mc to a predetermined position. But there must be something in the code which prevents the mc from moving to a set position...
It's created out of a movie clip (scroller) with 3 frames, within the movie clip is another mc (MC) which contains the photos I am scrolling
here's the code I have to make the smooth scrolling...
frame 1:
xphoto = 0;
widthmovie = 828;
scrollspeed = 18;
widthphoto = 1979;
frame 2:
// Setting the xmouse to 0 in the centre of the movie:
xmouse = _xmouse - (widthmovie / 2);
// Setting the speed:
speed = (xmouse) / scrollspeed;
// If the speed is negative, the speed will be made positive here:
if (speed < 0) {
speed = -(speed);
}
mouseposition = getProperty("/myself", _y);
if (_ymouse < 1) {
speed=0;
}
if (_ymouse > 115) {
speed=0;
}
// If the mouse moves to left, the photo will scroll to the right:
if (xmouse < 0) {
xphoto = xphoto + speed;
}
// If the mouse moves to the right, the photo will scroll to the left:
if (xmouse > 0) {
xphoto = xphoto - speed;
}
// Checking for the left end of the image:
if (xphoto > 0) {
xphoto = 0;
}
// Checking for the right end of the image:
if (xphoto < -(widthphoto - widthmovie)) {
xphoto = -(widthphoto - widthmovie);
}
// Placing the moviclip (MC) on it's new postition:
setProperty("MC", _x, xphoto);
frame 3:
gotoAndPlay (2);
Now what I want to do is use the following code somehow to allow me to use the buttons which are on the root timeline to make the MC clip move to a set position...
This is applied to the MC movieclip..
onClipEvent (enterFrame) {
yMC = getProperty(_root.scroller.MC, _y);
moveMC = _parent._parent.yTargetMC + yMC;
setProperty(_root.scroller.MC, _y, yMC - (moveMC/7));
}
And on the button on the root timeline...
on (release) {
yTargetMC = 200;
}
The file is too big to upload so I can email it. Email me at stevendbernard@yahoo.com.
Best
Steve
Modify To Incorporate Smooth Scrolling.. Help
Hi there,
I have a snippet of actionscript that I am using to scroll a navigation bar I am constructing. I have managed to get it to work, however I have tried to modify it to achieve smooth scrolling without any luck. I would appreciate it if someone could help me out with that.
Below is the script:
Code:
var scrollAmount:Number = 5;
var scrollInterval:Number;
var upperLimit:Number = buttons._y;
var lowerLimit:Number = -(buttons._height - mask._height);
up.onRollOver = function() {
clearInterval(scrollInterval);
scrollInterval = setInterval(scrollDown, 100);
}
down.onRollOver = function() {
clearInterval(scrollInterval);
scrollInterval = setInterval(scrollUp, 100);
}
down.onRelease = up.onRelease = function() {
clearInterval(scrollInterval);
}
down.onRollOut = up.onRollOut = function() {
clearInterval(scrollInterval);
}
function scrollUp() {
buttons._y += scrollAmount;
if(buttons._y > upperLimit) {
buttons._y = upperLimit;
}
}
function scrollDown() {
buttons._y -= scrollAmount;
if(buttons._y < lowerLimit) {
buttons._y = lowerLimit;
}
}
Thanks..
[F8] Smooth Scrolling With Button Press
Hello,
Im trying to make a MC smooth scroll on button press, right now it only advances once when pressed, it doesnt stay advancing when it stays hovered.
here is my code
_root.leftButton_mc.onRollOver= function() {
_root.world.grass._x = _root.world.grass._x + 25;
_root.world.water_mc._x = _root.world.water_mc._x + 5;
_root.world.city._x = _root.world.city._x + 2;
_root.world.item2Button._x = _root.world.item2Button._x + 5;
}
I tried onPress, onMouseOver etc but can not figure this one out, also any easing code help will be greatly appreciated to make it look nice and smooth.
Thanks!
-Tim
Smooth Scrolling Help (actionscript Easing)
I'm trying to achieve a smooth scrolling effect on my thumbnail navigation.
At the moment when you move your mouse to the edges it scrolls in whichever direction your on, thats all cool, but I'm wondering how hard it would be the make the scroll smooth, such as easing out as you get to one side...
Here's the code for the scroller...
Code:
function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 5;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
Any help would be great, thanks in advance...
Completely Smooth Scrolling - Impossible?
is it impossible to create completely smooth scrolling in Flash?
look here:
http://public.develop.fyens.dk/choppy.html
it's moving one pixel per frame, at a framerate of 60 frames per second, and the hardware frequency of my monitor is 60 Hz, so it should be scrolling completely smoothly.
but every second or so, it drops a frame - it's not completely smooth.
you can get the source here, if you screen is not set to 60 Hz you may need to change the framerate:
http://public.develop.fyens.dk/choppy.zip
now, then - assuming that Flash was somehow unsuitable for this kind of task, I went ahead and wrote a win32 application instead ... with the exact same result! ... animation in windows just does not seem to run smoothly ... could it be a driver issue, or is it a general limitation in windows?
I then changed my application to full-screen, and it runs smoothly.
but having to port our entire flash application to a real win32 application running full-screen would be a big task.
any idea if 100% smooth scrolling is possible with Flash or not?
is there something I can turn on or off in Windows somewhere to make it go smoothly?
Thanks!
ScrollPane Component Smooth Scrolling
Hello. I just started working with AS 3.0 and I'm yet learning basics. I searched google and couldnt find the answer to my question; How to make scrolling on ScrollPane component smooth with AS 3.0? Please help.
Can't Make My Scrolling Text Smooth
I've got some text that scrolls up with testimonials on it, but it doesn't scroll smooth. I'm using just one large text file and tweening it upwards. I upped the frame rate hoping that it would make the tween smoother, but it doesn't. Are there any other ways to make the tween smoother?
Smooth Scrolling Help (actionscript Easing)
After following the great tutorial on creating a Photo Gallery and then also following up with the Adding Thumbnails one. I've created a neat little portfolio type movie. Now I know a couple of people have asked about getting it to work with the Infinite Menu and scotty seemed to clear that up.
What I'm trying to achieve is getting the left and right scoll to ease out once you've scrolled to the last thumbnail on either side.
Code:
// Thumbnail Scroller actions.
function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 5;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
I'm thinking I will need to add in some extra code into this block to get it working, but I'm stumped as to where?
Any help would be great...
Thanks in advance.
Creating A Smooth Scrolling MC Containing Btns
Hi all,
Creating my own navigation pane by using a movie clip that contains btns.
This navigation pane is quite long, many btns, so I have set it in a mask and now I am trying to make it scroll smoothly, vertically.
This is what I have managed to get working so far:-
up_btn.onRelease = function() {
navBar_mc._y -= 2;
};
(Obviously down is opposite to that)
However, what I want to achieve is something like:-
up_btn.onRollOver = function() {
navBar_mc.scroll -= 2;
};
Obviously the above code is incorrect but it gives you an idea what I am trying to achieve.
Once I have made it scroll up and down successfully, I assume that I would have to code in some boundaries for the mc boundary.
Any help would be much appreciated.
Cheers,
Dave
Scrolling Dynamic Text (Not Smooth Please Help)
Hi
Please see my page
http://www.creativeauto.co.uk/products/ ... s_one.html
Now the scrolling horizontal text in blue is dynamic text that gets loaded in via a .txt file so my client can easily change the messages displayed.
This is just a dynamic text field in a movie clip tweened across the stage.
No matter what the frame rate / amount of frames the animation takes it always looks jerky. Is there a better way / a way of improving the quality of this? Its really spoiling the look of the page.
I would appreciate any tips please note that my action script knowledge is fairly basic.
Thanks Ricky55
Please Help Masked Smooth Scrolling Problem (help Required)
HI Guys
I need some help with a text scroller that have downloaded and am having trouble configuring to use. ;-(
The scroller uses masking to that the scrolling is smooth, however I am having trouble positioning the text so that it scrolls correctly. I can NOT get the text to scroll from the top to the bottom
If someone could get this to work for me it would be very much appreciated, as I have no idea where I am going wrong.
I have attached the files so that you can all see my problem
Thanks in advance to anyone that can help
Cheers
|