Flex :: Get The Real Objects Width?

May 3, 2010

when I check the width of my objects I always get 0. Here is an example:

newTag = new LinkButton();
newTag.label = dataManager.tagViewTimelineModel.tags.getItemAt(i).name;
newTag.setStyle("color","#FFA500");[code]....

I guess because width is a property I can set, but it is not automatically computed by Flex. How can I know how big are my objects (as conseguence of the included text ?)

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Real Width And Height Of A MC?

Aug 10, 2010

Lets say that I have a MC called "myMovieClip", and in it there is a: Layer 1: 100px X 100px square Layer 2: 200px radius circle And Layer 1 is set as a mask for Layer 2. Is there a simple way to get the dimensions of the visible elements of the mask effect, and not the bounds of all of the elements in "myMovieClip"?

View 2 Replies

ActionScript 3.0 :: Getting The Real Movie Width From The Stage?

Feb 3, 2009

I need to get some parameters of a movie adding an as3 code to the beginning. As the code will be inserted in many movies, I need it to be 'general' without any reference to the names of the clipsIn particular, I need to retrieve mouse coordinates and the real movie width. For real movie width I mean the width to whom are referred the mouse event stageX and stageY.For example in this movie http:[url]... the width I'm talking about is the white frame. In fact if you use

ActionScript Code:
stage.addEventListenere(MouseEvent.CLICK,func);
function foo(e:MouseEvent):void[code]....

to get coordinates onclick and you click on the top-left corner of the white layer you'll get 0-0 or similar values.I tried to get that relative width using

ActionScript Code:
stage.stageWidth

but this returns me just the object width (so 100% of my page in the previous example) while I need only the white part width.how can I do this without using any name and referring just to the stage of my scene?

View 4 Replies

ActionScript 2.0 :: Get The Real X And Y Positions Of An Object In The Real Movie?

Jan 19, 2005

im just wondering if theres a way to get the real x and y positions of an object in the real movie ( the root screen) that is locted in another movie

i have an object which is within 2 movie clips, first one and then another , and then my object, now i want to know what the real x and y positions of it is, not the locations realtive to the movieclip it is inside.

View 5 Replies

Actionscript 3 :: Finding The Width Of TileList - Scrollbar Width Flex

Feb 3, 2010

I've got a TileList with verticalScrollPolicy="on".

Is there a property that returns the width of the tileList minus the width of the scrollbar?

View 1 Replies

Flex :: Setting Button Width To Text Width?

Mar 28, 2010

I am creating a nav in flex that pulls in buttons dynamically from xml. THe problem i am having is setting the button width to the text width. currently the buttons are all the same width and if the text is larger then it just cuts off. I've tried a few ways of doing this:Setting button width to 100%On creation of the button try to set the width of the button to the text programmatically. Something like evt.target.width = evt.target.textWidth;

View 1 Replies

Actionscript :: LoaderInfo.width != Stage.width In Flex 3.5?

Nov 21, 2011

Running into strange behaviour with flex 3.5. Here is a minimal code:build.xml target:

<target name="player">
<mxmlc
file="${APP_ROOT}/player.mxml"

[code].....

View 1 Replies

ActionScript 3.0 :: Trace An Objects Width?

Nov 11, 2010

This is an easy question but don't understand why this isn't working. I'm trying to trace the width property of a shape object. do i have to convert it to a number?

[Code]...

View 2 Replies

PHP :: Flex - Output Of C File In Real Time?

Oct 31, 2009

I have a C executable (named myprogram). When I run it by ./myprogram I get some output statements on the standard output of my Linux shell. I used run.php to get access to whatever is being printed to the standard output:

#run.php
<?php
$output = shell_exec('./myprogram');
echo $output;
?>

Then I called an HTTPService having id="service" to access this run.php file and I also set the text attribute of a TextArea to {service.lastResult}. When I run my Flex app, the interface kind of halts for a moment and then the TextArea displays all the 20 lines at once. But if program is run from Linux shell they appear one by one. Is there a way by which I can display a line as soon as it gets printed to standard output? This will then make the TextArea show the output in real time.

Or is Flex unable to do this? Rather how can a PHP program achieve such effect i.e. showing, whatever is being printed on standard output, concurrently in the browser in real time? Myprogram outputs 20 lines each after some microseconds. I want only the first line of standard output to appear in TextArea of Flex or in the browser (but in real time) while the program may then continue running the program.

View 3 Replies

Actionscript 3 :: A Real DrawText Call In Flex?

Dec 22, 2009

I am now developing a Flex application in which I need to control each pixel of my control of Flex. I want to calculate that how width and how height of some text used in my control and do some layout stuff.After some searching I find that the only way to draw text in Flex is to use something like TextField. So, I use TextField to display text and try to get the width and height of the text through:

textfiled.getLineMetrics(0).width/.height;

But the real textfield is much more bigger than this, so I do:

textfield.width = textfiled.getLineMetrics(0).width;
textfield.height = textfiled.getLineMetrics(0).height;

