Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
user8429

Accessing a normal variable or function from child swf

Recommended Posts

Is it possible to access variables or functions belonging to the parent swf from child swf, which are not assigned to _root, withouth changing code of the parent swf? For example in parent swf there is not-root variable called 'x' in 'SomeClass' class. Now I'm loading second swf through 'loadMovie' function and I want to print value of this variable in child swf. I can't just write 'trace(_root.SomeClass.x)' because this is not _root variable.

Link to comment
Share on other sites

It has been several years since I dealt with this kind of thing, and I don't think what you're asking is possible, but I could be wrong. I wish I had a better answer for you. 

Link to comment
Share on other sites

  • 5 months later...

hey ya mate. Not sure if this is too late. But you can try tunnelling up from your child swf.

 

trace(this.parent)

trace(this.parent.parent)

trace(this.parent.parent.parent)

 

See what hits.

 

Also try adding Monster Debugger to your child swf and run the companion app to see what it outputs. Might be easier than blind tracing.

 

http://demonsters.nl/nl/projects/monsterdebugger/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×