Sunday, April 4, 2010

Accessing parent variables in...

I thought I knew how to do this, but maybe someone might be able to see why this is not working...

here's what I have (simplified to only show necessary code):

Main Timeline:

var currentItem:String = 'applesauce';

(then some code to load an external swf)

External swf main timeline:

trace(currentItem);

it returns ''undefiend''

i have tried

trace(MovieClip(root).currentItem);

trace(MovieClip(this.parent).currentItem);

each time undefined, any ideas?

Accessing parent variables in...

movieClip(parent.parent)

supposedly ... didn't work for me ... but it was explained the 1st parent reference is the loader .. the second the maintimeline ..

if your loading it into a MC .. add an additional parent ref ..

No comments:

Post a Comment