Flex :: Mystery Coordinate Offset On GetCharBoundaries?

Jun 19, 2009

I've ran into a weird problem with getCharBoundaries, I could not figure out what coordinate space the coordinates returned from the function was in. What ever I tried I could not get it to match up with what I expected. So I made a new project and and added simple code to highlight the last charater in a textfield, and all of a sudden it worked fine. I then tried to copy over the TextField that had been causing me problems, into the new project. And now the same weird offset appeared 50px on the x axis.Everything else was spot on. So after some headscracthing comparing the two TextFields, I simply can not see a difference in their properties or transformation.

So I was hoping that someone might now what property might affect the coordinates returned by getCharBoundaries.

View 4 Replies


Similar Posts:


Javascript :: Get The Absolute X And Y Coordinate Including HTML Offset?

Feb 18, 2010

I am calling a JS function through the ExternalInterface using Flex which requires the absolute X and Y coordinates to create a pop-up menu. The Flex application is displayed on the center of an HTML page, therefore there is an HTML X and Y offset to consider.

I have tried using the LocalToGlobal and ContentToGlobal functions, but these are just giving me the X and Y coordinates relative to the Flex application, it is not considering the HTML X and Y offset of having the Flex app in the center of the page or varying different screen resolutions.

Is the best approach to retrieve the HTML X and Y offset using JavaScript? Is there a Flex function I can use that provides the absolute X and Y coordinates based on the HTML page?

View 2 Replies

Flex :: Handling Timezone Offset?

Jun 28, 2011

I've developed an FLEX application for distributed data administration. When our Asian employees specify a date, it will be saved +1 day.If I check my timezone offset it is +60, their offset is +520.

var dNow:Date = new Date();
trace("Your time zone offset: " + dNow.getTimezoneOffset() + " minutes");

I assume this is the problem? If so, would you suggest that I correct the entered date by 460 minutes before sending it to our server for saving? How to do that?

View 2 Replies

Actionscript 3 :: Find Coordinate Of Child In Its Parent's Coordinate System?

Mar 31, 2010

I have 3 square. smallest square s3 is inside s2. s2 is in side s1. each is 10px larger [code]how can I find the coordinate of child in its parent's coordinate system?

View 1 Replies

Actionscript 3 :: Flex TileList Start Offset And Click Handler?

Oct 23, 2009

I have some images I would like to display in TileList in Flex. My TileList dimensions are 2 columns by n rows. What I want to do is to display the first item (row 1, column 1) empty and not clickable, and to start displaying my items from row 1, column 2.I also wonder when I create click event for the same TileList, is there a way get an index of clicked element?

View 1 Replies

Actionscript 3 :: Cascade Pop Up Windows (i.e. Offset The X And Y Position) In A Flex Application?

Dec 2, 2010

I have a simple Flex (Flash Builder) application which pops up a new window when a user clicks on a map. The user can make subsequent clicks on the map to have additional pop up windows appear, each of which currently pop up on top of the initial/previous pop up window(s) (i.e. at the same X and Y position). I want to modify the application in such a way that each new pop up window will be rendered slightly offset from the previous pop up window. A coworker has suggested I try to find a way to leverage existing window cascading functionality in Flex, but so far I've not found anything which can manage this for you. Is there such a solution cooked into Flex already, or should I roll my own by calculating the new pop up window's X and Y position based on the last pop up window's X and Y position?

View 1 Replies

ActionScript 2.0 :: Solve The Disappearing Olive Mystery?

Jan 11, 2010

In Firefox, when I select any page other than Home I lose the damned olive?

