Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-11-2008, 08:19 PM   #1
lwang
Registered User
 
Join Date: Apr 2008
Posts: 38
Default access Movie Clip instance on the main timeline

I used addChild() method to include a few Movie Clip instances on the stage. Now I want to access them in a class associated with a button .as file. Does anyone know how I could do it?

e.g. the instance name is mc.
I tried stage.mc and root.mc, neither worked...
lwang is offline   Reply With Quote
Old 04-11-2008, 08:45 PM   #2
lordofduct
Senior Member
 
lordofduct's Avatar
 
Join Date: Feb 2008
Location: West Palm Beach, FL
Posts: 3,872
Default

you need a reference to it.

if you don't already have one in code... you can get it with:

myDisplayObjectContainer.getChildByName("name"); //where myDisplayObjectContainer is any object that inherits from DisplayObjectContainer, like MovieClip



read my siggy
__________________
www.lordofduct.com - come read my blog!

If you want to know how to program, take a math class, take a lot of math classes!
lordofduct is offline   Reply With Quote
Old 04-11-2008, 08:59 PM   #3
lwang
Registered User
 
Join Date: Apr 2008
Posts: 38
Default

Thank you. I do have a reference for it, e.g. my_mc.

The problem i was running into was that the code for the button is from a different package. And I have no clue how to correctly refer to the instance my_mc on the main stage. root.my_mc or stage.my_mc didn't work.
lwang is offline   Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
removeMovieClip() not work for components? djandrew Components 30 08-03-2007 04:51 PM
gotoAndStop from the main timeline to a frame in a movie clip 2keysmatt ActionScript 1.0 (and below) 11 05-01-2007 06:53 PM
Getting movie clip buttons to work within main area Ben Healy ActionScript 1.0 (and below) 1 05-24-2006 07:50 PM
:: | Control Main timeline from within a Movieclip | :: ox4dboy ActionScript 1.0 (and below) 2 03-22-2004 10:53 AM
How to change instance name of movie clip dynamically? jungyung ActionScript 1.0 (and below) 1 09-07-2002 02:10 AM


All times are GMT. The time now is 05:44 PM.

///
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.