Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-25-2007, 06:24 PM   #1
Registered User
Join Date: Apr 2005
Posts: 20
Question access display objects from within scrollpane instance?

I seem to have a similar problem to this post here:


But the answer provided doesn't appear to work.

Very simply, I create an instance of a scrollpane on my stage and I load in a mc from my library that has another mc nested within. I want to access that nested mc and I don't seem to be able to:

import flash.display.MovieClip;
import fl.containers.ScrollPane;
//MyBox is the class name of the mc in my library
var myMovieClip:MyBox = new MyBox();
var myScrollPane:ScrollPane = new ScrollPane();
myScrollPane.name = "myScrollPane";
myScrollPane.source = myMovieClip;
When I run this I get the following error:

1119: Access of possibly undefined property nested_mc through a reference with static type flash.display:DisplayObject.

If I try to access the nested_mc as suggested in the link I posted up top b using a trace function like this:

I get the same error...

What gives? What is the best way to access content within the scrollpane component?

Any advice is greatly appreciated!
Wheels is offline   Reply With Quote
Old 04-07-2008, 01:21 PM   #2
Interactive Development
MSFX's Avatar
Join Date: Feb 2008
Location: Herefordshire, United Kingdom
Posts: 484

To access a movieClip within a scrollPane:

ActionScript Code:
// create a scrollPane var aSp:ScrollPane = new ScrollPane(); // add to the stage addChild(aSp); // set the source (movieClip dragged on stage) aSp.source = mc1; // to access the movieclips alpha (for example) aSp.source.alpha = 0.5; // to access a textfield within the movieclip aSp.source.txt_field.text = "some text here";

Hope this helps
MSFX is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access MC by incrementing instance name victorysshadow ActionScript 1.0 (and below) 1 11-16-2004 03:37 PM
Database simulated with arrays on a cd-rom lecasn5 Components 61 09-07-2004 11:40 AM
enterframe and load and objects, oh my! dice ActionScript 1.0 (and below) 13 07-18-2003 11:07 AM
objects trapped in scrollpane Smirnoff ActionScript 1.0 (and below) 1 08-11-2002 01:39 PM
Not able to create an instance of objects in a movie clip bluehonu ActionScript 1.0 (and below) 2 03-21-2001 10:30 AM

All times are GMT. The time now is 03:20 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.