Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Actionscript 3.0 Access Parent Function

111 views
Skip to first unread message

Travis

unread,
Feb 14, 2008, 9:43:04 AM2/14/08
to
I have 2 swf files. Parent.swf and child.swf

Parent.swf has a function called MyFunction(Holder:String)

The Parent.swf loads child.swf Using:

var Mychild:Loader = new Loader();
Mychild.name = "MyShowSlide";
Mychild.load(new URLRequest("child.swf"));
addChild(Mychild);

In Child.swf I want to do this:
parent.MyFunction("Test");

But when I try to publish the child it tells me that there is no
function called MyFunction().

How do I access a function (or anything for that matter) in the
Parent?

Thanks

Travis

unread,
Feb 14, 2008, 7:45:23 PM2/14/08
to
On Feb 14, 9:43 am, Travis <TravisNewb...@hotmail.com> wrote:
Never mind...

The solution is to cast the parent at a movieclip

MovieClip(parent).function("bla");

0 new messages