Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Thread Tools Rate Thread Display Modes
Old 06-02-2007, 09:46 PM   #1
Registered User
Join Date: Jun 2007
Posts: 5
Default Movieclips inside movieclips that controls movieclips in root...

Hello, my first post... cool

The title might be a little confusing, my problem is that I have two movieclips (lets call it movie1 and movie2) in the stage (root), inside movie1, I have another movieclip, called movie3, what i want and haven't being able to, it's to control proporties of movie2 from movie3... I just can't access it from there, I have tried for example:

inside movie3: _root.movie2.visible = false; (this used to work in AS 2, but now it just gives errors)

"1120: Access of undefined property _root..."

movie3 would be a button that triggers a couple of actions (like that one) affecting movieclips in root...

so the question is how can I access an instance of a movieclip in the main stage (or wherever it is) from another nested movieclip...?

Thanks in advance, I hope I made sense...

tinkertrain is offline   Reply With Quote
Old 06-04-2007, 01:04 PM   #2
Senior Member
Join Date: Dec 2001
Posts: 106

i think you are looking for downcasting to access properties of a movieclips parent

var par:MovieClip = MovieClip(parent)
par.visible = false

MovieClip(parent).visible = false
...be careful with sprite nesting and listening to my advice though, i am also an AS3 struggler

Last edited by kimgar; 06-04-2007 at 01:09 PM.
kimgar is offline   Reply With Quote
Old 06-04-2007, 02:19 PM   #3
six eyes
senocular's Avatar
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular

_root is root in AS3
senocular 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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Load a sound from root to inside a mc Damiano ActionScript 2.0 4 08-16-2006 07:59 PM
Controlling movieClips from the root directory. FarbrorVattenmelon ActionScript 2.0 0 03-31-2006 11:45 AM
Finding the root ._x value of an object inside a mc Nocky35 ActionScript 2.0 1 10-06-2005 09:42 AM
Problems naming movieclips dynamically inside a loop shockthealien ActionScript 1.0 (and below) 7 08-12-2003 12:48 PM
Using functions inside a movie clip from the root writer81 ActionScript 1.0 (and below) 2 02-27-2003 04:42 PM

All times are GMT. The time now is 08:03 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.