Flex :: Obtain Item For Mouse X/y Coordinates?

Nov 24, 2009

my mission is to select an item in a DataGrid instance with nothing but the coordinates on screen.

We are implementing right-click functionality in our Flash application, with the goal of being able to right-click a DG row, which would select that row plus show a popup window containing some context commands.

I have managed to get the right click event into my Flex app with the help of this site.

Further progress so far has been to obtain the DataGrid instance via

var objects : Array = this.getObjectsUnderPoint(new Point(this.mouseX, this.mouseY));

and then to investige each of the array's items, for one of those 'parent.parentList' refers to the DataGrid instance.

I couldn't find any point-to-item converter function or anything.

PS: Using the standard Flash ContextMenu is, unfortunately, not an option.

View 3 Replies


Similar Posts:


Flex :: Datagroup Item Renderer Coordinates?

Nov 24, 2009

I'd like to have an overlay that draws lines between selected items in different Flex 4 List controls.

The problem is I can't figure out how to access the x, y coordinates of the list's item renderers.

View 2 Replies

Flex :: Spark List Selected Item Coordinates?

Jun 17, 2011

I have a list with custom item renderers. What I would like is when one of the list items is selected to position another control OUTSIDE the list to the same vertical position as the selected item.

View 2 Replies

ActionScript 2.0 :: Obtain The Location Of An Item No Matter Where It Is

Aug 23, 2006

Is there a way (a method) to obtain the location of an item no matter where it is. Maybe something that looks for an item finds it's path and puts that path at to a _global

View 11 Replies

ActionScript 3.0 :: Obtain List Of Item Nabes In Library?

Jan 21, 2011

