|
Sorry for the totally wrong post before (as Guest_mecklen). Sunny, you could remove it, if you want. I thought Iīve found the solution of my problem to dynamically resize the ContextMenu. The problem is, that the ContextMenu doesnīt catch initially the size of the clip and forward it to the this.hotspot_mc MovieClip (which isnīt a Panel component as I thought, itīs just named panel_mc). To catch the initial size just add the following code at ContextMenu class, 19:
this.width = (this._width == undefined) ? 100 : this._width; this.height = (this._height == undefined) ? 100 : this._height; this._width = 100; this._height = 100; this.setSize(this.width, this.height);
Now the ContextMenu is allways at 100% (which is 100px x 100px), just the hotspot_mc ist scaled (using the saved values). If this is initially done, the setSize() function works as expected and is totally correct:
GWContextMenuClass.prototype.setSize = function(w,h) { this.hotspot_mc._width = w; this.hotspot_mc._height = h; }
|