Search code examples
actionscript-3flash-v3-components

Flash ScrollPane, why is my scroll width/height broken when loading a .SWF?


I've got an AS3 app making use of the fl.containers.ScrollPane object, and I am setting the source to an SWF file like so:

myMc.scrollContent.source = "assets/something.swf";

When running the application, the SWF is loaded as expected, but both the scrollbars, vertical and horizontal have tiny scroll tacks, that when moved, causes the loaded SWF to completely jump out of view.

It's as if the scrolling region is 10000 x 10000 pixels large.

How can I explicitly set the scroll height and width with code?


Solution

  • For some silly reason I tried the following. I went into Flash and opened the FLA for publishing the SWF being loaded. I cut the objects from the stage by Shift selecting and hitting Ctrl + X. Then I hit Ctrl + A to select all, to get rid of any possibly hidden or invisible objects off-stage, and then I pasted in place with Ctrl + Shift + V.

    Republished the file, and the problem was fixed.