Solved

ScrollPane displays dynamic content outside borders and does not scroll

Posted on 2006-07-05
3
653 Views
Last Modified: 2008-01-09
Im dynamically creating textfields into a blank MC, linked from my library, into a ScrollPane. This works, but when there are enough textfields to warrant a vertical scrollbar, they ignore the ScrollPane boundries and continue to display down the page. The scrollbar does not appear.

Im using Flash MX Professional 2004 on Flash Player 7.

My code is:

on(release){
      spContentHolder = _root.scrollPane.createChild("mc_uk", ["spContentHolder"+_global.instance_counter]);
      _root.scrollPane["spContentHolder"+_global.instance_counter].createTextField("foo", this.getNextHighestDepth(), 0, y_counter, 50, 20);
      _root.scrollPane["spContentHolder"+_global.instance_counter].foo.text = "TEST "+_global.instance_counter;
      foo.embedFonts = true;
      _global.instance_counter++;
      _global.y_counter = _global.y_counter + 30;
      _root.scrollPane.setScrollContent("mc_uk");
      _root.scrollPane.invalidate();
}

some old forums have discussed an old bug prior to Flash Player 6, but this is different. I've also tried duplicating MC's but find the same problem.

any ideas??
0
Comment
Question by:jbclelland
  • 2
3 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17042474
Hi,

You are doing it wrong way.

you can only attach a movieClip with scrollPane using its linkageID

let's assume you have a movieClip in library with linkageID "myMc"

and scrollPane instance on Stage with instanceName "mySp"

then here is the code to attach "myMc" with "mySp"
----------------------
mySp.contentPath="myMc"
----------------

now you can access attached "myMc" instance and its contents using following code:
----------
mySp.content.foo.text = "TEST "+_global.instance_counter;
---------

I hope all would be clear

Rgds
Aneesh
0
 

Author Comment

by:jbclelland
ID: 17042682
Hi Aneesh.

yes, im already linking to a MC in my library using some code outside my button:

_root.scrollPane.contentPath="mc_uk";

what you've put is ok for changing properties of 1 instance, but my problem with the ScrollPane's boundary when loading multiple instances in.
0
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
ID: 17043012
1.
following code has problem
---------------
_root.scrollPane.createChild("mc_uk", ["spContentHolder"+_global.instance_counter]);

_root.scrollPane.setScrollContent("mc_uk");
     _root.scrollPane.invalidate();
--------------


2.
AS2 scrollPane component doesnot support following methods:
  createChild
  setScrollContent()
  invalidate()

3.
if you have to add the content in scrollPane attached movieClip then use folloiwng:
----------
_root.scrollPane.mySp.content.createTextField("foo", this.getNextHighestDepth(), 0, y_counter, 50, 20);
_root.scrollPane.mySp.content.foo.text = "TEST "+_global.instance_counter;
     foo.embedFonts = true;
     _global.instance_counter++;
     _global.y_counter = _global.y_counter + 30;

------------
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now