But, the textfield get part not displayed, and I am surprised by this effect. I know there should be a 2-pixel gutter around the text, but what the remain space? Why nearly 20% part of the text height/width are not displayed?

how can I get a real drawText call in Flex, I mean something like Windows's drawText method...

View 2 Replies

Flex :: Who Uses IntelliJ For Real Commercial Projects

Jul 6, 2010

Just a simple question: Would you prefer IntelliJ? If so, what are the Pro- and Cons?

View 2 Replies

Php :: Real-Time Communication Between Flex Application?

Nov 19, 2010

I have a Flex/AIR application communicating with a PHP server application. Recently my client requested real-time-like connectivity between the applications to replace what we currently have; refresh buttons which have to be clicked to refresh data.So effectively the server needs to push data to the client when something changes. I can write the code that detects when something changes, but I'm not sure about the push side of things.

View 4 Replies

ActionScript 3.0 :: Setting Objects Width While Rotating?

Mar 24, 2010

I'm working on putting together a game at the moment which is similar in many ways to mini golf (or crazy golf, depending on where you come from). It is shown from a side-on view and to play the user must select the ball by holding the mouse down over it, then drag the mouse to indicate the direction they wish to fire the ball in. The distance they drag the mouse (this is capped obviously) determines the power of their shot.
 
I am currently using a triangular object with the tip placed at the centre of the ball to show to the user the direction they have chosen. This triangle rotates to face the position of the mouse, and I'm trying to get it to extend/shorten based on the distance from the mouse to the ball. I have code in place (below) that works when the mouse is either to the left or right of the ball, but behaves rather strangely when the mouse is above or below the ball. When the mouse is in either of the latter locations, the triangle extends to be far bigger than the maximum length allowed by the program, yet a trace shows it is still within acceptable limits! I'm almost beginning to think that Flash is switching the 'width' and 'length' attributes around when the object is rotated by either 90 or -90 degrees!
 
The code I am using is:

[Code]....
 
