Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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.

Answers were Sorted based on User's Feedback



Write a function that responds to a click anywhere on the page by displaying an alert dialog. Displ..

Answer / 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

Write a function that responds to a click anywhere on the page by displaying an alert dialog. Displ..

Answer / ravindrakumar karanki

we need to create a Alert Window class. If write in trace it
won't display in Alert dialog. It will display only on
output window.

use following code

package com.whatever {

//Imports
import flash.display.Shape;
import flash.display.Sprite;
import flash.geom.Rectangle;
import flash.events.MouseEvent;

//Class
public class AlertWindow extends Sprite {

//Vars
protected var box:Shape;
protected var yesBtn:Sprite;

//Constructor
public function AlertWindow (obj:Rectangle):void {

//Initialise
box = new Shape()
yesBtn = new Sprite()
addChild(box)
addChild(yesBtn)

//Render
with (box.graphics) {
lineStyle(1)
beginFill(0, 0.4)
drawRect(obj.x, obj.y, obj.width, obj.height)
endFill()
}

with (yesBtn.graphics) {
lineStyle(1, 0x00FF00)
beginFill(0x00FF00, 0.4)
drawRect(obj.x+obj.width-100,
obj.y,obj.height-40, 80, 20)
endFill()
}

//Events
yesBtn.addEventListener(MouseEvent.CLICK,
yesClickHandler, false, 0, true)
yesBtn.addEventListener(MouseEvent.MOUSE_OVER,
yesOverHandler, false, 0, true)

}

//Handlers
protected function yesClickHandler($):void {}
protected function yesOverHandler($):void {}
}
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Flash Action Scripting Interview Questions

what is flash tweening? : Adobe flash

0 Answers  


which two panels can be used to change the label text of a button component? : Adobe flash

0 Answers  


which actionscript classes are used to play flv formatted video? : Adobe flash

0 Answers  


What does the void function and object contain in actionscript?

0 Answers  


the value of a variable of timeline scope will persist until? : Adobe flash

0 Answers  


How many menus will you find on the menu bar?

0 Answers  


Write a function for a button.

0 Answers  


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

0 Answers  


How to write a program to show the external actionscript?

0 Answers  


How can we goto next Scene by giving code on a button inside a movie clip. in short. =>Scene 1. ====>MovieClip ======>Button [ on(release) { gotoAndPlay("Scene 2", 1); } ] =>Scene 2. This thing is not working. Please tell me the answer of how to goto next scene from this scene 1.

4 Answers   ABC,


How to add conditional logic for the submit button?

0 Answers  


Is it possible to create document or folder from flash? if yes then how?

6 Answers  


Categories