View Full Version : Scrollpane - Can't use components or buttons

02-10-2006, 10:14 PM
This is one of those late-Friday evening problems that's been vexing me for hours and is probably going to turn out to be ridiculously simple....

I've written an action script that dynamically loads and processes an XML file into an array and uses the data to generate a menu on the fly. It creates dynamic text boxes and populates them, draws buttons, etc.

This all works rather nicely when I run the menu on its own.

I've embedded this menu via a scrollpane into the flash movie it needs to control. The reason is so the menu can take up a fixed area and be scrolled, and then the user can click on an option and view it in the main movie.

Here's the problem:
When the menu SWF is loaded in the scrollpane, I can't click on any of the buttons. I CAN tab my way into the scrollpane and select a button that way, but no clicking.... The mouse pointer changes to the hand icon all of the contents in the menu, and one of the tab stops seems to be a box around all of the content in the scrollpane.

I suspect this is a level/layers/depth problem, but I can't seem to figure out what's causing it, and despite the fact that I seem to be able to easily cause this problem, I can't seem to find any postings on a solution to it anywhere.

Help please!

02-22-2006, 01:02 AM
I'm running into what sounds like similar issues.

I have a scrollpane that is loading an external SWF file. That SWF file has buttons, textInput fields and comboBoxes in it. The buttons and comboBoxes don't display any text. And I can't type in any of the input fields.

I've gone through the documentation for both the scollPane and the components I'm using inside of it (these are all version 2.0 components, by the way). But they didn't shed any light on this type of issue. And I've spent the last few hours trying to Google this problem and not making much progress.

I'm authoring in Flash 8 Professional, but exporting as Flash 7 SWF files with ActionScript 2.0.

The movie that is being loaded into the scrollPane also works fine by itself. It only loses its mind when loaded into the scrollPane. This wreaks of a _rootlock issue, yet that didn't solve it.

I've tried both manually placing component instances and programatically instantiating them at run-time. Similar results either way.

I can feel it - this will be one line of code to fix. I just...can't...find...it...



02-22-2006, 02:06 AM
I discovered that my problem was due to using a third party component that turned out to have slightly different methods for its class, so it worked the same for 99% of things, but not for that one issue.... Now I'm using Flash Pro 8, which has solved many of my problems.

That being said, in Flash Pro 8, the Scrollpane component has a scrollDrag parameter, which causes the same behavior I described when enabled. You can set it to "false" if you edit the parameters manually for the instance on stage, or if you're adding the scrollpane progmatically, it should be something like:
scrollpane.scrollDrag = false;

Did you try that? I'm thinking that could be causing not being able to use the input text, but if the populating function isn't working, I'd think it's something else.

Since it works exported to Flash 7 when not in a scrollpane, is it just a relative paths issue? In the project I'm currently working on I forever refer to everything with the _root.scrollpane.content. targeting to make sure I'm addressing the correct objects....

Another interesting issue I ran into is that a lot of solutions suggest using refreshPane() to make sure the pane is updated correctly. But when it points to an external SWF and you dynamically create text fields or movie clips, it seems that refreshPane() ends up wiping them out and reloading the SWF specified in the content path. So if you programatically set your combo boxes etc. and then refreshPane(), try commenting out the refreshPane() and see what happens.

You might also want to trace the value of the text boxes or combo boxes after the actionscript first sets them. I ran into a quick-fix issue where I was setting the contents of a dynamic text field and it was losing the default text format and instead showing nothing.... Tracing it showed the value was stored, so I realized I just had to assign a text format with setNewTextFormat().

Not sure if any of those are the cause of your problems.... If you still have issues, perhaps you can post your FLA?