PDA

View Full Version : AS 3: can a child call a function in its parent



eforblue
March 7th, 2009, 08:05 PM
Hi:

I have a function (let's call it testFunction for right now ) on the actions layer in the main timeline
There is a movie clip with 15 frames long in the library

i want to add a child of the movie clip on the stage, and call testFunction when it finishes playing

how can i do?
i tried to call it in the child but nothing works

Or, is there any way to show child on the stage for only a period of time like 1 second and then remove it automaticly??

GrndMasterFlash
March 9th, 2009, 10:52 AM
you could talk to the "root" or parent directly



MovieClip(root).testFunction();

//or

parent.testFunction();