4 Replies Latest reply on Feb 26, 2013 6:47 AM by mandar vedak
      • 1. Re: on load movie clip place random change
        Ned Murphy Adobe Community Professional & MVP

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

        1 person found this helpful
        • 2. Re: on load movie clip place random change
          mandar vedak Level 1

          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);

          • 3. Re: on load movie clip place random change
            Ned Murphy Adobe Community Professional & MVP

            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.

            1 person found this helpful
            • 4. Re: on load movie clip place random change
              mandar vedak Level 1

              i find this code and i apply in my file but it's not working

               

              var myArray =

              [

                        {x:-288.75, y:-185.55},

                        {x:-288.75, y:-67.55},

                        {x:-288.75, y:49.5},

                        {x:-288.75, y:162.5},

                        {x:-174.75, y:-185.55},

                        {x:-174.75, y:-67.55},

                        {x:-174.75, y:49.5},

                        {x:-174.75, y:162.5},

                        {x:-60.15, y:-185.55},

                        {x:-60.15, y:-67.55},

                        {x:-60.15, y:49.5},

                        {x:-60.15, y:162.5},

                        {x:53.85, y:-185.55},

                        {x:53.85, y:-67.55},

                        {x:53.85, y:49.5},

                        {x:53.85, y:162.5},

                        {x:166.65, y:-185.55},

                        {x:166.65, y:-67.55},

                        {x:166.65, y:49.5},

                        {x:166.65, y:162.5},

                        {x:280.65, y:-185.55},

                        {x:280.65, y:-67.55},

                        {x:280.65, y:49.5},

                        {x:280.65, y:162.5}

               

                        ];

               

              myArray.sort(function () {

                        return Math.round(Math.random());

              });

               

              var arrayLength:Number = myArray.length;

               

              for (i = 0; i < arrayLength; i++) {

                    var mc:MovieClip = this["mcFindObject" + (i + 1)];

                        box._x = myArray[i].x;

                        box._y = myArray[i].y;

              }

               

               

              function setNewLocations() {

              myXArray.sort(shuffle);

              for (var j=1; j<=myXArray.length; j++){

              this["box"+((i-1)*6+j)].newXLoc=myXArray[i-1];

              this["box"+((i-1)*4+j)].newYLoc=myYArray[j-1];

              }

              }

               

              function shuffle(a,b):Number {

              return Math.floor(Math.random() * 30) + 1;

              }