views:

27

answers:

1

Hi all,

I am facing a problem that I have a hard time understanding.

I am currently working on a project that involves dropping objects (scrabble letters) onto different cells in a table. My project also involved multiple levels.

My layout is rather basic. I have a a bunch of tiles (25 letters) above a 2-columns table (left side for definition, right for answers). The table is static from frame 1 til the end (no keyframe, blankframe, etc.).

The problem is as follows: The exercise starts fine with the first Level, then I click a button to access the next level, and so on... Going FORWARD on the timeline seems to be working OK, I am able to complete each levels in succession. However, if I decide to go backwards (replay a previous level) I can no longer place tiles on my table (hitTestPoint not returning what it should). I checked and my "target" is indeed there but somehow the hit test does not register.

I probably have the concept all wrong... Can someone explain what is happening to objects as the timeline advances (or rewinds) via ActionScript?

TIA

Michel

A: 

Like in other languages, variables in as can be limited by scope.

From your question I gather your table is a static graphic, and have different levels on different frames?

Its hard to tell without the code or knowing the class names you have assigned. If you could post some code it might help. Alternatively, if this is an important issue, mail me the flash file. Its been almost a year since iv done as3, but I might be able to help.

Jubbsee
Thank you for your offer, Please see added comment.I am very familiar with "scope" as this is not my first programming language... I would love to be able to unpload pictures but this is not yet possible for me... In short I have my objects layout as follows:stage.scrabblePieceX_mc (X = 1 to 25)stage.table_mc.column2_mc.cellX_mc (X = 1 to 5)using the "this.parent.addChild(this)" ensures that the scope of each scrabblePiece remains the same.What really puzzles me is why everything works going forward on the timeline but not backward. What happens when the timeline hits a keyframe?
Michel Lemieux
If you are creating the pieces dynamically in the as, by calling a constructor of a custom class, depending on which layer and frame that particular code is visible in, it could be calling that constructor on every keyframe. Have you checked for this?
Jubbsee