ActionScript Code:
import com.greensock.*;
import com.greensock.easing.*;
if (_root.page == "h1") {

[Code]...

View 4 Replies

ActionScript 3.0 :: Loading Images From Within Class - Alpha Mystery

Jul 22, 2011

I've got something very strange happening with the alpha of some loaded pictures. I load 27 images dynamically from within a class:

PHP Code:
package{
import flash.display.*;
import flash.net.URLRequest;
import flash.events.*;
public class Portrait extends Sprite{
[Code] .....

However the first 4 portraits won't change alpha to a float number, I can only set the alpha to 1.
Code:
test_portrait = new Portrait(i, 0.8, (film_width/2)-(240), white_bg_square.y);
Results in a blank screen for the first 4 portraits... All the other portraits change transparency fine. There's nothing wrong with the loaded pictures because I swapped 1 for 10 and the problem remained while image 10 in an other position changes alpha just fine.

View 5 Replies

Copy X And Y Coordinate From One Flex Component To Another?

Mar 17, 2010

I would like to base one component's x and y cooridnates according to another, I tried using the binding notation but it doesn't seem to work

[Code]...

View 1 Replies

How Do Flex Developers Coordinate With Designers

Oct 18, 2010

I've usually designed Flex applications myself but this time I'll need a designer to assist with skinning the application. I've worked with this designer for a while, and we could work well on an HTML/CSS environment. He can't code, he sends me sliced PSDs which I could convert to clean code. But I'm not sure how to have him assist me with Flex UI as he's not familiar with the components.How do you guys interface with designers for your applications?

View 2 Replies

ActionScript 3.0 :: GetCharBoundaries And HtmlText?

Jul 21, 2010

I am having an issue using getCharBoundaries() with htmlText.  In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line.  getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not).  I've read that getCharBoundaries() can be unpredictable; does anyone know of a workaround or why this might be happening? 

[Code]...

View 3 Replies

Actionscript 3 :: Getting From GetCharBoundaries To BitMapData?

Nov 2, 2010

I'm trying to convert all letters in a textfield to bitmap data. I then want to animate each of them. I'm able to return an array of rectangles using getCharBoundaries. But then how do I convert each letter to BitMapData?

package
{
import flash.display.Sprite;
import flash.geom.Rectangle;
import flash.text.TextField;

[Code].....

View 1 Replies

ActionScript 3.0 :: Using GetCharBoundaries() With HtmlText

Jul 21, 2010

I am having an issue using getCharBoundaries() with htmlText. In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line. getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not). I've read that getCharBoundaries() can be unpredictable; I've attached the code as a txt file. Update: Even if I try calling getCharBoundaries on a character a few positions before the img tag, so that it's an actual character and not markup, I still get a null value returned.

View 1 Replies

ActionScript 3.0 :: HtmlText And GetCharBoundaries?

Jul 21, 2010

I am having an issue using getCharBoundaries() with htmlText. In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line. getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not). I've read that getCharBoundaries() can be unpredictable; does anyone know of a workaround or why this might be happening?

Even if I try calling getCharBoundaries on a character a few positions before the img tag, so that it's an actual character and not markup, I still get a null value returned.

[Code]...

View 1 Replies

Professional :: BitmapData / GetPixel Mystery - Works Perfectly On Local, Failing When Uploaded?

Dec 13, 2010

I'm working with a video in Flash where I am capturing each frame and testing the color of a single pixel. I'm using it to determine when a white/transparent background changes to be a color. The following AS2 code works flawlessly when I preview it in Flash and on my desktop in the browser (the direct SWF and placed inside HTML using SWFObject) but as soon as I upload it to my server it fails and produces "FFFFFF" continuously regardless.

this.onEnterFrame = function()[code]..........

There is no difference in the files; they are both pulling from the same video source (hosted on an Flash FLV server).The only difference is one set of files is hosted on my local computer and the other is hosted on my web server.

View 2 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 :: Get Global Y Coordinate Of Datagrid Selecteditem?

Aug 5, 2011

Here's the situation: I have a populated datagrid and I want to move a form to be inline (same y position) with the datagrid's selectedItem. I cannot rely on a mouseClick event because the selected item may change with a keyboard event. The datagrid does not have an itemRenderer, just plain old dataField.Anyone done this before?

Here's some stubbed out example code for all those interested based on Jacob's answer.

[Code]...

View 3 Replies

Professional :: GetCharBoundaries Returns Null?

Mar 2, 2011

trying to cut text field to single letters and then do some animations on each letter. But, how do I know where to place (position) the letters? I tried using getCharBoundaries but once it reaches 3rd line, it keeps returning null values. Anybody knows why that happens

View 3 Replies

ActionScript 3.0 :: GetCharBoundaries & Scrolling Textfields?

Nov 20, 2011

I want to get the the boundaries of a character in a textfield relative to the stage. The problem is that getCharBoundaries seems to return the coordinates not relative to the TextFields origin, but relative to the text origin (which may be somewhere outside of the textfield if the textfield is scrolling).

I don't know how to get the actual origin of the text (even if it's not visible within the textfield due to scrolling) so that I can calculate the actual stage coordinates of the character.[URL]...

View 1 Replies

Flex :: Onmouseclick - Global Coordinate Value On Mouse Click

Jul 22, 2010

I am using event.event.localX to get the x-axis but it is with reference to local coordinates. How can I get or pass the value of the HBox's xAxis that is clicked by the user so that I can add it in the xAxis of the local coordinate. In other words, I need the global coordinate value? (i.e. x-axis & y-axis)

View 1 Replies

Flex :: Keep Track Of All The Changes Of Coordinate System Origin When Writing Components?

Dec 23, 2010

I am faced with a dilemma. I am writing components with nested components. What sort of coordinate system scheme should I implement? I want to be able to pass points to the components without having to worry about where the origin is in absolute terms. At the same time, I want to have some sort of encapsulation when it comes to origins and stuff. Is there any sort of guideline to follow when it comes to nested components and such?

