How to activate something inside the function outside the service? -class

Hey,.

I need to activate a few lines of code inside a function, because that's where the name of the object is filed.

A Boolean value would work well? If so how exactly would implement it? I've tried Boolean but had no success because I'm not experienced with them...

Heres a code:

public var myboolean:Boolean = new Boolean();

public void Function_One()

{

}

public void Function_Two()

{

var myObject:DisplayObject = new ObjectClass();

I want the name of object ' myObject which will be used for the Function_One() but I can not so what is a good method to solve this problem?

}

I was thinking about a Boolean might be useful, so it could "set off" my lines of code with an if statement to a boolean type. But no luck...

Or is there a better way to do this?

Thank you.

Try with method 1:

If (getChildByName ("enemy_mc")! = null) removeChild (getChildByName ("enemy_mc"));

Try with method 2:

for (i = this.numChildren - 1; i > = 0; i--) {}

trace (BG.getChildAt (i). (Name)  Make sure that the name that you specified on stage

If (this.getChildAt (i) .name == "enemy_mc") bg.removeChildAt (i);

}

Place a trace statement and identify first if he recover the movieclip 'enemy_mc '.

Tags: Adobe Animate

Similar Questions

Maybe you are looking for