Solved

ScrollPane displays dynamic content outside borders and does not scroll

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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…
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…

756 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