all groups > macromedia flash sitedesign > october 2003 >
You're in the

macromedia flash sitedesign

group:

another question - sorry


Re: another question - sorry itsrainin
10/31/2003 8:31:24 PM
macromedia flash sitedesign:
i used this once but it got annoying so i took it off but i think i know
what your trying to do, i had a list of names of people in an organization
and when you click say the 5th name in the list the frame on the right would
quickly flash through the images of people starting from number one and it
would stop on the name you chose. so if you chose number 3 in the list and
you were currently viewing number 5 it would flip through all of em and
start over until it hit 3. what i did whas set up each image on a frame,
say frames 5-15, or you could animate a section of images to just scroll
past and stopping at the appropriate points on each frame. anyway on my
buttons or links the actionscript simply set a variable we will call it
"choice" the also the actionscript "play" so say you clicked the 3rd button
it would set the choice variable to be 3 and start playing (playing would
advance from frame 5 and begin flipping through the images, or scrolling,
whichever way you set it up) each stopping point had an action script that
would check what "choice" was so say on the 3rd person's image it checked
for if choice = 3, if it did equal 3 it would stop, if it didnt it would
keep rollin on, on the last from the actionscript told it to go back to
frame 5 and keep playing, so eventually it will hit the button chosen and
stop. this may be confusing but its not as hard as it sounds. email me, ill
whip up and example

itsrainin





[quoted text, click to view]
wanted to do but didnt no how. How do u make it so, when a button it click,
a pucture scrools through all the picturs available for each button until it
comes up to the pic which is assigned to the button its pressed (Example, if
there are for buttons, and you are on the 1st one, if you click the 4th one,
you can see the images scroling and then coming to a stop at the 4th image)
[quoted text, click to view]

another question - sorry GilesW
10/31/2003 11:34:50 PM
OK, wel i posted this in the actionscript forum,but nobody answered and now its in the archives.
Neway, heres what i want to know how to do. I saw in a site somthing ive wanted to do but didnt no how. How do u make it so, when a button it click, a pucture scrools through all the picturs available for each button until it comes up to the pic which is assigned to the button its pressed (Example, if there are for buttons, and you are on the 1st one, if you click the 4th one, you can see the images scroling and then coming to a stop at the 4th image)
do you get what i mean?
heres and emample on a site: http://www.ciberimagen.com/total.htm

thanks alot



Referring URLs
http://www.ciberimagen.com/total.htm



Re: another question - sorry fasterthanlight
11/1/2003 4:47:58 AM
Re: another question - sorry GilesW
11/2/2003 11:35:21 AM
Thank you very much, I ve managed to do that, but I cannot find a tutorial on how to make the pictur speed up at the bigining then slow down


Re: another question - sorry stwingy
11/2/2003 12:55:27 PM
If you have followed the example as given above, you`ll have to change the tweens.

This sort of menu is really easy to script though. All you have to do is line all your pictures up horizontally and convert to a mc, apply masking where you want it to appear and use the code i gave you before for the rollover button effect.

Certified but not by Macromedia!
Re: another question - sorry GilesW
11/2/2003 10:01:32 PM
omg thank u so much for that code :)

Re: another question - sorry GilesW
11/3/2003 5:20:41 AM
i cant do it,

I lined up 3 pictures the same size (just to see if it works) and then attached 3 buttons. I did it the exactly the same way as you had with the buttons, only this time with the images on top of the buttons. When i previewd the movie it did what i expected, it just made the midle pictue scrol to the center of the appropriate button, so it doesnt completely scroll, so to do this i would have to have each button in the middle of each picture, which woulnd work because the pictures are too big.
The fla is below if you dont get what i mean

http://webforums.macromedia.com/attachments/scroller problem.zip


Re: another question - sorry stwingy
11/3/2003 7:05:31 AM
change reg point of ball_mc to upper left corner and type

var acceleration = 10;
var friction = 0.5;
ball_mc.move = function(targety) {
var ydif = targetY-this._x;
this.yspeed += ydif/this._parent.acceleration;
this.yspeed *= this._parent.friction;
this._x += this.yspeed;
};
/*for(i=0;i<5;i++){
_root["button"+i].onRollOver= function() {

ball_mc.targetY = this._x
ball_mc.onEnterFrame = ball_mc.move;
}
};
*/
button2.onPress = function() {
ball_mc.onEnterFrame = function() {
ball_mc.move(7);
};
};
button3.onPress = function() {
ball_mc.onEnterFrame = function() {
ball_mc.move(-511);
};
};
button4.onPress = function() {
ball_mc.onEnterFrame = function() {
ball_mc.move(-1027);
};
};

I`ve just done this quickly before going to work so it needs finishing. Maybe use setInterval instead of enter frame and some condition inside the move function like
if(ydiff<value){
this._x = targety
clearInterval(myInterval)
}
don`t need the checkdistance function then.

Certified but not by Macromedia!
Re: another question - sorry stwingy
11/3/2003 1:02:47 PM
This is a little better
var acceleration = 10;
var friction = 0.5;
ball_mc.move = function(targety) {
this.targety = targety;
var ydif = targetY-this._x;
this.yspeed += ydif/this._parent.acceleration;
this.yspeed *= this._parent.friction;
this._x += this.yspeed;
this.checkDistance();
};
ball_mc.checkDistance = function() {
if (Math.abs(this.targetY-this._x)<1) {
if (Math.abs(this.yspeed)<4) {
this._x = this.targetY;
delete this.onEnterFrame;
trace(this._x);
}
}
};
button2.onPress = function() {
ball_mc.onEnterFrame = function() {
ball_mc.move(7);
};
};
button3.onPress = function() {
ball_mc.onEnterFrame = function() {
ball_mc.move(-511);
};
};
button4.onPress = function() {
ball_mc.onEnterFrame = function() {
ball_mc.move(-1027);
};
};

So this is basically the same function as you used before for the roll over effect and can be used for all sorts of menu/scroller effects. Our variable names are not so good though, targetX might have been better. If you have a look at this menuhttp://www.gifsrus.com/testfile/yapper.swf, this was made using the same functions but just having a targetx and a targety and only took a couple of minutes to make as i already had the code

Certified but not by Macromedia!
Re: another question - sorry GilesW
11/4/2003 4:46:52 AM
ok, thanks alot for the script, but im still having abit of trouble. Ive attached the file with the new script and al the pics im useing in it, and you should see whats wrong. What i want is the pic with the ship going into the stop to appear first, and also be the pic for the home button, and the pic with just an ordinary ship for services, and the pic with the horses as about us, and the pic with the ship wreck contact, but it doesnt exactly work, and when i pres the button, it doesnt scroll the picture the whole way (they are al the same size)


Re: another question - sorry GilesW
11/4/2003 5:05:49 AM
Re: another question - sorry GilesW
11/4/2003 7:24:05 AM
dw about it, ive decided not to use it for this page nemore, however im useing it for somthing else which it works perfectly on, thanks again stwingy


AddThis Social Bookmark Button