External SWF loading, using a fixed width

Hey,

I have a question about a simple application I’m trying to create with flash.
First off, the app uses thumbnails of pictures. These thumbnails can be dragged and dropped onto a big movieclip, which then loads the external .jpg into itself. These thumbnails also have captions which get loaded into a dynamic textbox (instance name “txt_hint”)
Structure:
I have a movieclip (instance name “mc_viewer”), which functions as a hitarea for the draggable thumbnails and also as a container for the external photo’s.
I have some code on the thumbnails:
(Example of one thumbnail)


this.foto_naam = "foto3.jpg";
this.hint_text = "Skyline...";
this.original_x = this._x;
this.original_y = this._y;
this.onPress = function()
	{
		this.startDrag(true);
	};
this.onRollOver = function()
	{
		_root.txt_hint.text = this.hint_text;
	};
this.onRollOut = function()
	{
		_root.txt_hint.text = "";
	};
this.onRelease = function() 
	{
	this.stopDrag();
	if (this.hitTest(_root.mc_viewer))
		{
			_root.mc_viewer.loadMovie(foto_naam);
		};
	_root.mc_viewer._width = 400;
	this._x = original_x;
	this._y = original_y;
	};

So when I drag a thumbnail onto that mc_viewer movieclip, the external file gets loaded and the thumbnail will automatically reset to its original location.
Now the problem is that I want these external .jpg files to resize automatically when they are loaded. I want the width to be 400 pixels. The example I’m using here is working, but only one bug exists. The first time I drag and drop a thumbnail into the mc_viewer movieclip, it doesn’t get resized. After that first time everything works how it’s supposed to work.

How can I kill that nasty bug?

Thnx in advance,
Code-red.

P.S. If this doesn’t make any sense… I can post a zip file with all of the stuff (.fla, .jpg) in there.

Ok here is the .zip file, maybe that will help.

on the main timeline

mc_viewer.createEmptyMovieClip("p",1)

in you external file

this.original_x = this._x;
this.original_y = this._y;
this.onPress = function() {
	this.startDrag(true);
};
this.onRollOver = function() {
	_root.txt_hint.text = this.hint_text;
};
this.onRollOut = function() {
	_root.txt_hint.text = "";
};
this.onRelease = function() {
	this.stopDrag();
	if (this.hitTest(_root.mc_viewer)) {
		_root.mc_viewer.p.loadMovie(foto_naam);
		this.onEnterFrame = function() {
			if (_root.mc_viewer.p._width) {
				trace(1)
				_root.mc_viewer.p._width = 400;
				_root.mc_viewer.p._height =300 
				delete this.onEnterFrame;
			}
		};
	}
	this._x = original_x;
	this._y = original_y;
};