To use an object in the script:
Convert to symbol > Name it > tick "Export for action script"
Double click on it in the library
add a new layer and call it script or something
Right click on the keyframe > select actions now you are controlling the functionality of the object. Additional scripts will be written in other objects and in the main timeline itself. Create a separate layer for the script. On the main timelines script LOCK IT. All the object uoi add should have their own layer and shouldn't interfere with the main script.