Posted in

Menú contextual en Flash

Menú contextual al hacer clic con el botón derecho sobre un campo de texto.

this.createTextField("news_txt", this.getNextHighestDepth(), 10, 10, 320, 240);
news_txt.border = true;
news_txt.wordWrap = true;
news_txt.multiline = true;
news_txt.text = "To see the custom context menu item, right click (PC) or ";
news_txt.text += "control click (Mac) within the text field.";
var menu_cm:ContextMenu = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("Resize", doResize));
function doResize(obj:TextField, item:ContextMenuItem):Void {
// "Resize" code here
trace("you selected: "+item.caption);
}
news_txt.menu = menu_cm;

Deixa un comentari

L'adreça electrònica no es publicarà. Els camps necessaris estan marcats amb *


The reCAPTCHA verification period has expired. Please reload the page.