Skip to main content
July 10, 2009
Question

Override MovieClip's parent and stage properties

  • July 10, 2009
  • 1 reply
  • 743 views

Hello,

is there a way to override a MovieClip's parent and stage properties?

In a custom class extending the MovieClip class we can override the get parent() and get stage() methods. But is there a way to do it to existing MovieClip?

I mean I have an external swf content (loaded) and assigned to a movieClip. But now, how can I assign the loaded MovieClip to my custom class, so that it "doesn't see" the parent and stage properties?

Or can I override functions of existing classes?

Sth like:

override public function myMovieClip["get parent"]():DisplayObjectContainer

{

     ...

}

Please help me with it. I just need to prevent a loaded MovieClip from having access to the main movie's stage.

Thanks!

This topic has been closed for replies.

1 reply

Inspiring
July 11, 2009

Why are you starting another thread on this? And as I stated in your other thread I don't think you can.

But more importantly why would you want to?

July 11, 2009

I am really sorry for starting another thread for this, but I'm really desperate to get the answer and I thought people might have gotten confused when reading long discussions in other threads

The reason I want to do it is to prevent a loaded swf from taking control over my main movie. I intend to load unknown and not checked swfs, so such restriction is crucial.

Thank you.

Ned Murphy
Legend
July 11, 2009

"I intend to load unknown and not checked swfs, so such restriction is crucial."

Be sure to have a clear warning on each page that your site is a potential virus factory and that use of it is entirely the risk of the visitor.  You are asking for trouble with or without the prohibitions you seek to include.  Where there's a chance to hack in a system destroying virus, the competition among those who enjoy that challenge is likely to grow quickly. Something as simple as a redirect from one of those files could be all that's needed.