Flex :: Getting The Global Coordinates Of A Component?

Dec 15, 2011

I have a texInput component,which is placed inside containers like following

<s:BorderContainer ...>
<mx:VBox ...>
<mx:HBox ...>

[code].....

View 1 Replies


Similar Posts:


Flex :: Getting The Global Coordinates Of The Visible Area Of A Component?

Oct 19, 2010

I am trying to determine the global coordinates of the visible rectangle that is currently rendered on the stage.

Specifically, if a canvas has an explicit height and width and is a child of a panel that has a scrollbar, the scrollbar can "hide" a part of the canvas. ContentToGlobal(x,y) provides the global position of the content at the time, but content coordinates can scroll off the boundaries of the parent panel and continue to give x,y coordinates that are not visible.

Is there a way to determine the viewable rectangle that is not hidden by anything?

View 2 Replies

Flex :: Getting The Global Coordinates Of A Component+flex?

Feb 20, 2012

I have a texInput component,which is placed inside containers like following

<s:BorderContainer ...>
<mx:VBox ...>
<mx:HBox ...>
<mx:TextInput ...>

[code]....

Now after initialization i want to get the location of my textInput with respect to Application.I tried with with localToGlobal(PointofLocalCoridnate), then it is not giving the correct location of textInput.

View 8 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 :: Get Global Coordinate Position Of A Component?

Aug 9, 2010

In flex, how to get global coordinate position of a component?

View 1 Replies

Flex :: How To Get X / Y Coordinates Of Caret Inside TextArea Component

Mar 4, 2011

I googled for almost a day to find the answer to my question: [URL]. This almost works (and is a great solution), but the solution doesn't work when I do:
1). Copy and paste multiple-line texts.
2). Write long and scroll the texts.
I also found another working example at: [URL]. (The autocomplete prompt appears when you press ctrl+space right at the caret's position). But an email from its author says he uses monotype fonts to calculate individual character's location. Is there a way to get multi-line input from a textfield?

View 1 Replies

Flex :: Bind To Global Variables Inside Component?

Aug 19, 2009

I've developed a component which is a combination of a few items (canvas, labels, etc...) but when I try to bind it to a variable such as: {stationXML.getItemAt(1).AAA.@value}, it doesnt work. Before I combined all the items in a component, they were all in the main MXML file at which time they worked. Not sure if it matters, but the "stationXML" arraycollection variable is declared inside the file "Station.as".

View 2 Replies

Actionscript 3.0 :: Matrix3d Local To Global Coordinates For Rotation?

Feb 4, 2010

I made a cube with as3. I wanted it to rotate in the Y Axis according to the horizontal mouse movement. It works nice when this is all I want. But if I try to also make it rotate on the X axis with the vertical mouse movement, things get screwy.

This happens because the transformations are added in the global coordinates, not the local ones. So, for Example, if I wanted the cube to rotate 30 degrees along its Y axis, I have to find a way to translate that into the global coordinates, and then apply that to the matrix3D of each face. I need a local to global translator.

[Code]...

View 1 Replies

ActionScript 3.0 :: Variable Of Nested MovieClips Global Coordinates

Apr 24, 2009

I have a MovieClip ("mc3" that moves dynamically) inside of a MovieClip ("mc2" that moves dynamically) that is on the stage ("stage" that is static). I need to find the value of mc3's x in relation to the stage? I need to make it into a variable. I am trying to do the math, can't figure it out. Also tried localToGlobal and failed.

View 5 Replies

ActionScript 3.0 :: Flash LocalToGlobal And GlobalToLocal - Get Value In Global Coordinates

Oct 27, 2010

I have a small problem with usage localToGlobal and than back to local. I can get global coordinate of my nested mc in question alright. Than i check if this coordinate + value of my mc.width is more than my stage width. I get to this part with no problem. Than if value is bigger (so mc is not on the stage i mean if part is off the stage i change value so it is stage width - mc.width). So i get value in global coordinates that i need. But how do i apply this to my nested clip is my question? For reference here is my code:

[Code]...

View 3 Replies

Flex :: 4 - Null-component - Checking If The Cancel Button Component In The Child Component?

Jun 23, 2011

I have a component "child" which has a cancel button. Now this component is placed in a state called "newChildComp" I also have another component called "parent". In the parent component, i have a button that dispatches an event. Here is the event code:

[Code].....

so, basically,i am checking to see if the cancel button component in the Child component, while i am still in the parent Compoent, was clicked, if it was clicked, call the cancelButtonHandler. The problem is by the time the addNewChild handles the event, that cancel button was still null. My question is how do i solve this without using the itemCreationPolicy on the cancel button?

View 1 Replies

ActionScript 2.0 :: Converts 3d Coordinates To 2d Coordinates - Difference Between MoveTo And LineTo?

May 21, 2007

I was reading the 'Isometric Transformations' tutorial by Danko Kozar and I have a few questions. I understand what all the code does, but not how it does it. First of all, how does the following code work:

transforms x,y,z coordinates into Flash x coordinate
xFla = function (x, y, z) {
// cartesian coordinates[code].....

I understand that it converts 3d coordinates to 2d coordinates, but I don't understand how. What numbers whould be punched into x, y, and z to acquire certain desired effects?Also, what's the difference between moveTo and lineTo:

red line
style(1, "0xFF0000", 100);
plot(0, 0, 0);
draw(200, 0, 0);

View 4 Replies

Professional :: Assign A Global Var To Each Global Filter Var To Determine If It Should Be Shown Or Not

Apr 2, 2010

I have some filters set up, and have assigned some global vars to them, which I then use in my Filters code to display the filters: myText:Filters [globals.data.glow1, globals.data.stroke1, globals.data.shad1] Works perfectly. Now I want to assign a global var to each global filter var to determine if it should be shown or not. So...

[Code]...

View 7 Replies

ActionScript 3.0 :: Converting Papervision Coordinates Into Cartesian 2D Coordinates?

May 3, 2010

Im making a little app in flash using papervision I want to make a regular movieClip show up in the same place as a papervision object. The coordinates seem like perspective is affecting the number displayed.

View 2 Replies

ActionScript 2.0 :: Make Global Functions Like Global Variables?

Apr 28, 2004

Is it possible to make global functions, much in the same way you make a global variable, reachable from anywhere in the project?

View 1 Replies

Actionscript 3 :: Flex - Using A Global Event Bus In Flex

Jan 18, 2011

I am using modules in flex, to build different parts of my webapp. What I need now, is a way these modules can communicate with each other on events. What really is happening is ,that there is a central module, which then will take care of loading other modules and passing data to and fro. But, coding for each part to delegate events to each of these loaded modules from the central module and back would be a big nightmare.

What I really want to do is have a global event bus for it. Are there any specific libraries, already existing for such a process. Also, I would be using MVC, so it should also take care between events form the model to the view and vice-a-versa.

View 3 Replies

Flex :: Make A Custom Component Or Extend The List Component For A 2D Top Down View MAP ?

Nov 11, 2010

I'm building a top view 2D map, that it's objects are stored on the server.The kind of objects are 10 and might be a photo, label, button, lists, mix of them or labels with tooltips.The component must request the "areas" that are missing on screen.An area is 1000x1000 px and is cached in flex.To move in the map, will be like in google maps (drag-and-drop).I should be able to have another list and move objects from one to another using drag-an-drop on objects. Ex.: I grab an objects from a list and I move it on this map, I release the mouse button and the item is placed there.Now the problem is: I build a custom component for this trying to emulate the item renderer for performance and recyclage, implement drag-and-drop on objects and request the areas that are missing?

or

I extend the List component from spark and I add some features as multiple kind of itemrenderers and use recycle on them. Of course it must be able to request the missing areas on the screen and cache it's data.Maybe create a custom layout is needed too.What I need is something that must be really fluid, so the lighter this component is, the better.

UPDATE: *There will be not any object over another.

*I will not use hitTest on bitmaps because all bitmaps are wrapped in another component,as they,for now are itemrenderers.

Anyway I already begin to do this using a class that extends the SkinnableDataContainer and a custom layout. As the layout is not like a grid, is sparse, random items at diferent points(x, y).How to get the localX and localY, relative to item renderer and not to the Spark List, from a DragEvent in Flex 4?

View 1 Replies

Actionscript 3 :: Flex - Access Component Inside Another Component In MXML?

Sep 3, 2009

I have two components. One is called "InsideComp" and one is called "OutsideComp". OutsideComp has InsideComp as one piece of its component, and in my main MXML file, I have embedded an instance of OutsideComp. How do I access a public variable of InsideComp within my main MXML file?In Actionscript, I could just do something like:OutsideComp.InsideComp.valToChange = 5; But I dont know how to do it in MXML. I know this is probably an easy question.

View 4 Replies

Flex :: Access The One Component Properties Form Other Component With Out Binding?

Sep 21, 2011

I would like to bind two components with out binding and which resides in different MXML.for eg: A.mxml has textinput and B.mxml has a combobox when choose one item in B.mxml selected item should be display in A.mxml textinput.

View 2 Replies

Global Security Manager In Flex?

May 31, 2010

I made a swf that interacts with other site on the internet (which has a crossdomainfile for me).in the main.mxml there is a definition of webservice (mx:WebService)(which is not in my domain). Therefore when loading the swf, there is a first call to crossdomainfile.xml.I put this swf on my server so that my clients can get it.

When i connect to my server to download the swf, i expect to be asked if i want to allow the swf connect to foreign webservice domain.Do i always need to define exception in Global Security Settings panel?I don't want my client do define special things..Is there a best practice for that? Why when i surfing the net other swf can do this? I read about the FlashPlayerTrust, can i define there a website i trust my swf will connect to?

View 3 Replies

Flex :: Use Global Application States?

Mar 8, 2011

I am trying to use global application states to manage roles in my application. How can I use <properties.state> everywhere in my application if I declare it in my top level application?

View 1 Replies

ActionScript 2.0 :: CS3 Global Variable Not Being Global

Jul 22, 2009

i defined the global variable in the first frame of my file, and i can access it on other frames, however i am trying to access it within a movieclip, and flash is telling me that it is undefined. does anyone know why this could be?

View 1 Replies

Flex :: Access Component Properties From Extending Component

Jul 29, 2011

I have a component with a public variable declared

[Bindable]
public var mnuSource:String;

When I extend this component, I can reference mnuSource (it compiles) but Runtime complains about the property not being accessible (error 1056).

How do you modify / declare component properties so they are actually available to other components?

View 2 Replies

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

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 :: Why StartDrag() And StopDrag() Don't Effect The X - Y Coordinates

Mar 11, 2010

when I use startDrag() and stopDrag() to drag an object why doesn't it effect the x,y coordinates of the object? you can run this example and see for yourself (move the circle and look at the trace messages):

[Code]....

View 3 Replies

Flex :: Sprites Are All Draws From X - Y Coordinates That Receive From XML

Jun 2, 2010

The orange square is the currently selected selected sprite. The sprites are all draws from coordinates that i receive from XML. var sprObject:Sprite = new Sprite();

[Code]...

What I want to do is the following. If I'm currently on the orange square and I use my keyboard direction buttons (up/down/left/right). I want to deselect the current sprite and select the next sprite in the appropriate direction. The problem I'm having is that I cannot get the x and y coordinates of the drawn sprites. If I look in the array, the x and y coordinates of the sprites are all 0. If I can retrieve that I can write an algorithm to determine the next sprite to select.

View 1 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

Php :: Get The Correct Coordinates Of Text From That Flex Editor?

Mar 1, 2012

We have an image editor in Flex to add text and other changes. Once all the changes are complete, we need to save this to the server.We are using php to save the images by accepting coordinates from flex about what all edits are made for that image. Using this we are editing that image using imagick function in PHP. But the problem is output is different from what we see in flex. The issue is mainly with text alignment in flex editor and in the output we get after editing in php.Is there any other way to do this without making the user to wait for a long time to save the images? Is it possible to get the correct coordinates of text from that flex editor. Our issue is flex is passing the x,y of the container of that text editor. For this reason, test is misaligned in the output.

View 1 Replies

Flex :: 4 - Is There A Way To Have Global 4 States (user Roles)

Sep 16, 2010

I am having an issue with flex states in my application. What I am looking to do is on creation complete of the application, obtain a user role guest/user/superUser (based on username and password) from a server, then set the state client side based on that information. My .mxml classes need to include certain graphic elements based on that state. I am running into the issues of including elements based on the states defined at the Application level of the project. I am trying to avoid having to define the states in each .mxml file that needs it.

[Code]...

View 1 Replies







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