Can i have explanaition about something?

i did a game, and there was to kindes of attached movie clips and i write this code at one cherecter:

 
_root.onEnterframe=function()
i++
if(Key.isDown(key.control)
_root.attachmovieclip("disk","d"+i,i)
_root.main1.gotoAndPlay(97)

and in the 2nd one i wrote this:

 
_root.main2.onEnterframe=function()
t++
if(Key.isDown("90")
_root.attachmovieclip("disks","s"+t,t)
_root.main2.gotoAndPlay(97)

when i did this and press Ctrl and “z” at the same time the 2nd movie clip wasnt attached and it was only playing frame 97
but when i put the code of the attachment in frame 97 it worked, why is thet?

someone?

I think you need brackets around the function code… else it doesn’t know what you want to be part of the function.

i wrote it without flash and i forgot it but its not the problem…

please any one?

because then it only reads that is has to go to frame 97 so that works … nokrev is right

but y is it thet it reads only go to frame 97?

dude have you got a problem with reading? Nokrev says you didnt put BRACKETS so thats is why!!


_root.onEnterframe=function() {
i++
if(Key.isDown(key.control)
_root.attachmovieclip("disk","d"+i,i)
_root.main1.gotoAndPlay(97)
}

you see the brackets??

its not the brickets man… here is the priceaise code(its the one who didnt worked…):

_root.main2.onEnterFrame = function() {
    t++;
    if (Key.isDown("90") and _root.am2.at2.w5._visible==1 and _root.ep2._width>=20 and sdt==1) {
        sdt=0;
        _root.main2.gokus.gotoAndPlay(97);
    }
    _root.attachMovie("disks","s"+t,t);
    _root["s"+t]._x=_root.main2._x;
    _root["s"+t]._y=_root.main2._y-10;
    if (_root.main2._xscale==100) {
        _root["s"+t].onEnterFrame = function() {
            this._x-=20;
        };
    }
    if (_root.main2._xscale==-100) {
        _root["s"+t].onEnterFrame = function() {
            this._x+=20;
        };
    }
};

please just explain me why the currect code didnt worked and i’ll leave you alone!:frowning: