Dear all.....
im cracking my head all day long converting this as2 code to as3, but im not so good with coding and stuff.....if anyone out there that could help me with this would be a huge help for me...
var randRun = new kliment.utils.RandomRun(this, 100, true);
Thanks in advance.
That line appears to be calling in a custom-made class file named RandomRun that would be found in the utils folder of a folder named kliment. If you are converting AS2 to AS3, then that class file is also AS2 code. Calling that file in AS3 should be as simple as...
import kliment.utils.RandomRun;
var randRun:RandomRun = new RandomRun(this, 100, true);
Though it is not going to work for you until the class file is converted to AS3. Without knowing what the parameters are, it is possible the "100" might need to be a different value.
yes your right, this is the custom-made class which seems to be in AS2, and i totally no idea how to convert this....hmmm...could u please help me convert to AS3 ? please?
class kliment.utils.RandomRun
{
var _interval, _elements, _isRaned, _randomList, _interval_id;
function RandomRun(parent_mc, interval, autostart)
{
_interval = interval;
_elements = new Array();
_isRaned = new Array();
for (var _loc4 in parent_mc)
{
var _loc2 = parent_mc[_loc4];
if (_loc2 instanceof MovieClip)
{
_elements.push(_loc2);
_loc2.stop();
} // end if
} // end of for...in
_randomList = new kliment.utils.RandomList(0, _elements.length - 1);
if (autostart)
{
this.run();
} // end if
} // End of the function
function run()
{
this._next();
} // End of the function
function _next()
{
clearInterval(_interval_id);
var _loc2 = _elements[_randomList.__get__nextIndex()];
_loc2.play();
_isRaned.push(_loc2);
if (_randomList.__get__remain() > 0)
{
_interval_id = setInterval(this, "_next", _interval);
} // end if
} // End of the function
function play()
{
var _loc2 = _isRaned.length;
while (_loc2--)
{
_isRaned[_loc2].play();
} // end while
this._next();
} // End of the function
function stop()
{
clearInterval(_interval_id);
var _loc2 = _isRaned.length;
while (_loc2--)
{
_isRaned[_loc2].stop();
} // end while
} // End of the function
} // End of Class
North America
Europe, Middle East and Africa
Asia Pacific