View previous topic :: View next topic
Author
Message
angeleyes Joined: 10 Nov 2005 Posts: 13
Posted: 15.11.2005 14:01 Post subject: random()
kako napisati AS da jedan glavni swf random ucitava ostale swf-ove.
hvala
Back to top
astolitu Joined: 26 Jun 2004 Posts: 547 Location: Zagreb
Posted: 15.11.2005 15:02 Post subject:
napravi prazni MC i nazovi ga "kontejner", u layeru povise upisi ovo u AS:
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
kontejner.loadMovie("image0.swf");
break;
case 1 :
kontejner.loadMovie("image1.swf");
break;
case 2 :
kontejner.loadMovie("image2.swf");
break;
case 3 :
kontejner.loadMovie("image3.swf");
break;
case 4 :
kontejner.loadMovie("image4.swf");
break;
case 5 :
kontejner.loadMovie("image5.swf");
break;
}
to bi trebalo bit to
a moze i jednostavnije
kontejner.loadMovie("image"+Math.round(Math.random()*5)+".swf");
_________________http://www.markobjedov.com/
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
Powered by phpBB © 2001, 2005 phpBB Group