View 1 Replies

Flex :: Move Coordinate Position Of Flash Download Progress Bar?

Oct 12, 2011

I am extending the Flash DownloadProgressBar component for use as a preloader with Flex. Is it possible to override the x and y coordinate position of the progress bar? (the default is to center the bar)

View 1 Replies

IDE :: GetCharBoundaries Returns Incorrect Values When Parent Of TextField Is Rotated In 3D

May 16, 2009

I'm just trying to make a sprite follow the last letter of a TextField with the getCharBoundaries() function. It works fine when the DisplayObject that contains the TextField has no 3d transformations on it. But when I rotate it in 3D, returned values are wrong and it doesn't work anymore.I don't know anything about the matrix objects and all those transformation functions but I guess there is a way to get the correct value by using one of those matrices.I tried to use some matrices and played with some of their values but didn't get any luck.

View 1 Replies

ActionScript 3.0 :: GetCharBoundaries Method Of A TextField Doesn't Return The Correct Rectangle

Dec 30, 2009

I have a problem with the getCharBoundaries method of a textField, it doesn't return the correct rectangle for me. To show the problem I put a long text in a textfield and highlighted the rectangle returned by getCharBoundaries for every second character. Here is my code:

[Code]...

View 5 Replies

ActionScript 2.0 :: "Right-clicking-text" Mystery?

Feb 28, 2006

this makes me sooo confused! I use this code:

Code:
krisse_cm = new ContextMenu();
krisse_cm.hideBuiltInItems();

[code].....

View 2 Replies

Flex :: Set Bottom-left Coordinate Of Component Instead Of The Top-left?

May 12, 2010

I've some components with dynamic heights. They have to be aligned with respect to the bottom of my canvas container, so I cannot set the same y for all components.

I could compute their heights and successively set the y but I was wondering if there was an easier way to do it.

View 2 Replies

ActionScript 3.0 :: Ludicrous HtmlText Offset?

Aug 4, 2009

so I'm working on an app requiring me to lay some simple HTML as multicolumn text, and hacking around w/ g.skinner's old regexp method of reflowing as3 TextFields. I'll be happy to share this code if I can get it working. No desire to get into screwing with text.engine at this point, and this has to be back compatible to FP9 anyway.

So I'm back-and-forth parsing from likely break points to determine if we're in a tag here, and jump ahead to the end of it if we are. The ridiculous issue I'm up against is simply that there doesn't seem to be a TextField method for getting the htmlText offset -- NOT the visible text offset -- of a character. Is there a way to do that?

View 12 Replies

Actionscript 3 :: Finding The Offset Of A Block?

Jan 2, 2011

I am trying to make a pong like game but i need to find the offset from the center of the paddle so that i can make it bounce differently depending on where it hits the paddle. How can i achieve this?

View 1 Replies

Actionscript 3 :: Strange Offset In Flash?

Dec 14, 2011

I need to check (for my own good reasons) whether the cursor is located within the bounds of a particular object. I'm using a simple code to do this...

if(mouseX > hsSlot1.x && mouseX < (hsSlot1.x + hsSlot1.width) && mouseY > hsSlot1.y && mouseY < (hsSlot1.y + hsSlot1.height))
{
//My code
}

This, theoretically, should work perfectly! However, there is an offset (and one I did NOT set, mind you!) of about 16 between the hsSlot1's visual position (where it appears to start on the screen) and hsSlot1.x. There is a similar offset on the y axis, but I haven't measured it yet.The only thing I can think of for this is that hsSlot1 is an instance of a button (one with only one state at that) that was scaled to fit. However, I don't think that is it, because the numbers show that the entire object is merely offset at its current size.

View 2 Replies

ActionScript 3.0 :: A Gradual Offset Of A MC (using Loops)?

Jun 14, 2010

im trying to actionscript a simple animation where a combination of MC's move towards areas on the screen triggred by mouse events.What would be the best way of gradually ofsetting a MC, with the control to stop them with further mouse events.I have used tweens (example below) but i need to be able to stop them mid tween, i have tried using if statement to stop the clip but i cant seem to overide the tween.I have limited experience but im guessing a time based loop that i could supply an if statement withbooleons would be my answer. Are time loops possible with actionscript 3.(my thinking is(mouse event. start time based loop -offseting MC- Mouse Event 2 stops loop with if. )

tween example i used
(function moveToLeft(event:MouseEvent):void {
xMovement = new Tween(walkMC, "x", None.easeOut, walkMC.x, mouseX, 8, true); )

ive found the timer class, i should be able to make summit work with this

View 3 Replies







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