PDA

View Full Version : random movement


karlzoe2
12-03-2002, 09:10 PM
ok this is the jive. i am creating a movie which has four pics arrange in a column to the right. i also have four buttons to the left. this is what i want to do but i dont want to go through the long process of doing it manually, so i am asking for help with the action script.


THE TASK IS THAT WHEN I CLICK ON ANY BUTTON I WANT THE POSITION OF THE PICS TO CHANGE RAMDOMLY (i guess it can be done)

please make this sad newbie happy!!! :D

farafiro
12-04-2002, 07:39 AM
something like this
http://www.kirupa.com/developer/mx/random_motionMX.asp

sfa
12-04-2002, 07:42 AM
Have a look at this, I used a shuffling function I had created for a card game and adapted it.

SFA

karlzoe2
12-04-2002, 10:17 AM
bang on.....thanks so muchhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

karlzoe2
12-04-2002, 10:19 AM
not waht i had in mind but it is interesting nuff thanks (* infinity) 2 u.

be sure i will save it 4 the future

farafiro
12-04-2002, 10:30 AM
heheheeeee, but if u r on MX, there is an easier way with setInterval, interested ;)
tell me :D

karlzoe2
12-04-2002, 10:39 AM
ears are large and pricked up.....by the way the referred site is now in my favorites.

is it yours

farafiro
12-04-2002, 10:48 AM
Kirupa is always on my fav list
//randome with Interval
//movie clip's name = MC
//on the first framefunction move(){
tick = random (550) //or Stage.width
}
setInterval(move,1000)
mc.onEnterFrame = function(){
this._x += (_root.tick-this._x)/5
this._y += (_root.tick-this._y)/5
}

karlzoe2
12-04-2002, 11:10 AM
as always :D

farafiro
12-04-2002, 11:22 AM
;) :D :o

karlzoe2
12-06-2002, 07:25 PM
ok the pics are moving just as i envisioned...but i have a problem. i want the same buttons to go to a play another part of my movies...some insights would be fine

karlzoe2
12-07-2002, 12:01 PM
n e ideas.....:-(

farafiro
12-09-2002, 06:22 AM
yo talkin to me

karlzoe
12-09-2002, 11:06 AM
of course it is u and eveybody else...so n e ideas