Flex 4 : Change Element Position In A S:List?

Dec 20, 2011

I have a s:List in my flex application attached to an ArrayCollection ( elements ). I want to change position of one element, so in fact I'm changing it's item index, the question is, how to do this kind of action ?

Here is a better example :

item 1 i : 1
item 2 i : 2
item 3 i : 3
item 4 i : 4

[Code]...

View 2 Replies


Similar Posts:


Actionscript 3 :: Change Element Position Inside MovieClip In Event.RESIZE?

Oct 21, 2011

I have some little listener.

stage.addEventListener(Event.RESIZE,rozmiar1);
function rozmiar1(e:Event):void
{
ofertaBTN.oCenter.width=(14.59*stage.stageWidth)/100;
ofertaBTN.oRight.x = ofertaBTN.x+ofertaBTN.oLeft.width +ofertaBTN.Ocenter.width;
}

But only ofertaBTN.oCenter.width is changing. oRight is not responding and I get error #1010.

View 1 Replies

Flex :: Add Element To Top Of List?

Dec 15, 2011

I've got a spark list that gets dynamically filled.So far the new items appear at the bottom of the list. What I'd like to do is to add them at the top.The items in the list have a unique ID so some kind of sorting mechanism would probably do the trick as the new items have a greater ID than the old ones.What I'd like to avoid is some complex method behind this as I'm working on a mobile platform and the list can get quite big so I need this to be as efficient as possible.The list's data provider is an ArrayList that gets updated using binding.

View 1 Replies

Flex :: Scrolling Through List Element Causes Text To Scroll As Well

May 12, 2010

I'm using a list element with variableRowHeight and word-wrap set to true like in the example below: [URL]. When I scroll through the list with a mouse scrollwheel the text in the listItems also scroll. I know that this is to do with the height of the textField...

View 1 Replies

Flex :: Change State When Hover On Another Spark Element?

Sep 5, 2010

How to set a hover state (upSkin) when hover on another element? This example is not working on spark:

[URL]

Would like to do something like this:

<s:Button id="but1"/>
<s:Button label="change" mouseOver="button2_mouseOverHandler(event)"/>
protected function button2_mouseOverHandler(event:MouseEvent):void{
//make but1 look like I'm hovering it
}

View 1 Replies

Flex :: Set The Scroll Position For A Spark List Control?

Aug 9, 2010

How can I set the scroll position for a Spark List control?

View 1 Replies

Flex :: Spark List Scrolling By Mouse Position

Mar 13, 2011

[code]When I hover the upper (red) part of the List (I would like to have the List scroll downward, the higher the mouse position is, the faster it should scroll). Similarly, If the mouse hovers over the bottom (red) part, the List scrolls upwards, and the lower the mouse is hovered, the faster the list would scroll. The current code does work - Though, the trace outs make it obvious that:this.layout.verticalScrollPosition += (mouseY - 220)*0.5.or this.layout.verticalScrollPosition += (mouseY -86)*0.5;are giving jumping effects, is there a way to make these values change more linearly or smoother? I created an AnimateProperty, but that works well only if I would like to scroll to a selectedIndex, In this case, I would like the scroller to keep scrolling linearly as the mouse is hovered to a particular red area, and increase in speed when I scroll to either extremity.The Objective: While the mouse is over the Bottom (red part )of the List, the verticalScrollPosition scrolls faster as it gets farther than the center of the ticket list... yet there is jumping effect going on, I suppose due to the EnterFrame. the Same with Upper Part... the higher the cursor is, the faster the List should scroll.I feel this is a common problem to Flash CSx developers.

View 1 Replies

ActionScript 3.0 :: Create An Element - Get "nodeValue"+i From My Element And Change That?

Dec 3, 2010

when I create an element  with this method :
 
this["nodeValue"+i] = new TextField();
(surely in dynamic class )
 
then I want to change instance name of that element.when I trace this["nodeValue"+i].name.I got a different name for that element !  f ex : instance8 .how can I get "nodeValue"+i from my element and change that .is it read only ? I want to swap tow element's instance name !
 
for example :
this["nodeValue"+i]  to this["nodeValue"+i+1]

View 4 Replies

Flex :: Change ContentBackgroundColor Of List With ItemRenderer?

Feb 11, 2011

I'm attempting to change the contentBackgroundColor of a List component depending on the content found within the dataprovider.[code]...

View 2 Replies

AS3 :: Flex - Combobox Change Dropdown Position?

May 14, 2010

