Not yet rated
Tags:



Problem

The Sprite and Shape display object types are not available to define when creating new Library symbols in Flash Professional. Through modifying the base class, you can adjust the type of display object that you create in the Library.

Solution

Create a new Symbol of type MovieClip and set the base class as Sprite or Shape in Symbol Properties. New object can be created of the type Sprite/Shape and use it.

Detailed explanation

1. Create a new MovieClip symbol:

a) Menu > Insert > New Symbol...

b) Keyboard shortcut - Ctrl + F8

2. In Create New Symbol dialogbox enter:

Name: Name for the New symbol (This is the name shown in the library)

Type: MovieClip

Export for ActionScript : Checked   (This enables the Class and Base Class )

Class: MyNewSprite (Class name for new Sprite)

Base Class: flash.display.Sprite (This is where the symbol is made as Sprite or a Symbol)

Press OK. If you want to change the Class or the Base Class then right click on the Symbol in the library and change the values .

3. To use the created Sprite create an object fo the type MyNewSprite and add it to the displaylist:

var sp:MyNewSprite = new MyNewSprite (); 
this.addChild(sp);

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes