6 Replies Latest reply on Jun 25, 2007 9:45 PM by kglad

    Loading Sprite Using Loader Need Access to Sprite Type

    vDiaz761
      Hello,

      I'm loading a Sprite via a Loader and once loaded I have access to that Sprite via the Loader class. I can manipulate the Sprites alpha, x and y coordinates ect. However, I have a custom function that fades in or out the passed param and it expects a Sprite. When I pass the loaded Sprite (loaded via the Loader class) I get an error:

      1067: Implicit coercion of a value of type flash.display:Loader to an unrelated type flash.display:Sprite.

      I know that the problem is that it expects a Sprite, but how do I access the Sprite type once the swf is loaded via the Loader?

      My Code:
      import FadeClip;

      var ldrMovieCntr:Loader = new Loader();
      addChild(ldrMovieCntr);

      var fcLoadedMovie:FadeClip = new FadeClip(); //CUSTOM CLASS
      fcLoadedMovie.setClipToFade(ldrMovieCntr); //PASSING IN A TYPE Loader - CLASS EXPECTS A Sprite

      Thanks in advanced,

      Vic