Skip to main content
sbryner
Inspiring
April 22, 2011
Answered

AS3 - Scope question

  • April 22, 2011
  • 1 reply
  • 676 views

Hi guys,


THE SETUP - WHAT WORKS

I have created and randomized an array list, simple enough.

I have created a 'box_mc' which includes 2 frames "Front" and "Back".

The "box_mc" appears on the stage in frame "Front".

When I click on it the "box_mc" goes to frame "Back" AND a text box on frame "Back" appears with the first item in the randomized array.

I NEED HELP ON

When I click "box_mc" again to go back to frame "Front" the frame changes UNLESS I click on the textbox inside of the "box_mc"

I'm using:

e.target.gotoAndPlay("Front"); // selects the 'box_mc' while on frame 'Front'

How can I do something like:

e.target.parent.gotoAndPlay("Front");  // could select 'box_mc' or 'box_mc.myText_txt' on frame 'Back' depending where i click

What can I use?

Thanks for helping,

Sky

This topic has been closed for replies.
Correct answer Ned Murphy

First, don't use 'target', but instead use 'currentTarget'.  Then make sure your textfield is not selectable and also set box_mc.mouseChildren = false;

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
April 22, 2011

First, don't use 'target', but instead use 'currentTarget'.  Then make sure your textfield is not selectable and also set box_mc.mouseChildren = false;

sbryner
sbrynerAuthor
Inspiring
April 22, 2011

Where is Atlantis? I ask because after reading a ton of threads there is nothing you don't know. lol

Thanks again,

Sky

Ned Murphy
Legend
April 22, 2011

You're welcome Sky.  As for Atlantis, I am bound to an NDA on that.