//Sample Opartica Code //static array to set up buttons buttons = new array(); buttons["rotation-1"] = new array(30, 42, 390); buttons["rotation-2"] = new array(31, 67, 390); buttons["rotation-3"] = new array(32, 92, 390); buttons["rotation-4"] = new array(33, 112, 384); buttons["rotation-5"] = new array(34, 112, 397); buttons["motion-1"] = new array(35, 59, 423); buttons["motion-2"] = new array(36, 84, 423); buttons["motion-3"] = new array(37, 109, 423); buttons["motion-4"] = new array(39, 128, 417); buttons["motion-5"] = new array(38, 128, 430); //dynamic array to keep track of user projects opartica = new array() for (i=0; i<=9; i++) { opartica.push(new array(0, 0)); } opartica[5][0] = 3 opartica[5][1] = 2 opartica[5][2] = new array(4,1,2,2) opartica[5][3] = new array(5,3,2,2) opartica[6][0] = 3 opartica[6][1] = 2 opartica[6][2] = new array(4,1,2,2) opartica[6][3] = new array(5,3,2,2) opartica[6][4] = new array(4,2,2,0) //project and layer are global variables set when pressing buttons. function motion (m) { shape = opartica[_root.project][_root.layer][0] if (checkmotion(opartica[_root.project][_root.layer][0]) == 0) {return;} if (m < 4) { old = opartica[_root.project][_root.layer][2] opartica[_root.project][_root.layer][2] = m; r = opartica[_root.project][_root.layer][1]; s = opartica[_root.project][_root.layer][3]; if (m != 2 && s == 0) { opartica[_root.project][_root.layer][3] = 2; speedchange = 1 } if (r == 2 && m == 2 && s != 0) { opartica[_root.project][_root.layer][3] = 0; } if (m == 2 || old == 2) { speedchange = 1 } updatemotion(); } else { if (opartica[_root.project][_root.layer][2] == 2) {return;} opartica[_root.project][_root.layer][3] = m - 3 speedchange = 1 updatespeed() } synchronize(); } function updatemotion () { for (i=1; i<=3; i++) { if (opartica[_root.project][_root.layer][2] == i) { setbutton("motion",i,1,"m") } else { setbutton("motion",i,0,"m") } } updatespeed () } function updaterotation () { for (i=1; i<=3; i++) { if (opartica[project][layer][1] == i) { setbutton("rotation",i,1,"m") } else { setbutton("rotation",i,0,"m") } } updatespeed () } function setbutton (b,n,t,s) { //setbutton("motion",5,1,"s") //trace (b + d +"-"+ n) //b=button type (rotation, motion, project, edit, color, etc) //n=number (sequence number - sometimes starts with 1 sometimes 0) //t=toggle (1=on 0=off) //s=size (s,m,l,es=editshape,eb=editbutton,eh=edithighlight) if (t == 1) { d = buttons[b+"-"+n][0] //depth x = buttons[b+"-"+n][1] y = buttons[b+"-"+n][2] if (s == "es" || s == "eb") { if (s == "es") { duplicateMovieClip ("_root.button"+s+shape, b+"-"+n+"-"+s, d); } else { duplicateMovieClip ("_root.button"+s+n, b+"-"+n+"-"+s, d); setProperty ("_root."+b+"-"+n+"-"+s+".tip", _visible, "0"); } } else { if (b == "rotation" || b == "motion" || b == "command") { duplicateMovieClip ("_root.button"+b+n, b+"-"+n+"-"+s, d); } else { duplicateMovieClip ("_root.button"+s, b+"-"+n+"-"+s, d); setProperty ("_root."+b+"-"+n+"-"+s+".tip", _visible, "0"); } } setProperty ("_root."+b+"-"+n+"-"+s, _x, x); setProperty ("_root."+b+"-"+n+"-"+s, _y, y); if (s == "eb" || s == "eh") { setProperty ("_root."+b+"-"+n+"-"+s, _xscale, 80); setProperty ("_root."+b+"-"+n+"-"+s, _yscale, 82); } if (s == "s") { setProperty ("_root."+b+"-"+n+"-"+s, _xscale, 90); setProperty ("_root."+b+"-"+n+"-"+s, _yscale, 90); } if (s == "m") { setProperty ("_root."+b+"-"+n+"-"+s, _xscale, 90); setProperty ("_root."+b+"-"+n+"-"+s, _yscale, 92); } } else { removeMovieClip ("_root."+b+"-"+n+"-"+s); } }