Skip to main content
Inspiring
November 12, 2007
Question

Wierd things happen after importing AS2 component

  • November 12, 2007
  • 4 replies
  • 483 views
Hello!

I am forced to use a fairly large amount of code that heavily relies on hard-coded depth. (Just about every line of code begins with _level0, _level1, or _level2.)

I would like to use AS2 components with this code. Components mainly interfere with a pop-up type movieclip (with a button) that is dynamically attached to either _level0, _level1, or _level2.

So far I have changed every getNextHighestDepth() to an specific number. This enabled the pop-up to be removed dynamically.

The problems (occurring only after adding a component to the file):

- The "over" state for the button on the pop-up only appears when the mouse is moving. It is possible to click the button, but take a few tries. "Spastic" would be the best way to describe it.

- After the pop-up has been removed, several other buttons will only execute the "press" event, completely ignoring the "release" event.

Somehow, the component is interfering... I suspect depth is involved, but I can't figure it out.

Any help (or theory) on what's going on would be greatly appreciated!
This topic has been closed for replies.

4 replies

kglad
Community Expert
Community Expert
November 13, 2007
oh, sorry.

that's a v2 component bug. you might be able to resolve that problem if you use the focusmanager class. otherwise, don't use the offending components.
kglad
Community Expert
Community Expert
November 13, 2007
did you read either of the two posts that tell you how to remedy the problem?
Inspiring
November 13, 2007
I should have mentioned that I tried what you suggested... It makes no difference....

My understanding was that using getNextHighestDepth would interfere with the removing of a movieClip (not the mouse events after a clip has already been removed)

I just tried it again to make sure. I set a variable to a specific number, then used that variable in place of each getNextHighestDepth. Finally, I removed the swapDepths. Is there anything else I am missing?

Participating Frequently
November 12, 2007
getNextHighestDepth() tends to interfere with the v2 components because those components use reserved depths. if you want to configure depths for assets when using v2 components, use the Depthmanager class.
Inspiring
November 13, 2007
Yep... I swapDepth before removing the pop-up window to deal with that issue.

Attached is the code I suspect is ultimately responsible. Basically, the helpwin function is called displaying the pop-up. THen, when the button on the pop-up is called, the hidewin function is called to hide it. After this point, strange things happen.... as mentioned in my previous post.

THis is only an issue after a component has been added. Otherwise everything is fine.

I don't think most of the code here is relevant, but I'm going to post the entire functions just in case.
kglad
Community Expert
Community Expert
November 12, 2007
some components occupy the highest removable depth which causes problems the problems you see when they are used with nextNextHighestDepth(). there's a depth manager component that should remedy the problem, but i find it easier to manage depths explicitly with a variable.