Skip to main content
July 5, 2006
Question

Controlling properties of clips across movies

  • July 5, 2006
  • 3 replies
  • 484 views
How can I control the property of a movie clip in the parent movie, from the child movie? I've got a parent movie that loads separate movies into it. I want to move a clip in the parent when the child movie loads. I've tried all of the following in an actions layer in the child timeline with no success:

setProperty("_parent.btn_selected", _x, "325.2");
setProperty("_parent._parent.btn_selected", _x, "325.2");
setProperty("_root.btn_selected", _x, "325.2");

thanks very much.
This topic has been closed for replies.

3 replies

Participant
July 5, 2006
Did you name the button in the property window?

the suggestion

_parent.selected_btn._x = 325.2;

should work every time but you will need to name the button and then use that name where selected_btn is in the line above...capitalization is important the name must be exact
July 5, 2006
Thanks. Yes, I did name the instance. The clip I want to control is in a nested MC within the main swf timeline. Do you think I need to specify the path more completely, or should _parent.mcclipname work? Do I need some sort of handler/event maybe too?
July 5, 2006
Hello Alyyoop,

Do you mean that "btn_selected" is located inside another movie clip on the main time line? If that is true then you will need to refer to that movie clip's name in the road map you give Flash to find "btn_selected".

For example, if "btn_selected" is located in "myNested_mc" and "myNested_mc" is located on the main timeline. You would have to refer to "btn_selected" within the newly loaded swf as:

_parent.myNested_mc.btn_selected._x = 325.2;
July 5, 2006
Thanks for the suggestion - I tried that and it didn't seem to work either.
July 5, 2006
Do you have the child movie's behavior set to "Movie Clip" or "Button"?
July 5, 2006
I'm sorry that I don't understand your question. I'm trying to add the code to a swf movie timeline (child) that's being loaded into the parent swf movie. The target object in the parent movie has a movie clip behavior. Hope that clarifies.
July 5, 2006
Hello Alyyoop,

Have you tried:

_parent.btn_selected._x = 325.2;