Thanks for the reply but with this code (and variations including the code
you sent):

import mx.utils.Delegate;

class com.tequila.canon.PosterArtist.Controller {

   private var portfolio:MovieClip;

   public function Controller()
   {
       trace("Controller constructor: " + this.portfolio);

       this.portfolio.addEventListener("onClick",this);

       //this.portfolio.onInit = this.portfolioOnInit;
       this.portfolio.onInit = Delegate.create(this.portfolio,
this.portfolioOnInit);
   }

   private function portfolioOnInit():Void
   {
       trace("onInit: " + this);
       this.flipCorner("bottom_right");
   }

}

I still get this error:

**Error** C:\Documents and Settings\giles roadnight\workspace\Poster
Artist\com\tequila\canon\PosterArtist\Controller.as: Line 22: There is no
method with the name 'flipCorner'.
            this.flipCorner("bottom_right");

Total ActionScript Errors: 1      Reported Errors: 1

Thanks

On 5/25/07, Johannes Nel <[EMAIL PROTECTED]> wrote:

use mx.utils.Delegate to assign the function
   this.portfolio.onInit = Delegate.create(this,portfolioOnInit);

On 5/25/07, Giles Roadnight <[EMAIL PROTECTED]> wrote:
>
> Hi All
>
> I have this code within a class:
>
> class com.tequila.canon.PosterArtist.Controller {
>
>     private var portfolio:MovieClip;
>
>     public function Controller()
>     {
>         trace("Controller constructor: " + this.portfolio);
>
>         this.portfolio.addEventListener("onClick",this);
>
>         this.portfolio.onInit = this.portfolioOnInit;
>     }
>
>     private function portfolioOnInit():Void
>     {
>         trace("onInit: " + this);
>         this.flipCorner("bottom_right");
>     }
>
> }
>
> But I get a compile error saying that flipCorner does not exist. It
> doesn't
> exist in COntroller but it does exist in portfolio.
>
> How do I get around this?
>
> Many Thanks
>
> Giles.
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>



--
j:pn
http://www.lennel.org
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to