I'm trying to change the position of the dropdown list relative to the combobox item.Setting the position using comboBox.dropdown.x = 1337; doesn't work...

View 1 Replies

Flex :: Resizing List Components Upon DataProvider Change

Jul 10, 2011

I have a component that contains a list that implements a custom renderer. I use this component as a tooltip, keeping one in memory and just altering the databindings as necessary.

Something like this where TTComponent is a class that extends Canvas:

<s:TTComponent>
<s:BorderContainer>
<s:List id='lstItems' dataProvider="{data.Items}" width="50%" borderVisible="false" contentBackgroundColor="#222222">

[Code]....

Now, what happens is when data containing many items is set to tt.data, the list resizes itself larger and displays fine. However, after this, if data containing few items is set to tt.data, the component momentarily displays larger than it needs to be, then resizes itself smaller.

What I'd like to do is have the component resize itself before it displays, so I don't see the resize on screen.

View 1 Replies

Flex :: Change Dataprovider In Spark List That Has Itemrenderers?

Mar 13, 2012

In flex 4.5, I have an application that has a BorderContainer that loads a spark list (mxml style - _myList and the borderContainer is stored in a library outside of the parent application) that loads an arrayCollection with an itemRenderer (I should note said itemRenderer is not an inline renderer - on selection of an item in the list, the itemRenderer expands, loads a particular control within the item renderer based on data passed from the selected item in the list) and allows the user to perform a search. This works all well and good on startup/load, until I try to change the dataProvider for the list (my app allows users to switch data sources which then creates a new dataProvider with new variables). I have tried:

[Code]...

View 1 Replies

Flex - Tree DataTipFunction Tooltip Change Position?

Nov 30, 2009

I am doing dataTipFunction on Tree in Flex3 Air,

At present the tooltip hides the present node, i need to reposition the tooltip above the node, how can change the x,y position of the tooltip.

View 2 Replies

Flex :: Change Sort Arrow Position In Grid?

Apr 9, 2010

Currently when sorting in a flex grid, the sort arrow that shows whether the column is sorted ascending or descending is right aligned to the column. Is there anyway to change the position of the sort arrow, such as applying padding?

View 1 Replies

Flex :: 3 - Adobe 3 List Control Selection And Change Event

Nov 22, 2009

I created a list control at runtime as following:

[Code]....

//Where myDataArray is an ArrayCollection consisting of my Custom ValueObjects. When i execute the code it displays my list with custom item renderer, which is fine. But when bring my mouse over it, it doesn't give any colour highlight which means it is not selecting. Secondly, when i click on any of the list item, it doesn't dispatch any change event. I tried a lot but couldn't understand it.

View 1 Replies

Flex :: Change The List ItemRender Depends Of The View State

Jan 11, 2011

