0

I'm working with edge to make an animation in JS/jQ. All I'm trying to do right now, is initiate a symbol on the stage, and then delete it halfway through the timeline.

So, to begin with, I have a variable called food, that does a sym.createChildSymbol on a symbol called Food_Spanner:

var food = sym.createChildSymbol("Food_Spanner", "Stage");

and then further down on my timeline, I have:

sym.getSymbol(food).deleteSymbol();

When I run it, it isn't deleting it at all, I get an error in my Developer Tools (Google Chrome) "Javascript error in event handler! Event Type = timeline". The animation plays, and my food is initiated, just not removed.

4

2 回答 2

1

Maybe it's late to answer now.. To delete the symbol you have 2 options.

Option 1:

food.deleteSymbol();

Option 2 (better one):

sym.getSymbol("Food_Spanner").deleteSymbol();

In the option 1 you are using the variable food which is the symbol you just created. In the option 2 you are finding the symbol using the function getSymbol on the stage, passing it a string which is the name of the symbol you want to find. Note that you don't need the variable food at all, because you can always recover your symbol instances finding them by name.

于 2013-04-15T10:43:36.133 回答
0

If you're inside of the symbol you wish to destroy:

edit: Correcting myself here. It should be:

sym.deleteSymbol();

not:

this.deleteSymbol();

But they both work.

于 2014-02-09T23:26:15.757 回答