I am assuming that you have already figured out how to pass data to JavaScript and you only need to figure that data out in the Flash movie. The movie duration is stored in the getTime () object:
mytime = getTime ();
Note that the time is in milliseconds, so divide it by 1000 to get seconds:
mytime = getTime ()/1000;
You can get the width and height of the movie like this:
mywidth = Stage.width;
myheight = Stage.height;
Strangely Flash is missing 4 pixels on the width and height, so you have to add tehm up:
mywidth = Stage.width + 4;
myheight = Stage.height + 4;
And finally, to stop the movie at the end, make a keyframe on the last frame (F6) and place a stop () action there.
I hope that helps :)