Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

I got scrollbar but don't know which object is it's owner

Engaged ,
Sep 22, 2017 Sep 22, 2017

I got many objects on stage (containers, components, etc) and one of them creates scrollbar, but I don't know which one. I've set  horizontalScrollPolicy="off" verticalScrollPolicy="off" on most of them but the scrollbar still appears.

It will take me long time to check each component separetly, because they are all connected and removing one of them will force me to change a lot of code.

Is there any simple way to check out which object is parent or owner of this scrollbar?

TOPICS
ActionScript
514
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 22, 2017 Sep 22, 2017

you could use the trace function:

trace(your_scrollbar.parent.name);

or

trace(your_scrollbar.scrollTarget.name)

or what ever else you mean by 'owner'.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 22, 2017 Sep 22, 2017

By owner I mean object which created this scrollbar.

But I don't know where to find this scrollbar, I see it on stage, but don't know which object created it.

So I can't trace it - in your answer I need scrollbar's instance name? But it's not my scrollbar, it's build-in scrollbar of some object.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 22, 2017 Sep 22, 2017

if you mean you can't find it in the fla, then you can't be helped via a forum (unless someone else checks the fla and finds it).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 22, 2017 Sep 22, 2017

It's in flex (but flex forum is closed I think) so don't have .fla.

I give up, I made recursive search for all children of my app and it didn't find any object with scrollbar, but I still see this bar when app is running

public function check(comp:*):void {

     var num:int = comp.numChildren;

     for(var i:int = 0; i < num; i++) {

          var child:* = comp.getChildAt(i); 

          trace("child: " + child + " at i: " + i);

          if (child.hasOwnProperty('verticalScrollBar')) {

               trace ('child has vertical bar');

               if (child.verticalScrollBar && child.verticalScrollBar.visible == true) {

                     trace ('found scroll bar');

               }

          if(child.numChildren > 0)

          {

               check(child);

          }

     }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 25, 2017 Sep 25, 2017
LATEST

Since recursive search of objects with scrollbar didn't give any results (don't know why) I had to deconstruct my app and I found reason why scorllbar appears. My screen is 900px height and flex shows stage.height as 904px. It was not a problem for components using height="100%", but it started to be a problem when using scaling. One of my components is 768px height I scaled my component with

scaleY  = stage.height/768;

So in the end my component had scrollbars coz it was bigger than the screen. Now I'm using

scaleY  = parentApplication.height/768;

and it seems to work alright.

Still don't know why stage.height is 904px when it should be 900px.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines