Solved

ScrollPane displays dynamic content outside borders and does not scroll

Posted on 2006-07-05
3
657 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 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

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

Suggested Solutions

Title # Comments Views Activity
YouTube video issue 28 143
How to block online streaming via TMG2010 ? 2 152
Removing Flash from Website 6 77
Adobe Flash player - Microsoft Edge 9 184
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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 select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

732 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