Explanation to this line

hi ppl can explain to me how this line works and wat it does??

if (_root.started && _root._currentframe==1) {
with (_root.square)

Hi Xavier,

It seems started is varible declared on the stage ie your root getting a Boolean value. This what i suppose.

_root.currentFrame returns the number of the frame in which the playhead is located in the Timeline.

so if these both conditions are satsfied…ie your started var sets to TRUE and currframe is 1 then…it executes next stmt.

with(_root.square)

here…square must be the name of MC.

Ashish

thx… erm wat does the with command do?

Hi

This is what i have copied from Flash Help :
Write with in the actionscript area and just select it and do right click u will find View Help there u will get this example…

Hey for such questions u should first look in to the Help and refere Actionscript Dictionary. And still if u have any doubts then get in to the forum with your questions. Ok

The following example sets the _x and _y properties of the someOther_mc instance, and then instructs someOther_mc to go to Frame 3 and stop.

with (someOther_mc) {
_x = 50;
_y = 100;
gotoAndStop(3);
}

The following code snippet shows how to write the preceding code without using a with statement.

someOther_mc._x = 50;
someOther_mc._y = 100;
someOther_mc.gotoAndStop(3);

Ashish

thx alot bro