1

Is it possible to use an integer in a variable path?

I have up to 50+ corresponding instances to target depending on the current frame, and don't wish to write everything out 50+ times. Tracing the string + integer, and it comes back as the instance name every time, however using it as a path, although the Test Movie will launch,triggering the function produces "TypeError: Error #1123: Filter operator not supported on type".

var curFRAME:int;
addEventListener(MouseEvent.MOUSE_UP,frame_dep);
function frame_dep(event:Event):void
{
trace("Cont_mclp_" + curFRAME);
this.("Cont_mclp_" + curFRAME).nextFrame();
}

Is it possible to use a integer variable in a path name?

1 Answer 1

0

Use the square brackets notation []:

this["Cont_mclp_" + curFRAME].nextFrame();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.