h1

Calling parent-functions from a loaded SWF

October 1, 2010

If you’re loading an external SWF-file into your Main-SWF (or any other swf), the external SWF cannot call any self-made function you defined in your main by simple write: this.parent.functionName().
The compiler throws an error, saying that he can’t find a method with that name in flash.display:DisplayObjectContainer.

You can avoid this by typecasting the parent as an Object like this:

var fooObject:Object = this.parent as Object;

Now you can call methods from the parent-class: fooObject.functionName();

h1

How to connect a MovieClip to an external ActionScript class file

September 16, 2009

A great advantage of AS3 is the possibility to use external ActionScript Files for your projects. So there is no need to use confusing timeline code anymore. Except for very small projects for demonstration purpose or something like that.

This tutorial is going to show how you can connect a MovieClip with external ActionScript 3 Code.

Read the rest of this entry »

Follow

Get every new post delivered to your Inbox.