To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 11-25-2009, 12:26 PM   #1
imagesinmotion
Member
 
Join Date: Oct 2002
Location: England
Posts: 79
trying to trace the name of something

Hello

I have an empty movieclip that's on the stage. I'm then placing a movieclip inside it, like so:
PHP Code:
function addTinySection() {
    var
tiny:MovieClip = new tinySection();
    
completeLoader.addChild(tiny);
    
tiny.name="tiny"+1;
    
trace(completeLoader.getChildAt(0).getChildAt(2).name);
}
addTinySection();
I can trace the child name of the movieclip "completeLoader", but I can't trace any of the children names of "tiny".

I've attached the example for you to see.

Cheers
Attached Files
File Type: zip example.zip (7.1 KB, 0 views)
imagesinmotion is offline   Reply With Quote
Old 11-25-2009, 01:09 PM   #2
neznein9
Ө_ө sleepy mod
 
Join Date: Mar 2003
Location: Oregon, USA
Posts: 2,330
PHP Code:
trace(completeLoader);
trace(completeLoader.getChildByName('tiny1'));
__________________
Please use [php] or [code] tags, and mark your threads resolved 8)
neznein9 is offline   Reply With Quote
Old 11-25-2009, 01:21 PM   #3
imagesinmotion
Member
 
Join Date: Oct 2002
Location: England
Posts: 79
Thanks for the reply but it's not what I'm looking for. I need to get to the children of "tiny"

I can trace the name of tiny:
trace(completeLoader.getChildAt(0).name);
imagesinmotion is offline   Reply With Quote
Old 11-25-2009, 01:24 PM   #4
neznein9
Ө_ө sleepy mod
 
Join Date: Mar 2003
Location: Oregon, USA
Posts: 2,330
That's already a reference to the object - you probably just need to cast it:

PHP Code:
trace(DisplayObjectContainer(completeLoader.getChildAt(0)).getChildAt(0).name);
__________________
Please use [php] or [code] tags, and mark your threads resolved 8)
neznein9 is offline   Reply With Quote
Old 11-25-2009, 01:27 PM   #5
imagesinmotion
Member
 
Join Date: Oct 2002
Location: England
Posts: 79
Great, thanks neznein9!
imagesinmotion is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


All times are GMT -4. The time now is 10:36 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.