?
Solved

ScrollPane displays dynamic content outside borders and does not scroll

Posted on 2006-07-05
3
Medium Priority
?
661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 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