I simply want to generate a list of the items in my library. (Then i want to read an external file and format the text in as3. All this bec I'm too lazy to learn CSS.)

View 2 Replies

Actionscript :: Get Mouse Z Coordinates On Flex Papervision3d?

Mar 17, 2011

I am working on panoramic scene . And I want to move a plane with cursor. When I move mouse, plane must be mouse coordinates. And I want to take plane 3D coordinates (x,y,z) expecially z-coordinate. I try below code. But it doesnt work correctly. Mouse and plane are not be same coordinates on screen. How I can do?

public class RayTracer
{
public static function getIntersection(viewport:Viewport3D, camera:CameraObject3D, normal:Array):Number3D

[Code]....

View 3 Replies

Flex :: Display A Tooltip Only If The Mouse Cursor Is Within Certain Coordinates?

Feb 24, 2011

Within my component, I'm drawing some rectangles as below:

[Code]...

I need to display a custom tooltip for each rectange when the mouse cursor is hovering over it.

How can I do this? I'm using the MouseMove event to track when the cursor moves over these coordinates (that part is working), but when I change the tooltip text it's not refreshing

private function this_MOUSE_MOVE(event:MouseEvent):void

[code]...

EDIT: The problem seems to be with the following line:

ToolTipManager.destroyToolTip(_myToolTip);


If I comment out the preceding line, it will display the new tooltip, but it will keep creating new ones and the old ones never get removed. But if I add that line, it doesn't add any tooltips! Is the code not being executed sequentially, i.e., is the code to remove the tooltip somehow getting executed after the code to add the tooltip?

View 1 Replies

ActionScript 3.0 :: Possible To Obtain The Mouse Position Out Side Of Flash?

Mar 30, 2010

i have an eye. instance name: "eye1". it follows the mouse around just great using the following code...

Actionscript Code:
stage.addEventListener(MouseEvent.MOUSE_MOVE,eyesFollow);function eyesFollow(e:MouseEvent):void  var a1 = mouseY - eye1.y; var b1 = mouseX

[code]....

View 17 Replies

Flex :: Find The List Item Currently Under The Mouse Pointer?

Feb 3, 2010

I have some List and TileList controls. How can I get a reference to the list item that's currently under the mouse pointer?

View 3 Replies

Actionscript 3 :: Convert Global Coordinates To Local Coordinates Of A UIComplenent In Flex Project?

Dec 19, 2011

I was trying to convert global coordinates to local coordinates of a UIComplenent in my flex project using below code using below code

var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point

uic is UIComponent in which I have subclass of Sprite for drawing something I have set the sprite's mouseEnabled and mouseChildren to false to not interrupt the mouse event. above code is within uic's mousemove event where I was tracing the gp and lp gp was giving correct value and suprisingly lp was giving negetive values. when I move the move to the top left corner of uic i expect lp to be 0,0 but it is giving the -width of of uic. I broke my head for hours and ended up finding an alternate by using offsets. Infact my original code was much simpler like this which was same issue

var lp:Point = new Point(e.localX,e.localY);

I am not sure what exactly is causing this problem. the workaround had lot of issues and it creating a mess in my rest of the algorithms.Just now I found even more interesting thing (which is actually weird). for some reason I went and create a new lp2

var lp2:Point = new Point(e.localX,e.localY);

now surprisingly it was giving correct values as expected and I went back and changed the code as

var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point
var lp2:Point = new Point(e.localX,e.localY);
var lp2:Point = uic.globalToLocal(gp);

now it is expected to have all the lp, lp2 and lp3 variables to be same but weiredly lp two is giving wrong value and lp2 and lp3 were giving correct. I am suspecting using the variable lp has something to do. I am not sure about that but above proves it so right now I am using lp2.

View 1 Replies

Flex :: Handling Mouse Click 4 List To Find The Selected Item (since ItemClick Is Gone)?

Dec 8, 2011

I have prepared a simplified test case for my question. It will run instantly in your Flash Builder if you put the 2 files below into a project.I'm trying to display a List of strings and a confirmation checkbox in a popup:In the real application I dispatch a custom event with the string selected in the list, but in the test code below I just call trace(str);My problem: if I use click event, then the window closes, even if I click at a scrollbar (the !str check below doesn'twhen an item had been selected in previous use). And if I use change event, then the window doesn't close, when I click on the same item as the last time.riting a custom item renderer and having a click event handler for each item seems to be overkill for this case, because I have strings in the list.Test.mxml: (please click myBtn few times - to see my problems with click and change)

<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"

[code]........

View 3 Replies

Flex :: Obtain FillColor From Mx:LegendItem?

May 11, 2010

I need to get the fillcolor from a legendItem, howerver doinglItem.getStyle("fill") returns a different color than the actual legendItem marker color. Any pointers on what am I doing wrong here?

View 2 Replies

Actionscript 3 :: Add A Event Listener For Mouse Over And Mouse Out To Each Item

Sep 28, 2010

I have a map of items and I need to know when a mouse moves over the item. Should I add a event listener for mouse over and mouse out to each item (there may be a lot) or I should add mouse over and mouse out listeners to whole container and do some checking to detect whether the target has item on it or not? In the second way it would mean that the event would occur on entering each map tile in the container i would be listening. This seems a bit pointless, but I heard somewhere that I should add as little as possible.. So what should I do?

View 2 Replies

AS :: Flex - Obtain Stage Property In Added Children?

Feb 19, 2010

I am trying to trace stage.name in child view after addChild:

import flash.events.Event;
import flash.text.TextField;
public class TestView extends TextField {

[code].....

View 3 Replies

Finding The Mouse X And Y Coordinates?

Apr 18, 2011

I'd like to use the x and y mouse coordinates as variables in a program. I'm very new to Flash and ActionScript and I'm not even sure which classes I need to import or which listeners or handlers I need to use.

View 1 Replies

ActionScript 3.0 :: Mouse Coordinates In FF 3.6 On Mac OSX 10.6.3?

Jun 2, 2010

I have encountered really bad problem in one of our Flex projects. For some reason Flash can't get mouse coordinates properly. It returns something like (-107374182.4, -107374182.4) instead of good numbers. This happens when I'm using MOUSE_MOVE event in FF 3.6 on Mac OSX 10.6.3 with Flash Player 10. I have drag-n-drop in this projects, so with such ugly huge coords object goes far out of stage. Can't find solution in web, but there are some relative notes found...

For example, some info regarding 107374182.4 number can be found in internet.It seems 107374182.4 is something like NaN equivalent for some versions of Flash Player.Also I have found some notes regarding wrong mouse handling on Mac.The most interesting words there are: "on OSX it takes at least 1 frame to register the mouse's position". But it seems in my case it affects not only first frame after MOUSE_DOWN fired.Finally, there are movie on YouTube that demonstrates MOUSE_MOVE bug on FF/Mac.

I have tried:

- to get MouseEvent.stageX, MouseEvent.stageY (problem encountered);

- to get DisplayObject.root.mouseX, DisplayObject.root.mouseY (problem still appear, coordinates are bad);

- to use startDrag, stopDrag (it looks bugged too);

- to embed SWF into HTML with different wmode values.

View 0 Replies

ActionScript 2.0 :: Mouse X And Y Coordinates?

May 8, 2007

I need to get the mouse x and y coords for a game I'm making. I know how to do it with fererence to another movie clip, button, textbox, ... but not to the stage.If all else fails, I will attach a movie clip at (0,0) and then get the x and y coords from there, but if there is a simpler way, I would like to do that.

View 1 Replies

Flex :: Select Item In Details Form Dropdown When Datagrid Item Is Selected

Feb 15, 2011

I have this datagrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>

[Code]....

What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).

View 1 Replies

Flex :: Get List Item Selection Working When Using A Png Mask In An Item Renderer In A 4.5 Mobile App?

Jun 10, 2011

I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.

When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.

Code:

public class TopCalendarMonthRenderer extends LabelItemRenderer {
[Embed(source="/assets/trapezium_alpha.png")]
private static var TrapeziumMask:Class;
private static var trapeziumMaskInstance:BitmapAsset;

[code]...

View 1 Replies

Flex :: Access TileList Item Index In A Custom Item Renderer?

Mar 4, 2011

<mx:itemRenderer>
<mx:Component>
<mx:Canvas>

[code]......

View 2 Replies

Flex :: Toggling States - When Other Item Is Selected The First Item Does Not Change Its State?

Apr 26, 2011

I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,

if(itemIndex == 0)
this.currentState="selected";

this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,

<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">

My states are like this,

<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........

View 1 Replies

Actionscript 3 :: Trigger Flex Piechart Item Click Event When A Datagrid Item Is Clicked?

Nov 4, 2011

Is it possible to trigger Flex Piechart Item click event when a Datagrid Item is clicked.If so can anyone give some example.

View 3 Replies

ActionScript 2.0 :: [CS3] Rotating Using Mouse Coordinates

Mar 12, 2008

I'm trying to create a simple site that when you move the mouse to the right of the screen a movie clip rotates one way abt 45 degrees and moves the other way when the mouse moves to the left.

I'm trying to get the effect of a horizon line rotating to the mouses movement around the screen.

View 10 Replies

ActionScript 3.0 :: Mouse Coordinates In An If Statement?

Sep 29, 2011

how to put mouse coordinates into an if statement, but as an 'if more than' but also 'if less than'. Something like:

Code:
if (mouseX > 190, but also <210) {
//do something
}

Is it possible to also do a similar thing to also include the Y position, to create a box of some sorts based on mouse position?
Something like:

Code:
if (mouseX > 190, but also < 210, mouseY > 20, but also < 100) {
//do something
}

I think it may have something to with setting each position as a var and pushing them into an array, but I can't get my head around it.

View 4 Replies

IDE :: Longitude And Latitude Using Mouse Coordinates

Oct 24, 2003

I have a new project which requires getting the Longitude and Latitude coordinates on a world map. I have searched everywhere for either the code or a tutorial,

View 4 Replies

ActionScript 2.0 :: How To Move Mouse Over Coordinates

Jul 19, 2004

I am looking to create a menu similar to the one found here:All I need to know is how do you get the bar on this site the white rectangle) to go to a specific x-axis location on mouse over?

View 3 Replies

ActionScript 2.0 :: Mc Moving According On Mouse X And Y Coordinates?

Jul 1, 2004

trying to make a MC to change s x location according to the mouse position. Les say that the Mc moves to x=100 when the mouse_x is > 300 and y < 200. and moves back when the mouse goes back.

View 9 Replies

Put X And Y Coordinates Of Mouse In Two Variables But Only On A Click On Workspace?

Apr 6, 2009

How can I put the X and Y coordinates of the mouse in two variables, but only on a click on the workspace.

View 1 Replies

Professional :: Control Timleline With Mouse X Coordinates

Feb 1, 2010

how to create a movie with a sequence of pictures and controlling the timeline frames with mouse x-coordinates?

View 4 Replies

Professional :: Control Frames With Mouse X Coordinates?

Feb 1, 2010

I want to take a folder with 20 pictures, in some way convert them into a movie. And then apply so that I can navigate the frames one by one in the movieclip by moving the mouse right and left  (move mouse left - navigate backwards frame by frame, move mouse right - navigate forward frame by frame).

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved