I have and image that moves across the stage in a diagonal using the script below
As you can see each time it enters the frame it stats at a random place on the X access.
- Code: Select all
target_mc._x = Stage.width =random(750)-5;
target_mc._y = Stage.height =90;
target_mc.onEnterFrame = function()
{
target_mc._x -= random(1)+2; // decrease current x position by 1(Random) pixels
target_mc._y -= random(1)+2; // decrease current _y position by 1(Random) pixels
if (target_mc._y <= -200)
{
target_mc._x = Stage.width =random(750)-5;
target_mc._y = 90;
}
then inside a MovieClip I have embeded another MovieClip and called it "embed_mc" and added this code
- Code: Select all
var picture_array:Array = new Array ();
picture_array[0] = "pic1.png";
picture_array[1] = "pic2.png";
picture_array[2] = "pic3.png";
picture_array[3] = "pic4.png";
picture_array[4] = "pic5.png";
picture_array[5] = "pic6.png";
var iWhichPic:Number = Math.floor(Math.random()*6);
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.loadClip(picture_array[iWhichPic], "embed_mc");
So it all works.
Each time you test the movie a random image gets dragged into the movie clip.
But what I want it to do is drag a random image in each time the picture enters the frame.
Can any one help?
cheers
