ok, the example code.
we'll assume the following:
the 'collider' object is ID 2000
the 'moving' object is ID 2001
the room you'll be in is room 02_05 (Room 2 on the X axis and 5 on the Y axis)
the moving object will be moving from left to right, stopping at X co-ordinates 440.
First set a Dynamic Object in the map somewhere in room 02_05. set the Property ID to 2000, the DRAW property to 2 (mat) and the property COLLIDER to 1 (call handler). This is the collider. (i assume you want it hidden. set DRAW to 3 if you want it visible)
Set another Dynamic Object in the same room (around about X position 260), with Property ID set to 2001, property DELAY set to 4 and ensure property STATUS is set to 0 (it should be that as default). This will be the moving object.
that should pretty much do it.
ObjSet(idx,O_COLLIDER,0); // stops player colliding with the collider again
ObjSet(idx,O_STATUS,1); // changes the status of the object to be moved
if(!IsUpdate(ObjGet(idx,O_DELAY))) return; // sets a delay between frame updates using object property DELAY. The object will move way too fast without this line (try it!), and the speed can be changed by changing the value of object property DELAY in the map.
if(ObjGet(idx,O_STATUS)==1) // check the status of the item to be moved.
x = ObjGet(idx,O_X); // find X position of object to be moved and store in variable 'x'
x += 4; // add 4 to variable 'x'
if(x>=440) // check if variable 'x' is larger than we want it to go
x=440; // if it happens to be larger than 440, set it to 440
ObjSet(idx,O_STATUS,0); // changes status of object to be moved back to 0, as we don't want it moving any further.
ObjSet(idx,O_X,x); // change the X position of the moving object to whatever the value of variable 'x' is
ObjPresent(idx); // force the object to be present in the current room (a bit of 'failsafe' code)
you should be able to see from the UpdateRoom function that if the STATUS of the moving object is 1, then it will be moved right by 4 pixels every frame update. every time this happens, the code checks whether it is on or past 440 yet, and if it is, changes the STATUS to 0, so that the 'IF' statement checking the status becomes false and therefore stops moving the object.