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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe changewatcher.watch.

910


what are the statements is true about actionscript in regards to the enforcement of private scope and public scope? : Adobe flash

807


the class that is inheriting the another is known as the? : Adobe flash

1028


what appears in the output window after executing this actionscript on the first frame of a movie? : Adobe flash

805


which is an advantage of selecting a flash player version in publish settings before beginning a project? : Adobe flash

792


what is the recommended character to use to separate target level paths levels? : Adobe flash

874


What is the main purpose of actionscript?

836


What is the use of depth?

931


which of the following is most likely a class constructor? : Adobe flash

820


what is flash tweening? : Adobe flash

882


which methods can be used to determine if a microphone or a camera is installed on the users machine? : Adobe flash

833


what is the downside of macromedia ui components making extensive use of ingeritance and encapsulation? : Adobe flash

935


what is the primary difference between the xml.sendandload method and the xml.load method? : Adobe flash

763


Do you know what are the different primitive data types used in actionscript?

798


what is generally considered the ideal group size for usability testing? : Adobe flash

811