Skip to main content
Known Participant
February 22, 2013
Question

on load movie clip place random change

  • February 22, 2013
  • 1 reply
  • 937 views

i want to change movieclip postion completly random what code i use

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
February 22, 2013

It depends on what code you are using to place things to begin with.  SHow that code.

Known Participant
February 22, 2013

placing all this clips into 1 movieclip and in 1 frame this script is use

and in that clip 5 different position clips arranged,

but every time swf loaded those clips are randomly place taht i want

stop();

function randomFrameAndStop(target_mc:MovieClip) {

    var rFrame:Number = Math.floor(Math.random()*5)+1;

    trace(rFrame);

    target_mc.gotoAndStop(rFrame);

}

randomFrameAndStop(this);

Ned Murphy
Legend
February 22, 2013

I do not see how that code has anything to do with placing the various images anywhere.  It only appears to be randomly picking a frame to go to.

If you do not have any code to place the images at this time, I suggest you devcelop code for that first, then see about asking for help making it place them randomly if you still cannot see how to do it.