Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ScrollPane displays dynamic content outside borders and does not scroll

Posted on 2006-07-05
3
Medium Priority
?
663 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
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.
Suggested Courses

877 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