# MovieClipLoader Question

**URL:** <https://forum.kirupa.com/t/moviecliploader-question/164661>\
**Category:** flash\
**Created:** [October 3, 2005, 9:48pm UTC](https://forum.kirupa.com/t/moviecliploader-question/164661 "2005-10-03T21:48:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DigitalMac](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@DigitalMac](https://forum.kirupa.com/u/DigitalMac)\
**Post date:** [October 3, 2005, 9:48pm UTC](https://forum.kirupa.com/t/moviecliploader-question/164661/1 "2005-10-03T21:48:18Z")

</div>

I’m trying to figure out how to call a function in my class when onClipInit is executed. Here is the code that I am using right now:

```auto

class Portfolio {
   private function loadArtwork() {
      var clip = new MovieClipLoader;
      clip.onLoadInit = function() {
         resizeArtwork();
      }
      clip.loadClip("image.jpg", _root.img);
   }
   private function resizeArtwork() {
      _root.img._width = 55;
      _root.img._height = 55;
   }
}

```

I also tried the following code (the change is in red), but it seems that resizeArtwork() fired prematurely.

```auto

class Portfolio {
   private function loadArtwork() {
      var clip = new MovieClipLoader;
      [COLOR=Red]**clip.onLoadInit = resizeArtwork();**[/COLOR]
      clip.loadClip("image.jpg", _root.img);
   }
   private function resizeArtwork() {
      _root.img._width = 55;
      _root.img._height = 55;
   }
}

```

If anybody has a solution, that would be awesome.
