GhostWire Studios :: Flash Components :: PHPObject



Forum Rules Customers

If you are a customer and have a question relating to the usage of the components, please login using your customer account and post in the "Help & Problem Solving" forums.

Any question posted here without a valid customer account will be deleted.

If you do not know your customer account, please send an enquiry to support. Thanks.

Reply to this topicStart new topicStart Poll

> component patch, pad property for GWcontextMenu
mecklen
Posted: Feb 10 2006, 12:18 AM
Quote Post


Novice
*

Group: Members
Posts: 3
Member No.: 4292
Joined: 14-October 04



If you want to attach the ContextMenu component be carefull to set the pad property. If you forget this, the ContextMenu is positioned at _x:0 and _y:0. There is no default value in the ContextMenu class, but perhaps something like the following could be added in a future release.

ContextMenu class, 19 (e.g.):
this.pad = (this.pad == undefined) ? 3 : this.pad;
PM
Top
Guest_mecklen
Posted: Feb 10 2006, 01:47 AM
Quote Post


Unregistered









Another patch for the ContextMenu: The setSize() Method should be:

GWContextMenuClass.prototype.setSize = function(w,h)
{
this.hotspot_mc.setSize(w, h);
}

and not:

GWContextMenuClass.prototype.setSize = function(w,h)
{
this.hotspot_mc._width = w;
this.hotspot_mc._height = h;
}

because this.hotspot_mc is a Panel component which needs to be resized by the named method, not via the properties.

(By the way: the Ghostwire components are really great. Finding these small bugs means only that I use them in an advanced Actionscript scenario. It is so great to have the source code. That makes many things possible.)
Top
sunny
Posted: Feb 10 2006, 02:05 AM
Quote Post


Administrator
*******

Group: Members
Posts: 1110
Member No.: 1
Joined: 14-July 03



Thanks for the recommendations, but...

1) I don't quite understand the issue with 'pad' - this shouldn't affect the ContextMenu's positioning... do you mean the positioning of the "hotspot area" or the "popup menu"?

2) hotspot_mc is a simple movieclip, NOT a panel component instance; it uses the 'panel_mc' symbol, but that is just a simple movieclip symbol , not the Panel component itself
PMUsers Website
Top
mecklen
Posted: Feb 10 2006, 02:13 AM
Quote Post


Novice
*

Group: Members
Posts: 3
Member No.: 4292
Joined: 14-October 04



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;
}
PM
Top
mecklen
Posted: Feb 10 2006, 02:17 AM
Quote Post


Novice
*

Group: Members
Posts: 3
Member No.: 4292
Joined: 14-October 04



QUOTE (sunny @ Feb 10 2006, 02:05 AM)
Thanks for the recommendations, but...

1) I don't quite understand the issue with 'pad' - this shouldn't affect the ContextMenu's positioning... do you mean the positioning of the "hotspot area" or the "popup menu"?


Yes, Iīve meant the popup menu. It was allways placed at the top left corner before Iīve added the pad default value or have set it via the initial object of the attachMovie Method.
PM
Top
sunny
Posted: Feb 10 2006, 02:21 AM
Quote Post


Administrator
*******

Group: Members
Posts: 1110
Member No.: 1
Joined: 14-July 03



To dynamically resize the hotspot area, just use the 'setSize' method after you have instantiated the ContextMenu instance:

myContextMenu.setSize(100,100);

Passing width/height parameters to the initObject WILL NOT work. If you wish to modify the code, I suggest that you use variable names like "hsWidth" and "hsHeight" (hs for hotspot) so as not to confuse yourself later with "width" and "height".

PMUsers Website
Top

Reply to this topicStart new topicStart Poll