Hi, I have a question regarding referencing objects on the stage from other objects. You should be able to use the root from any object that has been added to the display list using addChild. But when I do so I get this error message:

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

The only way for me to do what I want is if I cast the root reference to the class of my document class. For example, if the name of my document class is MyDocumentClass it would be like this:

MyDocumentClass( root ).theObjectIWantToAccess.someProperty

My questions are:

1. Why do I have to cast the root property?
2. Is this the best way to go around what I want to do.

To illustrate what I'm talking about, here's a snippet of code:

if( this.inputBubble.x + this.inputBubble.width > PokerHandComp(root).frame_mc.width )
 {
        this.inputBubble.x = x;
        this.inputBubble.bubble_mc.scaleX = -1;
        this.inputBubble.txt.x = - this.inputBubble.bubble_mc.width + 20;
}

In this case my document class is called PokerHandComp.

Regards,


Johan Nyberg
Designer and web developer

[EMAIL PROTECTED]
08 - 50 00 24 30
070 - 407 83 00



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to