0
Handling Mouse Event
New Here
,
/t5/animate-discussions/handling-mouse-event/td-p/385917
Dec 28, 2008
Dec 28, 2008
Copy link to clipboard
Copied
How to access x and y co-ordinates when a mouse's left butto
is clicked upon a JPG file whichis placed on a stage, so that we
can view the jpeg contents on the stage?
Please can anyone please send code to my mail.
Please can anyone please send code to my mail.
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/animate-discussions/handling-mouse-event/m-p/385918#M10842
Dec 29, 2008
Dec 29, 2008
Copy link to clipboard
Copied
The mouse event object carries all the info you need.
Something like so should get you going:
myImage.addEventListener(MouseEvent.CLICK, mDown);
function mDown(e:Event){
trace(e);
}
--
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
Something like so should get you going:
myImage.addEventListener(MouseEvent.CLICK, mDown);
function mDown(e:Event){
trace(e);
}
--
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Srihari_Ch
AUTHOR
New Here
,
/t5/animate-discussions/handling-mouse-event/m-p/385919#M10843
Dec 30, 2008
Dec 30, 2008
Copy link to clipboard
Copied
Thanks a lot for your help......
As I am new to the AS3 platform, You had helped me....
Now I need to display these x and y co-ordinate values in a pop-up when clicked.
You can see the sample output here for Mouse_RollOver event in the below link:
http://www.flashdesignerzone.com/tutorials/t1025.php
"But, I couldn't understand the code present in above link."
Please explain me....
(Presently, I am using Action Script 3.0(AS3) with Flash 9 and have no idea about previous versions.)
Please, I request you to give me step-by-step process.
As I am new to the AS3 platform, You had helped me....
Now I need to display these x and y co-ordinate values in a pop-up when clicked.
You can see the sample output here for Mouse_RollOver event in the below link:
http://www.flashdesignerzone.com/tutorials/t1025.php
"But, I couldn't understand the code present in above link."
Please explain me....
(Presently, I am using Action Script 3.0(AS3) with Flash 9 and have no idea about previous versions.)
Please, I request you to give me step-by-step process.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guru
,
/t5/animate-discussions/handling-mouse-event/m-p/385920#M10844
Dec 30, 2008
Dec 30, 2008
Copy link to clipboard
Copied
in the code that Dave has posted above "e" represents the
event, event objects have properties, one of which (two actually)
named 'target' represents the object being clicked - eg. the
Display Object "myImage" - which has a properties called mouseX and
mouseY, you can access these properties to display the coordinates
relative to the scope of the Display Object - however 'how' you
display the value is a different matter, if you want to place the
'on screen' for the user, you should add one or two dynamic
textFields to you file that you can then assign the values to for
display. so lets assume you've done so, and the instances are named
xText and yText (remember to embed the font in the fields) - so
then to display the values you would use something like:
function mDown(e:MouseEvent) {
xText.text = e.target.mouseX;
yText.text = e.target.mouseY;
}
function mDown(e:MouseEvent) {
xText.text = e.target.mouseX;
yText.text = e.target.mouseY;
}
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Srihari_Ch
AUTHOR
New Here
,
/t5/animate-discussions/handling-mouse-event/m-p/385921#M10845
Dec 30, 2008
Dec 30, 2008
Copy link to clipboard
Copied
Already ihad developed the application with 2 text-boxes on
the stage and accessing those text-boxes through instances created
for them. I had got the required output there.
But, present requirement is to get the output of x,y co-ordinae values is in a pop-up box like, for example,
When you keep your mouse-pinter on any window's Maximise/Minimise button,
it shows or displays in a pop-up with Maximise(Restore Down)/Minimise respectively.
But, present requirement is to get the output of x,y co-ordinae values is in a pop-up box like, for example,
When you keep your mouse-pinter on any window's Maximise/Minimise button,
it shows or displays in a pop-up with Maximise(Restore Down)/Minimise respectively.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guru
,
/t5/animate-discussions/handling-mouse-event/m-p/385922#M10846
Dec 31, 2008
Dec 31, 2008
Copy link to clipboard
Copied
very good. well then you have two basic options here - to
make an 'actual' popup you would need to execute a JavaScript
method with the externalInterface class or use fscommand - however
this may only work 'sometimes' with today's popup blockers that are
enabled on most user's browsers. secondly, you could 'fake' a popup
window using an addtional MovieClip that you bring to the stage
dynamically when the call is made, under AS3 one does so by
invoking the constructor of the MC's class.
however, AS3 is so vast that there may be another method or class available that i am still yet unaware of to construct a popup window.
however, AS3 is so vast that there may be another method or class available that i am still yet unaware of to construct a popup window.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Srihari_Ch
AUTHOR
New Here
,
LATEST
/t5/animate-discussions/handling-mouse-event/m-p/385924#M10848
Jan 01, 2009
Jan 01, 2009
Copy link to clipboard
Copied
You said that,
to make an 'actual' popup you would need to execute a JavaScript method with the externalInterface class or use fscommand. Please can you tell me whether this task can be done using ActionScript 3.0 API clases.
If so, please mention /reply me the class name which is used for the same task.
to make an 'actual' popup you would need to execute a JavaScript method with the externalInterface class or use fscommand. Please can you tell me whether this task can be done using ActionScript 3.0 API clases.
If so, please mention /reply me the class name which is used for the same task.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/animate-discussions/handling-mouse-event/m-p/385923#M10847
Dec 31, 2008
Dec 31, 2008
Copy link to clipboard
Copied
tutvid.com has a great tutorial that refers to some of these.
Go to the one with the scrolling gallery.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

