Bhavesh Shaha
Bhavesh Shaha

Reputation: 783

Tell Target code (convert to as3)

This is the code which I used in AS2

on (release) {
 tellTarget ("/incorrect")
 {
  nextFrame();
 }
}

How do I do this in AS3 (AIR) ?

Thank you.

Upvotes: 2

Views: 780

Answers (1)

Daniil Subbotin
Daniil Subbotin

Reputation: 6718

Instead of tellTarget("/something") use (root as MovieClip).something. Instead of on (release) { use addEventListener.

import flash.events.MouseEvent;

button.addEventListener(MouseEvent.CLICK, buttonClick);

function buttonClick(event:MouseEvent):void
{
    (root as MovieClip).incorrect.nextFrame();
}

Upvotes: 3

Related Questions