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

the f601/n6006 had a special control to set the fill-flash option on the body; is there a similar way to set fill levels on the f90x/n90s and sb-28 combo? : Adobe flash

774


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

793


which methods is most likely an event handler? : Adobe flash

877


Tell me what are the features involved in updating a language?

839


How to add event listeners in mxml components.

765


you want to skin flash cs3 components. What should you do? : Adobe flash

838


Which is the quickest way to make the stroke around an oval shape into a dotted line? : Adobe flash

781


What are the different utils libraries in actionscript?

730


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

723


which is not a benefit when adding a title in the document properties? : Adobe flash

759


to what does object drawing model refer? : Adobe flash

761


which of the following is not a key benefit of usability testing? : Adobe flash

835


you understand from the sb-25 manual that the built-in, retractable bounce card is meant for use with the flash head in a vertical position? : Adobe flash

753


what is vector graphic animation? : Adobe flash

772


Name the as3 components?

805