Skip to main content
Participant
October 15, 2007
Question

variables holding old values

  • October 15, 2007
  • 2 replies
  • 125 views
I've got a project where there are main menus, sub menus and sub-sub menus. I have 3 classes. 1) ContentController, 2) MainNavigation controller and 3) SubNavigation controller.

Main links to Content and SubNavigation.

SubNavigation links to Content.

When you click a main button, the content changes, the sub links come out. Click a sub link, it's sub-sub menu expands. Click a main and the sub-sub and sub roll up and switch to the new main button section.

when I click a new sub button that comes out, the sub-sub navigation of the previous sections "out" button becomes visible and rolls up.

It's a variable that is holding the info.

I can clear the variable several times in multiple places along the path of the code, and when I trace it, the old variable still shows up. From nowhere.

My trace statements look like this:
main buttons are rolling up
subBtnIsOut == false
subBtnOutName == "";
Click event recieved on sub button
test if subBtnIsOut and what subBtnOutName is:
subBtnIsOut==true;
subBtnOutName==btn_strategy

Anyone know why?

Could it be that the main button class is creating an instance of the SubNavigation class and the main movie is creating an instance of the SubNavigation class?

And there are really 2 instances of the class out there?

HELP! The client says it has to be done in 2 hours. 😞
This topic has been closed for replies.

2 replies

MWMmAuthor
Participant
October 15, 2007
OK here is the code link. I think it is a lot!!!

Thanks for the help!

I put a quick init function in the construtor of the SubNav class to test and this is the output:

array created
btns invisible
initialized = 1
videoPlayer.as imported
array created
btns invisible
initialized = 1


It seems like I got 2 instances of the SubNav class. I can't figure out how else to chain them together.

I uploaded the code here:

http://www.mindwhirl.com/clients/classIssue.txt

Any help is greatly appreciated!
Inspiring
October 15, 2007
>> can clear the variable several times in multiple places along the path of
the code, and when I trace it, the old variable still shows up. From
nowhere.

Well, not from nowhere. Sounds like a scope issue to me... someVar in one
timeline, is not necessarily the same as someVar in another timeline.
'Clearing' it as you said in multiple places, is just going to get you
deeper into trouble.

>> Could it be that the main button class is creating an instance of the
SubNavigation class and the main movie is creating an instance of the
SubNavigation class?

You are the only one that could answer that... and if you don't know this
already I'd think you haven't got much of a chance at finishing in two
hours.

Do you have some code to let people see? I don't think you're going to get
much help with what you've posted.

--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/