FlashMx help

how do i know what the width of the movie is?
which object do i use?
and…
could you define the Stage,_root,_level[x] objects?

UNDER WHAT OBJECT IS THE VARIABLE THAT DEFINES THE WIDTH OF A FLASH MOVIE LOCATED?

I meant the mainmovie,i dont know what its called.
I want to move an object x pixels to the right until it reaches the end. when it reaches the end i want it to stop. how would i do this?

hi man wellcome in Kirupa :slight_smile:
first you have to give name for your movie in the properties panel give it instance name like ( yourmovie_mc) … ok
at frame 1 put this CODE :


// define your movie speed 5 pixels
speed = 5;
// move the movie untill reach the specific _x
_root.yourmovie_mc._x += speed;
// if it reached stop the movie
if (_root.yourmovie_mc._x>=500 ) {
	this.stop();
}

in frame 2


gotoAndPlay(1);

i hope it helps

FlashSwimmer C:-)

not sure what width you’re talking about the main movie size is in the properties box, a movie clip you can find the size by looking at the info box.

stage is your top level that everything else goes inside of the action script dictionary says "The Stage object is a top-level object that you can access without using a constructor.

Use the methods and properties of this object to access and manipulate information about the boundaries of a Flash movie. "

_root is used to refer to the main timeline or the top level for example if i created a new movie and put a movie clip on it called Movie1 the path to it would be _root.Movie1 because it is setting on the root timeline.

_level[x] is a layering tool for use in actionscripting, similar to moving something to the back or front you can change the level of something and it will change the depth order of how it is displayed.

This code should move your object, you could also do a motion tween to move your object.


object.onEnterFrame = function() {
	if (this._x == EndLocation){
		delete this.onEnterFrame;
	}else{
		this._x += NumberOfPixelsToMove;
	}
}

Hope i got all your questions.

alright thanks everyone, i think i got it.