Hi,

I Need help in write an ActionScript class which overloads setMovie.
I am trying to write a class which overload setMovie. But I can't get
the following code to compile, can you please help me?
// this line won't compile:
static function main(mc) {
app = new MyMovie();
app.prototype.setMovie = function (_video_id, image_url, movie_url, l,
_track_id, eurl, append_vars) {

trace("setMovie");
}
}


Here is the full file:

$-3òßclass MyMovie extends MovieClip {

  private var _nWidth:Number;
  private var _nHeight:Number;
        
  static var app : MyMovie;


  // Declare the nested instance
  // as a property.
  private var mcShape:MovieClip;

  function MyMovie() {
    trace("A MyMovie");
  }

  public function setDimensions(nWidth:Number,
                                nHeight:Number):Void
  {

    trace("setDimensions");

    _nWidth = nWidth;
    _nHeight = nHeight;

    // Since you've declared mcShape as a
    // property, you can then reference it.
    mcShape._width = nWidth;
    mcShape._height = nHeight;
  }

  public function toString():String {

    trace("toString");

    var sDescription:String = "A MyMovie ";
    sDescription += "with dimensions: ";
    sDescription += String(_nWidth) + " X ";
    sDescription += String(_nHeight);
    return sDescription;
  }


                // entry point
        static function main(mc) {
                app = new MyMovie();
                app.prototype.setMovie = function (_video_id, image_url, 
movie_url,
l, _track_id, eurl, append_vars) {
        
    trace("setMovie");  
        }


        app.setMovie("1234", "abc", "def", "1234", "abc", "def", "efg");
        
        }
}

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to