views:

74

answers:

1

Question: In Flash ActionScript 3, I extend a MovieClip as show below.
But when I create a ToolBar with ToolPictures, and set Xscale and Yscale, then it doesn't resize if I use cMyClip, it works correctly when I use MovieClip.

Am I missing something ? Or is extending not the same as inheritance ?

package 
{   
import flash.display.Stage;
import flash.events.MouseEvent;
import flash.display.MovieClip;  
import flash.display.Bitmap;    
import flash.display.BitmapData;
import flash.display.Scene;
import flash.display.Sprite;


class cMyClip extends MovieClip 
{
    public var strToolTip:String="test";
    public var load_width:Number=0;
    public var load_height:Number=0;


    public function cMyClip() //:cMyClip
    {
        super();
    }
} // End Class
} // End Package
+2  A: 

You need to make sure that your MovieClip is linked to the new class you have made.

You do this by right clicking on the MovieClip in your library and selecting properties. You must then tick Export for ActionScript and enter the name of your new class into the class text box.

P.S. Extending a class is the same as inheritting from it.

Richard