Skip to main content
February 8, 2010
Question

Symbol Properties > Class: field

  • February 8, 2010
  • 1 reply
  • 282 views

Hi,

What exactly is the function of the Class field in the Symbol Properties window?

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
February 8, 2010

I believe there are a couple of aspects to that, and for what I offer, anyone who knows better should chime in.

If you have an object in the library that you want to load dynamically, such as a MovieClip, you prepare it for that by selecting the option to Export for Actionscript, which lights up the ability to define a Class name for the object.  When you compile the file a class definition for that object is automatically generated if there is not already a class by that name in a separate .as file.

So you can create a movieclip and have it be its own class.  Or you can create some entity and assign it a Class ID that already exists as a separate .as file.

And in your AS code, to create a new instance of that class, you do it just like any other AS3 class...

var newInstance:ClassNameAssigned = new ClassNameAssigned();