Hi. I have a child movieclip within a movieclip on the stage, eg; flowerpot.flower1, that I want to dynaimcally unload, and randomly attach one of a couple of other clips from the library, eg: *flower2 or flower3. *
I read in help that* _parent.MovieClip *will retrieve a reference to parent clip. Is there a property or function/method that will retrieve a reference to a child clip, from which i can access the name? Not sure where to look.
[COLOR=#0066cc]Thanx.[/COLOR]
[quote=websmythe;2352920]Hi. I have a child movieclip within a movieclip on the stage, eg; flowerpot.flower1, that I want to dynaimcally unload, and randomly attach one of a couple of other clips from the library, eg: *flower2 or flower3. *
I read in help that* _parent.MovieClip *will retrieve a reference to parent clip. Is there a property or function/method that will retrieve a reference to a child clip, from which i can access the name? Not sure where to look.
[COLOR=#0066cc]Thanx.[/COLOR][/quote]
movieclip._name :x
Duh! Guess i could take off my shades now.
Looked for it, and didn’t see it in the help.
Thanx.
K… so, have I missed something with SetProperty(), I copied it outta help. And… didn’t read anywhere that ._name was read-only ??
-Dazed & Confused …LOL
[Output]
myParent.target_mc._name = target_mc
myParent.target_mc._name = undefined
myParent.target_mc._name = undefined
[/Output]
// Display and change target_mc._name inside of myParent_mc
// Instance name of parent movieclip = myParent_mc
// Instance name for child movieclip = target_mc
// target_mc is behind a mask. Not that it should matter...
trace("myParent.target_mc._name = " + myParent_mc.target_mc._name );
setProperty( myParent_mc.target_mc, _name, "Flower1" );
trace( "myParent.target_mc._name = " + myParent_mc.target_mc._name );
setProperty( myParent_mc.target_mc, _name, "Flower2" );
trace( "myParent.target_mc._name = " + myParent_mc.target_mc._name );
myParent.target_mc._name = “newName” should work
Na. No such luck. Go figure.
I included the fla this time just in case I’d not placed things right.
-Mystified
[Output]
myParent_mc.target_mc._name = target_mc
myParent_mc.target_mc._name = undefined
[/Output]
trace("myParent_mc.target_mc._name = " + myParent_mc.target_mc._name );
myParent_mc.target_mc._name = "Flower1";
trace("myParent_mc.target_mc._name = " + myParent_mc.target_mc._name );
trace("myParent_mc.target_mc._name = " + myParent_mc.target_mc._name );
//setProperty(myParent_mc.target_mc, _name, "Flower1");
myParent_mc.target_mc._name = "Flower1"
trace("myParent_mc.target_mc._name = " + myParent_mc.Flower1._name );
Once you rename it, you have to call the new path, with the changed name
I’m gonna definately have to wake up.
Thanx.