
Welcome Guest
|
#1
|
|||
|
|||
|
i didn't know how to use arrays before and now i found out their quite powerful i tried to make something with them here is a script that makes random squares with array and is a 1 line code just paste it and it will work but your flash movie should be atleast 300x300 for it to fit try it and tell me what ya think
![]() if you don't know how to use arrays learn it! it's helpful and if you know how to use arrays please tell me what other ways i can use arrays since i can't wrap my mind around this array() thing yet i just started like 1 hour ago and made this from flash 5 bible reference of course Actionscript:
//F5 Interactive testing arrays();
_root.createEmptyMovieClip("ssq",0);
ssq.lineStyle(0,0x000000,100);
ssq.beginFill(0x4a5256, 100);
ssq.lineTo(0,20);
ssq.lineTo(20,20);
ssq.lineTo(20,0);
ssq.lineTo(0,0);
ssq._x = -100;
ssq._y = 0;
ssq._visible = 0;
_root.createTextField("texts",500,0,0,300,20);
_root.texts.text = ("Click Screen to generate random squares! with ARRAY()");
onMouseDown = function()
{
gen();
}
// <------- 16 array ----------->
a = new Array(0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
function gen()
{
_root.xxy = -20;
_root.yyx = 0;
for (e=0;e<400;e++)
{
if (a[e]== 1)
{
duplicateMovieClip("ssq","ssq"+e,e);
_root["ssq"+e]._x = _root.xxy;
_root["ssq"+e]._y = _root.yyx;
_root["ssq"+e]._alpha = Math.round(Math.random()*100);
_root.xxy += 20;
}
else if (a[e]==2)
{
_root.xxy = 0;
_root.yyx += 20;
duplicateMovieClip("ssq","ssq"+e,e);
_root["ssq"+e]._x = _root.xxy;
_root["ssq"+e]._y = _root.yyx;
_root["ssq"+e]._alpha = Math.round(Math.random()*100);
}
else
{
_root.xxy += 20;
}
}
}
__________________
F5interactive, Teamcaster,Lancaster |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Beginner to cs3 - check script why I am getting error | libman | Flash CS3 / Flash 9 |
8 | 08-05-2007 01:52 PM |
| PHP script check please | Ben-41 | Newbies |
12 | 11-23-2006 07:21 PM |
| Help with a Tough Array Randomization/Shuffle Problem | TheMediaBoy | Actionscript 2.0 |
10 | 07-21-2006 09:05 AM |
| Mail to script give rundll error when testing | jtaylr77 | Flash MX 2004 |
2 | 12-18-2005 11:22 AM |
| Map array, collision script | equinox | Flash Games |
1 | 01-17-2003 05:23 PM |