I have one list, which the item render it`s like this:link. But now I need to enable or disable the button delete depends the view state which my List is inside. This is my view(which contains the list):

[Code]...

View 2 Replies

Flex :: Change BorderColor Of Clicked Item (itemrenderer) In List

Jun 22, 2011

I want to set the BorderColor of certain Item Renderers (textInput) of a List. By default all have a common border color, but I want for example when clicking in an item to have a red border. I tried this on a click event in my itemRenderer,

[Code]...

View 1 Replies

Flex :: Keep A List From Scrolling On DataProvider Refresh/update/change?

Jun 30, 2011

I have a simple list and a background refresh protocol.When the list is scrolled down, the refresh scrolls it back to the top. I want to stop this.I have tried catching the COLLECTION_CHANGE event and validateNow(); // try to get the component to reset to the new datalist.ensureIndexIsVisible(previousIndex); // actually, I search for the previous data id in the IList, but that's not importantThis fails because the list resets itself after the change).I hate to use a Timer, ENTER_FRAME, or callLater(), but I cannot seem to figure out a way.The only other alternatives I can see is sub-classing the List so it can catch the dataProviderChanged event the DataGroup in the skin is throwing.

View 4 Replies

ActionScript 3.0 :: Getting The Position Of A Certain Element In An Array?

Dec 24, 2010

1. let's say I have an array full of mcs, is there a fast way of knowing the position of mc_b in that array without looping through it every time?

2. also, is there a fast way of swapping the position of two elements in an array without splitting it and re-sticking the parts?

View 8 Replies

ActionScript 2.0 :: Returning The Position Of An Element In An Array?

May 11, 2011

I've got an array (called "thearray") that I've just sorted alphabetically using thearray.sort.I then wanted to check if a certain item (myItem) was in the array, so I did a loop:

for (var w=0; w<thearray.length; w++){
if (thearray[w]==myItem) trace("this item has been found in the array")

Now, I want to know if it's possible to return the new position number of the item in the array - ie finding the element number of myItem (as in arrayelement[0], arrayelement[1], arrayelement[2]-- the number in the [ ].)

View 1 Replies

Flash :: List Component - Change Pointer Icon To Hand For List Items?

Nov 9, 2010

I am working on an older Flash project created in CS3 ActionScript 2.0 How can I make the pointer cursor change to the hand when hover over a list item?_root.slidePanel.myList'myList' is the list. I have traced out the contents of the List MC and it has a child MC called 'content_mc'. I assumed this was the object containing all of my list items but the only members of this MC I can see (when tracing them out) are 'setRGB' and 'searchKey'.

View 1 Replies

Javascript :: List Available Callbacks Exposed By A Flash Element?

Jun 26, 2009

Is there a way to query an embedded flash element to determine the available methods that can be executed on it via JavaScript?

Edit:
It appears that in IE it's as simple as

for ( i in flashNode ) {
alert(i);
}

After much clicking, they will be some of the very last members enumerated.

Still not able to determine this in Firefox though.

View 2 Replies

ActionScript 3.0 :: Get The Position Of The Last Element In A TextField With HTML Text Inside?

Jul 3, 2009

I need to get the position (x,y) of the last char in a textField with html text inside. I try with numlines and getLineMetrics, but that only work for non-html text. If I have a text like

Code:
<p>text one</p><p>This is the other text</p><br><br>

I need to have the position on the stage of the last "t".

View 4 Replies

Actionscript 3 :: Detect Element Transformation Type For Rotated Elements Depending On Cursor Position?

Feb 2, 2010

I've written the following method (in actionscript 3, it's a flash application) which returns what transformation type is required for the current mouse position in relation to a given element position.

An element can be moved, scaled and rotated. This method returns if any of these transformations are applicable with the given coordinates[code]...

View 2 Replies

ActionScript 3.0 :: Record The Current Position Of Any Of The Items Item In Order To Use That Data To Change The Position Of The Item After The User Clicks?

Jan 2, 2010

If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?

This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;

View 9 Replies

Actionscript 3 :: Get Change In Any Element

May 18, 2011

I have a screen with a few components (textInput, textArea, checkBox). I want to check if there has been any changes to the components. Foe example if text has been entered or checkbox has been clicked. Is there a direct way to do this instead of checking value of each component and then setting a Boolean for this?

View 3 Replies

ActionScript 3.0 :: Save Xml Element And Change Its Value?

Apr 14, 2011

Lets say ihave an xml [code]...

how can i save this element and refer to it later?

View 1 Replies

ActionScript 3.0 :: Change Alpha On Individual Element?

Oct 2, 2010

I am working on a project for school using ActionScript 3. I have a matrix created with an animated movie clip. The matrix looks like a bunch of shapes changing size and color on the screen. I would like to have it so when I move my mouse moves over an individual shape in the matrix the alpha will change to be more transparent... like 0.5. I'm sure it would be a mouse move function, but I don't know how to write that part of the code.[code]...

View 16 Replies

ActionScript 3.0 :: How To Change Color Of Element On Stage

Jun 20, 2010

I have two boxes on the stage. These two boxes together are converted to graphic. Each of the box - lets called "A" consist of some kind of surrounding (the line around the box for which we set up[ stroke) which I will cal "B". And inside that box theres another box of different color - I will call it "C", with different surrounding - call it "D".

(It is inside the first one).The other box from that graphic looks the same, but has different names. "E","F","G",and"H" respectively. All of the elements "A","B","C",and "D" forms a button. I have some code to use it.(with event listeners) My question: If I would like to change the colour of the element "B" (which are a movie clip), how will I code it.

ActionScript Code:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.utils.Timer;
var urlLoad:URLLoader=new URLLoader();
[Code] .....

And it tells me: Access of undefined property B...
The code works fine for whole button(A). A changes color, but I would like only the surrounding to change the color. I guess I have to put some path in there, but I am not really sure how to.

View 2 Replies

ActionScript 3.0 :: Y Position Of Items From A XML List?

Sep 4, 2009

i want to alter the code in a way that every time 5 items are in a row the next 5 will be in another row with Y +200

Quote:

# var scroller:MovieClip = new MovieClip();
# this.addChild(scroller);
# scroller.y = 30;

[code]....

View 5 Replies







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