PDA

View Full Version : parent.parent.parent.parent?????


billy nugz
06-22-2008, 02:06 AM
Is there a easier way to get back to the main time line for a nested clip?

I have to call to a flex api fuction form a loaded swf thats in a scroll bar (I know.. but thats the way it is) I have to always do a name trace to see where I am and then once I get to the root it wont cal the function? Is there a easy way to do this?

Here is what im doing wrong

clip1.addEventListener(MouseEvent.MOUSE_UP,clip1Cl ick);

function clip1Click(event:MouseEvent):void {

//trace("click");
trace(event.target.parent.parent.parent.parent.par ent.parent.parent.parent.parent.parent.parent.name );
trace(event.target.parent.parent.tip1.text);
trace(event.target.parent.parent.title.text);
event.target.parent.parent.parent.parent.parent.pa rent.parent.parent.parent.parent.parent.AddClippin g("event.target.parent.parent.title.text",event.target.parent.parent.tip1.text,"");

}

those children arnt lonely with all those parents and flash seems to be giveing instance names on the fly to some clips like instance_284 and stuff. WTF ?

Any help would be cool :confused:

Flash Gordon
06-22-2008, 02:28 AM
how about using "root" or "stage"?

billy nugz
06-23-2008, 03:07 PM
Well when using root I ran into some issues. Im adding childern to a swf thats being added to a container which is in a flex holder. Not the most ideal way to set things up but thats what im dealing with. As far as stage gos i haven't tried it. will stage reference the loaded swf's stage or the actual flex container stage??? I will research the docs but they are confusing at the best of times.