Here's a couple of screenshots of the game as it currently stands too - please don't laugh at the horrible placeholder art: none of it is final haha (also note that I haven't implemented 'gravity' yet, so everything is sort of hovering in mid-air.) The first image shows the code working as I want it to with the triangle at it's max width, the second shows the triangle going 'huge.'

View 6 Replies

Actionscript 3 :: Limit Objects To Stage Width?

Nov 27, 2011

I want to limit the creation of objects acording to the stage width.

My method is the following:

for (var i:int = 0; i<7; i++){

If I put something like this, it won't work

for (var i:int = 0; i<(stage.width); i++){

Full code:

[SWF(width = 350, height = 600, frameRate = 60)]
import com.actionsnippet.qbox.*;
var sim:QuickBox2D = new QuickBox2D(this);

[Code].....

View 1 Replies

Flex :: View States Used In Real-World Projects?

Sep 3, 2009

I've just found out about View States in Flex (v3.0), but I am not really sure how widely this is used in real-world applications. Is it a good practice to use it? Are there any pitfalls such as maintainability for instance?

View 3 Replies

Make Real-time Connection Java And Flex?

Jun 10, 2011

I'm still new at Flex. I want to make a flex code that request data to server everytime. I use java as a server. i have successfully generate a linked-list of data at server from asterisk cli command. like this

[Code]....

View 2 Replies

Android :: Flex - App For Visualizing Real Time Data?

Mar 26, 2012

I want to build an android application that visualize some real time data , to get the position of objects and update it in real time and give me a simple animation . studied OpenGL ES for couple of days but it seems quite complicated but I dont think it fits to my needs

View 1 Replies

ActionScript 2.0 :: Distorted Objects - Modifying Width / Height

Oct 23, 2005

I have a problem where Flash takes it upon itself to modify the width/height x/y values I set objects (MC's) to, usually by less than a pixel. I don't get that.. and wouldn't that mess some things up like when I'm increasing the size of an mc someodd 300 times its original size, then that 0.2 pixel Flash adds in white space could become 50 pixels. Also, when I change the size of x MC, some other MC's will change their size. I can tell because the other MC's are about 1 pixel apart and when I change x MC that pixel is filled in sort of. I noticed some decrease in these problems when I was using whole numbers and x/y values, but it hasn't stopped it completely. I can give an example swf if necessary.

View 3 Replies

Actionscript 3 :: Dynamic/Real-Time Update Using 2 Different States In Flex Project?

Sep 16, 2010

I am trying to update a visual component giving some information in 1st state, while I make changes in the 2nd State...Question : Is it possible ? If yes, then is just data binding the solution? how ?!

Clearer Description :

State 1 : Has a form, in which I enter some data value for 3 boxes.

State 2 : Has 3 boxes, who have to change in color based on what values were entered in State 1.

Purpose : User 1 will enter data in with State 1 open, while User 2 should be able to see the dynamic/real-time effect while he is in State 2.

View 1 Replies

Actionscript 3 :: Reset A Flex Label Width To "auto" After Setting An Explicit Width?

Oct 12, 2009

Once I've set either the width or percentWidth property on a flex label, is there a way to reset the width to its default (i.e., the width of the text plus padding)? I'm using the label as a renderer. In some cases, I'd like it to automatically size to the text, and in other cases, I'd like it to be a percentage width of its container. Obviously, I could use two separate labels, one for each of the above cases, but I'm curious if it's possible to reset the label to its default behavior.

View 2 Replies

Flex :: Layout - Vbox Child Elements To Take 100% Of Width Without Indicating Width="100%"

Sep 12, 2009

is it possible to make the child elements of a vbox to occupy 100% of the width without indicating width=100% for each element ?

View 3 Replies

ActionScript 1/2 :: Attach Two Objects (movieclips) With Different Width And Height Properties Into The Stage, With Random Positions

Aug 27, 2009

how to attach two objects (movieclips), with different width and height properties into the stage, with random positions,without visual colliding.

View 6 Replies

Flex :: Objects Drawn By Flash Graphics Class Exist As Objects?

Jan 16, 2011

Internally Flash obviously keeps a list of the primitives drawn using Graphics so I wondered if you have many such primitives in a Sprite, can you re-position/remove/alter individual items rather than clear and re-draw everything? Or is this deeper into the bowels of Flash than you're allowed (or recommended) to go?

View 4 Replies

Php - Flex Is Deserializing Generic Objects From Zend AMF Instead Of Strictly Typed Objects

Mar 4, 2012

I'm using Zend AMF to send my remote objects to Flex. I've defined a Constant class and created getASClassName() method. Then I've created Action script class in flex.

Objects are send successfully, but they are deserialized to generic Objects in Flex instead of specific ones. EDIT: On network monitor in Flex I can see that AMF value is set to com.my.project.valueobjects.Constant. Although array from event.result contains Objects.

[Code]...

View 1 Replies

Flex :: Converting Array Of ObjectProxy Objects To Custom Objects?

Jun 10, 2011

I have a service which returns an Array of ObjectProxy objects. I would like to cast this to a custom object (a value object) and create an ArrayCollection. How can I do this?ited:I am using Django and PyAMF for the backend. I had to write a custom SQL query and I am wrapping the resulting records in ObjectProxy and sending the whole result as an ArrayCollection.Here is my client side code:

[ArrayElementType("SessionVO")]
[Bindable]
private var _list:ArrayCollection;

[code]....

View 2 Replies

Java :: Why Value Objects Coming Back As Generic Flex Objects

Aug 4, 2011

I will try to give as much detail as I can. I am creating an CRM application using Flex(Cairngorm 2)/Java/Hibernate. The basic problem I am having is this: I have a Customer class in Java that has an ArrayList of Address classes. I have a Customer class in Flex that has an ArrayCollection of Address classes. When I make the remote object call for a Customer I get back a Customer object in Flex, but the ArrayCollecion objects have a data type of Object instead of Address. If I try to call for a List of Address classes I get the same result. If I try to call for a List of Customer classes I get a list of Customer classes in Flex. Using tomcat 6 with the following jars:

[Code]...

View 1 Replies

Flex :: Flex - This.width Within A Class Always Returns The Same Value

Feb 13, 2010

Within my AS3 class I am calling this.width, and the value it returns is always 1, even though this is impossible given the contents of the object.

Is this a standard behavior for AS3?

Simple version of class is posted below. It is attached to a MovieClip symbol that just contains a simple hexagon.

package {

import flash.display.*;
import flash.utils.*;
import flash.events.*;

public class Hexagon extends MovieClip
{
var startWidth:Number;
var startHeight:Number;

public function Hexagon()
{
var myTimer:Timer = new Timer(2000);
myTimer.addEventListener(TimerEvent.TIMER, timerFunction);
myTimer.start();

startWidth = this.width;
startHeight = this.height;

trace("startWidth:" + " " + startWidth);
trace("startHeight:" + " " + startHeight);
}

function timerFunction (evt:TimerEvent):void
{

}
}
}

View 1 Replies

Flex :: 4 - Specify Height And Width Of Flex Alert Box In Css?

Apr 18, 2011

In my Flex 4 app I would like all my alert boxes to be a specific width and height, how do I specify that in the CSS? I want to avoid having to specify the width and height every time I want to show an alert, that's why I'd like to set it in the CSS, but does not look like there's a way to.. Something like this does not work:

mx|Alert
{
height: 100;
width: 300;
}

View 3 Replies

Flex :: Set Y-axis Width On A Flex Chart?

Jun 28, 2011

When using a Flex chart, the y-axis is drawn as a thick (about 8px) grey line. Is it possible to change this to be just a thin line like the x-axis?

View 1 Replies

Actionscript 3 :: Canvas Total Width (visible Width + Hidden Scrollable Part)?

Apr 19, 2010

It's probably a no brainer, but I've spent the last 40 minutes or so looking for it to no avial.

I have a Canvas control with a fixed width and a horizontal scrollbar.I'm trying to find the actual width of the control.The .width (fixed width) + the part being revealed by the scrollbar.I tried explicitWidth, width + maxHorizontalScrollPosition, and some other combos but non of them hit the spot.

View 1 Replies







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