Write a function that responds to a click anywhere on the
page by displaying an alert dialog. Display the event name
if the user held Shift during the mouse click. Display the
element name that triggered the event if the user held Ctrl
during the mouse click.
Answer Posted / subash
//1)
stage.addEventListener(MouseEvent.CLICK, clickHandler)
function clickHandler(e:MouseEvent){
trace("Mouse Clicked")
}
//2)
stage.addEventListener(MouseEvent.CLICK, shiftHandler);
function shiftHandler(e:MouseEvent) {
if (e.shiftKey) {
trace("Mouse Clicked with Shift key");
}
}
//3)MouseEvent
stage.addEventListener(MouseEvent.CLICK, controlHandler);
function controlHandler(e:MouseEvent) {
if (e.ctrlKey) {
trace("Mouse Clicked with Ctrl key");
}
}
Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
what is vector graphic animation? : Adobe flash
you want to create a rectangle shape with a defined corner radius. Which tool should you use? : Adobe flash
what is needed when using static text to have font outline embedded in swf file? : Adobe flash
How does removal of actual objects and data work in actionscript?
how does an xmlsocket server know when a received message is complete? : Adobe flash
Write a program that shows the usage of data types?
How to create scrolling gallery in portfolio?
Which is the quickest way to make the stroke around an oval shape into a dotted line? : Adobe flash
which text anti-aliasing property setting will result in the smallest swf file size? : Adobe flash
Name the as3 components?
what is the primary purpose of the stage object? : Adobe flash
which statement best describes what the #initclip num and #endinitclip commands indicate? : Adobe flash
Tell me what are the different ways in which the variables can be assigned?
which of the following is not a result of exporting a movie for a debug build? : Adobe flash
What are the features provided by actionscript 3.0?