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
Explain what are the features provided by actionscript 3.0?
what is not a benefit of using macromedias pre-built ui components? : Adobe flash
Hi All, I am new in flash so please help me, When I make a website on Flash & when we wright code on buttons in AS2[CODE: on(release) gotoAndStop ()], we found when we click twice on a button the page automatically switch. (means, code do not work properly). Thanks,
Write a function for a button.
How to write a program use a text field and display it using the actionscript?
Can you explain what are the differences between javascript and actionscript?
which statement best describes what the #initclip num and #endinitclip commands indicate? : Adobe flash
what should be inferred by a variable named birthplace_str? : Adobe flash
which of the methods provedes the most controlled printing of flash content? : Adobe flash
How to add event listeners in mxml components.
What are the different utils libraries in actionscript?
you have a video project that would best be served by using full screen mode. This needs to be done from within the browser, since you are not able to use a projector. Which publish settings should you use? : Adobe flash
a button instance is named circle_btn. Actionscript is placed on the main timeline so that the button is clicked a movie clip instance named rec_mc s width is changed to 100? : Adobe flash
can some organizations block flash movies from being received through the internet? : Adobe flash
Do you know what is the difference between an array and vector?