PDA

View Full Version : go up to the parent variable?



IanCremona
December 12th, 2008, 07:00 AM
on the main time like I've declared variable:

ActionScript Code:

newsTab.id = i;




...all is well

Then I've got a MC on the main timeline called "worldmap"

I tried the following:

ActionScript Code:

parent.newsTab.id = i;




But it is undefined

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

why?

Thanks
Ian

ryankee
December 12th, 2008, 11:27 AM
If newsTab is on the stage, why don't you simply call 'newsTab.id' instead of 'parent.newsTab.id'?

Magik5
December 12th, 2008, 11:32 AM
if "parent.newsTab.id = i;" is in your worldmap mc timeline,

try MovieClip(parent).newsTab.id = i;

need to type cast parent as a movieclip