PDA

View Full Version : Scrolling Background help???


whispers
10-28-2001, 04:16 AM
Heres where I am..
Have movie (main),..have a background that I want to scroll...(I have the background inside of a movie clip..but I can just have the plain graphic there NOT inside of a CLIP if need be...I just did that from looking at a .fla) I have all my buttons nested inside of a movie clip which I dragged to the main timeline.
What exactly need to have instance names given? Anything??

How do I get the buttons to control something not in the main movie timeline? (TELLTARGET??..never used it before..)

I dont want the buttons to have the playhead jump to a certain frame number or anything...I just want the buttons have the background image (or background MC....whichever you think I need) "SLIDE" to a certain corresponding "X"location. Please help...I have been at this same problem for weeks...no help from anyone.
Thanks -whispers-
:mad: :mad: :mad: :mad: :mad: :mad:

Billy T
10-28-2001, 05:59 AM
ok heres what you do

first, give the background an instance name of "sections".

next, create a new movie clip - call it "scroller code". In the first frame of this use this script

play ();
current_x = getProperty("_root.sections", _x);
dif_x = current_x-/:xpos;
setProperty ("_root.sections", _x, current_x-(dif_x/5));

then in the second frame put the action -

prevFrame ();


drag this movie clip from your library to somewhere off the stage in your main timeline.

Then give your buttons an action like this -

on (rollOver) {
/:xpos = "95.0";
}


This should work

Let me know how you go

cheers

whispers
10-28-2001, 06:47 AM
Thank You..I will try it out rightnow...let ya know how it works out!! Thanks. Seems easy enough! -whispers-

whispers
10-28-2001, 07:06 AM
Nope...didnt work!! SORRY..I dont kow what I did wrong....followed exactly what you said to do...Do I need to put the image (sections) in the MC??? No scroll thats for sure..LOL..:(
Maybe I can send you my .fla?? -whispers-

whispers
10-28-2001, 07:27 AM
YEAH!...after some messing around...at least I got it to work a little...THANKS TO YOU!! Couple of things though.....

1. I want the position I have it in on the stage to be the main/start position.....when I do that and test the movie..it is off centered by half the "HOME Page" graphic. Anyway to fix that??

2.When I change the xpos for the buttons...it doesnt make a difference what number I put there...it will only slide from the left and only to about half way to the next "graphic

Got any tips on these?..and how to fine tune? Thanks

-whispers-

whispers
10-28-2001, 07:59 AM
Ok..got it working for the most part. Man,....you rock! I have been trying to figure this out for over a week now....THANK YOU SO MUCH!

I gotta book mark this thread until I memorize it.
Just gonna add some tips so I can re-read them when I come back. Thanks again -whispers-

ok heres what you do

first, give the background an instance name of "sections".

next, create a new movie clip - call it "scroller code". In the first frame of this use this script MC instance name has to match the name in the ("_root." ",_x")

play ();
current_x = getProperty("_root.sections", _x); sections...instance name of MC not image

dif_x = current_x-/:xpos;

setProperty ("_root.sections", _x, current_x-(dif_x/5));

then in the second frame put the action -

prevFrame ();


drag this movie clip from your library to somewhere off the stage in your main timeline.

Then give your buttons an action like this -

on (rollOver) {
/:xpos = "95.0"; edit to position needed
}
(end edit)..I think

Billy T
10-28-2001, 11:01 AM
heheh cool it sounds like you have it all working now :)

couple of things to note -

(dif_x/5) - this is where you set the speed of the scroll - try changing the 5 to something else and see the effect

also, click on your "sections" clip on the stage and have a look at the info panel. Make sure it is giving you the info of the center of the clip - not the top left corner or anything. Then you can just move the clip to a position you want, make a note of the x value and assign this to a button.

An initial position can be set by giving a movie clip an action like the buttons have but make it activate on movie load.

The code can easily be added to so you can set y values or alpha or whatever

Let me know if you have any probs

cheers:)

whispers
10-29-2001, 07:40 PM
The only problem I am having now is.....defineing the "X" position when the movie starts.....the initial location on the MC/image that is to correspond to the onrollover command on the buttons!

ANYBODY?....have an idea I can try? -whispers-

Billy T
10-29-2001, 08:52 PM
try putting an empty, off the stage movie clip in your scene that has an action such as

onClipEvent (load) {
/:xpos = "20";
}


If this figure is the same as the initial placement of the scroller on your stage then it shouldnt move until something else occurs. If it is different, then the scroller will move to "20" from wherever it was placed, as soon as the page loads


hope this helps

Sephiroth
03-07-2002, 06:48 AM
ok..billy..mabye u can help me with this too..

i got all the scrolling..eetc to work... so far i have no solutions yet..

i want o iniatiate an action onces the slider has reach its X position..

like this:

if i press a button.. slides to positon 100.. then load MC clip number 1, press button 2..bg slides to positioin 300..then load MC 2..etc..


lately i have found no solution..


all i have been getting is this... :

my button is click..the slide works..but simultaneously the MC is loaded even when the MC bg didnt reach its X positon yet...


how do i make it so it reaches the X pos first..

Billy T
03-07-2002, 10:46 AM
need to post the code you are using

cheers