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:
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.
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.