1067: Implicit coercion of a value of type Class to an unrelated type flash.display:MovieClip


hello, i've class named loadimages code:

 

package

{

    import flash.display.movieclip;

    import flash.events.mouseevent;

    import flash.events.event;

    import flash.display.loader;

 

    public class loadimages extends movieclip

    {

        private var _root:movieclip=new movieclip();

 

        public function loadimages(numimages:number, rt:movieclip)

        {  

 

...

 

and i've second class named mainjogo call's loadimages:

 

package

{

    import flash.events.*;

    import flash.display.loader;

    import flash.display.movieclip;

    import flash.display.stage;

    import loadimages;

 

    public class mainjogo

    {       

 

         #error

        private var imgmc:loadimages=new loadimages(2,this);

          #error

 

        public function mainjogo(url:string)

        {

 

...

 

if post mainjogo class code in timeline there no problems if run app 2 classes keep getting error

1067: implicit coercion of value of type class unrelated type flash.display:movieclip.

 

can me please?

thanks

mainjogo not movieclip "this" (in scope of mainjogo) not movieclip.

 

if mainjogo did extend movieclip class, still need cast "this" movieclip.

 

you use:

 

package

{

    import flash.events.*;

    import flash.display.loader;

    import flash.display.movieclip;

    import flash.display.stage;

    import loadimages;

 

    public class mainjogo extends movieclip

    {       

 


private var imgmc:loadimages=new loadimages(2,movieclip(this));

 

        public function mainjogo(url:string)

        {



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support