Get Width Of My LinkButton Object?
Apr 18, 2010How can I get the width of my LinkButton object ?[code]...
View 1 RepliesHow can I get the width of my LinkButton object ?[code]...
View 1 RepliesI am trying to do a apply a tween for the width property on a MovieClip Object but every time it changes the width and the position too, and I don't want that. I want to change the width going to one side without changing the x and y of the object.
I tried both of thes and they gave the same result.
var c:Tween = new Tween(left, "scaleX", Strong.easeOut, 1, 1.5,20,true);
var c:Tween = new Tween(left, "width", Strong.easeOut, 20, 200,20,true);
I think it is applying the transformation according to a center of the movie clip. but I don't know how it can be changed.
If I create a rectangle with 100px width and 100px height and then rotate it, the size of the element's "box" will have increased.With 45 rotation, the size becomes about 143x143 (from 100x100).Doing sometimes like cos(angleRad) * currentWidth seems to work for 45 rotation, but for other bigger angles it doesn't.At the moment I am doing this:
var currentRotation = object.rotation;
object.rotation = 0;
var normalizedWidth = object.width;
[code].....
I'm trying to create a button that will simply link back to the context root. I noticed flex has a @ContextRoot attribute that appears to work only in certain cases. For example, if I try to use it in the following mxml:
<mx:Button label="Back to Root" click="navigateToURL(new URLRequest(@ContextRoot()), '_parent')"/>
I get the following error: Error: Attributes are not callable.
when i doubleclick on the linkbutton its still working i dont know even though i have made linkbutton doubleclickenabled property =false too.
View 1 RepliesI would like to enable the (Open in a new tab) option when a user right clicks a mx:LinkButton, take the address that linkbutton is supposed to go to and allow the user to click on (open in a new tab) and get to that address in a new tab. Is there an easy way to do that.
View 1 Repliesi am using this code
Code:
<mx:DataGridColumn id="test" headerText="Case ID" width="80">
<mx:itemRenderer>
<fx:Component>
[code]....
how can i access linkCaseId outside the datagrid ?
We are creating a LinkButton programmatically and would like to set it's icon to an image retrieved from the remote server rather than something embedded within the SWF. The .icon property expects a Class but I can't figure out how to create one equivalent to an @Embed but from a dynamically generated URLRequest or URL String.[code]...
View 5 RepliesIs it possible to make a LinkButton selectable? That is, the text from the LinkButton can be selected and then copied. LinkButton does not have the selectable property.
View 1 Repliesi am using below code for using linkbutton in flex datagrid
<mx:DataGridColumn headerText="Case ID" width="80">
<mx:itemRenderer>
<fx:Component>
[Code]...
now on link button click i want linkbutton label name and selected row inside lnkCaseIdClick method, how can i do this?
I am using this [code]...
How can I access lnkCaseId outside the datagrid?
I am feeding the label to my LinkButton directly from a string I receive from a Google API that puts html to format the label.
I want to extend linkbutton to allow this. I wrote a class myself to allow html text for the label and that aspect of it works but now the background that appears when you hover is way too big. I tried to override measure() to fix this but I didn't have a clue how. Here is the class I wrote:
package com.kranichs.components
{
import mx.controls.LinkButton;
public class HTMLLinkButton extends LinkButton
[Code].....
is there a way to span the text of a link button to 2 lines? so instead of "Save Page" to be in one line only, I want it to be in 2 lines.
View 1 Repliespackage {
import mx.controls.LinkButton;
import flash.text.TextLineMetrics;[code]....
my issue here is if you use this component you will see that the text is bunched up into a very small area. It does not fill the entire width of the linkButton.
There are styles for over and clicked but no up state.
View 1 RepliesI want a LinkButton's style to stay unchanged when the mouse hovers over it. (But I still want the tooltip to work.) How do I do this?
(The mouseOver event seems relevant, and I do a noop() on that event, but my goal is to leave the style unchanged rather than do something specific.)
By the way, I am using a non-default style, defining it with CSS in the MXML.
In my application one Datagrid and down one Canvas is there.
I have a DataGrid with Data. When i select the data in the Data grid, the focus is displayed in the canvas. In the canvas i have a chart component.so when i select the link data on the datagrid the focus should be in the chart component in the canvas.
I would like to have a LinkButton programmatically selected.So I have a code like this:
<mx:LinkButton label="hello42" selected="{isHello42}"/>
isHello42 is true but the LinkButtons doesn't look like it's selected.Do I have to change the complete skin to achieve that the LinkButton look like it's selected?Here it look like setting selected=true should work:[URL]
Can I use ems for the width tag when embedding a flash object?
I've done some googling and it looks like it's just pixels and percentages but I want to double check with the stack overflow community.
how can i get an objects "main" width, the width whe object whould have widthout all the added children?
View 2 Repliespackage
{
import flash.display.*;
[code].....
i have a swf object in my page, and i want it to have 100%width (entire screen) but i want the swf to be aligned to the left. with the following code it gives me the 100%width but the swf is aligned to the center of the page, is there a way to change the alignment?
<object type="application/x-shockwave-flash" data="http://localhost/arquitectos/flsh/menu.swf?" height="120px" width="100%">
<param value="http://localhost/arquitectos/flsh/menu.swf?" name="movie">
[Code].....
I thought this would be straight forward but I'm having trouble repositioning my content. I have a button instance named rollOne, When I roll over the button I want to load an swf object but not on top of the button so I want to find out what the button's width is so I can reposition the dynamically loaded content. I thought rollOne.width would return the width, but it only returns 0 the same goes for height.
rollOne.addEventListener(MouseEvent.MOUSE_OVER, fetchQty);
function fetchQty(event:MouseEvent):void {
myContainer.x = (rollOne.x + rollOne.width);
myContainer.y = (rollOne.y + rollOne.height);
var img1Request:URLRequest = new URLRequest("8032697883620.swf");
var img1Loader:Loader = new Loader();
img1Loader.load(img1Request);
myContainer.addChild(img1Loader);
trace(rollOne.width);
}
Im trying to access the width and height of a dae/collada object.myDAE.width does not work. If you have any ideas as to which class this info is contained it would be a massive help!
View 1 RepliesI need a script which can animate an objects resize through AS. I know that
on (rollOver) {
_root.reBox._width = 100;
} on (rollOut) {
_root.reBox._width = 50;
}
Will jump my MC "reBox" to 100px on rollover and to 50px on Rollout, but how do I get AS to animate the transition - basically a tween!
I have two files, MenuButton and JerkChicken (my document class...don't ask).
MenuButton loads a font and then creates a textfield with a background rectangle that is inivisible (for a hit state).
In my document class (JerkChicken.as) I build a menu with the following function:
Code:
private function buildMenu() {
var labels:Array = new Array(
"one",
[Code]....
Or something similar...basically I want to take the width of the menu button, add a bit of space and then place down the next menu button (to make a horizontal menu bar).
The problem I am having is menuButton.width is returning 0.
In the menuButton class when I try to trace the width (i.e. trace (_bgWidth)) I am getting the width but when the button is created in the document class, I am not retrieving the width.
I guess what I am looking for is to somehow send "_bgWidth" from the MenuButton class to the document class...but I don't know how to do this.
I am tweeing a bunch of rectangles randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added random rotation (between -30 and 30 degrees), the corners of my rectangles are still sticking out of the stage at the end of the tween.
If I trace objects width and height after the rotation I get the new values but this still doesnt help me because I am tweening to that rotation.
Code:
mc.rotation = 20;
trace(mc.width);
trace(mc.height);
Is there any way to read the width and height of a flash object using jQuery?
View 1 RepliesI have a library MovieClip Class that consists solely of a dynamic textfield contained in a MovieClip. I want to instantiate this MC, populate the textField with text, get the width of the resulting text and, if the width is less than a predefined MIN_WIDTH value, append more text. When the width is equal to or greater than my MIN_WIDTH value, add this MovieClip class to the display list. My question is, does anyone know if its possible to retrieve the length of text in a textField using Textlinemetrics BEFORE the textField has been added to the display list?
View 2 RepliesI am tweeing a bunch of rectangular shaped objects randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added a random rotation between -30 & 30 degrees they still stick out of the stage a little.how could I calculate width & height of the these objects based on their final rotation so they dont stick out of the stage?