Skip to main content
Inspiring
April 15, 2013
Answered

Does this exist: loader.contentLoaderInfo.content as MovieClip

  • April 15, 2013
  • 1 reply
  • 802 views

_skin = _skinloader.contentLoaderInfo.content as MovieClip;

I have just seen this. I thought you used loader.content to get the route movieclip etc... Does the above code make any sense or even exist. content is not a property of contentLoaderInfo is it???

This topic has been closed for replies.
Correct answer kglad

if _skinloader is a loader that loads a swf and the swf extends the MovieClip class and loading is complete, yes - it makes sense.

and yes, the loaderInfo and the loader both have content properties.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 15, 2013

if _skinloader is a loader that loads a swf and the swf extends the MovieClip class and loading is complete, yes - it makes sense.

and yes, the loaderInfo and the loader both have content properties.

Inspiring
April 16, 2013

This code was written in the event handler so my question is why didn't they just write

_skin = evt.target.content as MovieClip

like everybody else usually does? I think it's the same but standard practise to use the event isn't it?

kglad
Community Expert
Community Expert
April 16, 2013

yes, i've never used the loaderinfo property of the loader to access the content that's loaded.  there's no reason to use that "long" way when you have access to the loader directly from the event.