Flex :: Get The Index Of First Visible Element?

Jan 21, 2011

I have a simple list in Flex that is populated every N seconds by a dataprovider. My goal is to avoid scrolling the list after the dataprovider has been changed.

So, before I populate the list, I save the selectedIndex, and once the dataProvider is filled, I call:

list.selectedIndex = index;
list.scrollToIndex(index);

Trouble is that this moves the selected item of the list to the top. The solution would be to get the index of the first element displayed in the list: but I have no idea on how to get that.

View 1 Replies


Similar Posts:


Flex :: Get Viewport Element Index?

Dec 5, 2009

I use flex4 list[code]...

as far as i know , i can only know the the index that i already select by function

list.selectedIndex

did flex4 proivde some other function that i can use?

View 1 Replies

Flex :: Delete XMLList Element With A Given Index?

Nov 13, 2009

How can I delete the element with a certain index in a Flex XMLList?

View 1 Replies

Flex :: Will Google Index Content That Is Only Visible After Clicking A Button

Mar 23, 2011

Will the Googlebot "click" buttons on a Flex 3 site when it indexes it?

I've got a Flex 3 site. When the user clicks one of the buttons on my site, a panel opens and text appears. As the text is not immediately visible, will Google index the content in the panel? (I'm not cloaking or anything weird. It's just the normal functioning of the site).

Are there any Flex 3 developers out there who see Keywords listed in Google Webmaster Tools for text that is visible only after clicking a button?

View 2 Replies

Actionscript :: Get Index In An Array Of A Clicked Element In It?

Aug 10, 2011

I'm trying to create a virtual keyboard.

I have a class VirtualKeyboard which contains an array called keyboard of 26 movieclips, each one representing a letter.

In the main class, I create an object of the class VirtualKeyboard and added an eventlistener on it when a letter is clicked.[code]...

But the index always returns the value 4294967295.

How can I know which letter was clicked, I mean the index in the keyboard array corresponding to that letter?

The same code is working correctly if I put it in the VirtualKeyboard class, but not from the main class.

View 1 Replies

ActionScript 3.0 :: Array Index - Cannot Loop Through Every Element

May 31, 2010

I search the stage for the level I created and put the floor pieces into an array. I'm trying to test the properties I created for each piece by tracing to output when the hero sprite is within the floor pieces sides. This works fine when I specify the array index to do this for, but does not work when I try to loop through every element of the array. I see no reason why this code should not work.

package {
import flash.display.*;
import flash.events.*;
import flash.utils.getTimer;
import flash.utils.Timer;
public class MegaManTest extends MovieClip {
private var hero:Object;
[Code] .....

View 4 Replies

ActionScript 3.0 :: Get The Index In An Array Of A Clicked Element?

Aug 10, 2011

I'm trying to create a virtual keyboard

I have a class VirtualKeyboard which contains an array called keyboard of 26 movieclips, each one representing a letter.

In the main class, I create an object of the class VirtualKeyboard and added an eventlistener on it when a letter is clicked.

I tried this in the event handler :

var objectClicked:Object = event.currentTarget;
var index:uint = virtualKeyboard.keyboard.indexOf(objectClicked);

But the "index" always returns the value 4294967295

So how can I know which letter was clicked, I mean the index in the keyboard array corresponding to that letter?

The same code is working correctly if I put it in the VirtualKeyboard class, but not from the main class

View 1 Replies

Xml - Get The Index Of First Element To Mach A Condition In An XMLListCollection Object?

Oct 13, 2009

I have an XMLListCollection object that contains items with an ID property. I want to find one particular item by id and then get it's index in the collection. This is done to be able to tell the comboBox (whose dataProvider is the XMLListCollection) the index of the item to display.

View 1 Replies

Actionscript 3 :: Determine The Index Of An Element In Array That Has Been Clicked?

Jan 3, 2012

Say, I have an array of movie clips (dummies). Each dummy has an event listener and reacts to clicks. And when a dummy is clicked, I want to know the index of the clicked dummy.

I've only come up with this solution: run through the whole array of dummies and find out which dummy is the target, then exit the 'for' cycle and assign some global variable the value of counter variable, but this way the application I am building will demontsrate poor performance.

View 2 Replies

ActionScript 3.0 :: Retrieve The Index Of The Array Sector In Which An Element Is Placed?

Sep 8, 2011

Supposing that i've a lot of MC placed on stage, every MC is stored into an array. Clicking on one of it, can i retrive the position in which it's stored into the array?

View 6 Replies

Actionscript 3 :: Determine The Index Of An Element In Array That Has Been Clicked?

Sep 2, 2004

I have an array of movie clips (dummies). Each dummy has an event listener and reacts to clicks. And when a dummy is clicked, I want to know the index of the clicked dummy.I've only come up with this solution: run through the whole array of dummies and find out which dummy is the target, then exit the 'for' cycle and assign some global variable the value of counter variable, but this way the application I am building will demontsrate poor performance.

View 12 Replies

Flash :: Element Stays On Stage After Manipulating The Index(depth)?

Mar 24, 2010

Here is the problem I have: after I change the index of one movieclip using this code

oldIndex=getChildIndex(DisplayObject(e.target));
setChildIndex(DisplayObject(e.target), numChildren - 1);
when I give the object its old index
setChildIndex(DisplayObject(e.target), oldIndex);

and go to another frame of the movie, this element I have changed the index of stays on top of all elements on the new frame. My question is am I doing something wrong and if not, what can I do so that this element stays only in the frame it is placed.

View 1 Replies

Flash :: Get The Specific Array Index Based On Value Inside The Index's Object?

Jun 22, 2011

So, for sending to individual streams we have to reference the connected netStream we want to send to in some way like this:

sendStream.peerStreams[0].send("MyFunction",param1,param2);

and I have to determine which peer I'm sending to by their ID such as "peerID1234"

I know that you can check the peerID of the stream by doing:

sendStream.peerStreams[0]["farID"]

how can I make my send stream function know to use the array index where the peerID is?

so basically it could be like:

sendStream.peerStreams[where peerStreams[]["farID"] == peerID].send("MyFunction",param1,param2);

View 1 Replies

Flex :: Change The Index.html Flex Output To Admin.anotherExtension?

Dec 9, 2010

i need to change the automatically generated index.html flex output to admin.anotherExtension. I understand that if i change the index.template.html the changes in html level will be preserve when the file is generated, however i need to change the name of the file also, and the extension.

View 1 Replies

Actionscript 3 :: Get Element Inside Another Element Just Having It's Id In Dynamically Created String Form?

Mar 18, 2012

I know that there is no such function as getElementByName in Flex but I also now that you can do this["object_id"] to get the element of the application u're in.What about getting an element inside another element?I've tried making element["id"] ? But in my try-catch it always runs the "catch" part..how do I get an element inside another element just having it's id in dynamically created string form?

View 2 Replies

ActionScript 3.0 :: Render Value To One Element Of Flash On Basis Of Other Element?

May 10, 2010

I have flash where there is a link for song download. And, at the bottom of the flash I've a count, loaded thorugh flash vars which should increment everytime donload button is hit. Please let me know what approach should i take to do that. can i call a Java method on donload button which will insert a row in the table and and then get the count and render it to the count variable in my flash?

May be this extremely confusing. Here is a very similar example on how it is done. This is actually very similar to what i want to do. [URL] on this link there is count below which increments you hit the download button.

View 1 Replies

ActionScript 3.0 :: Element Is ITooltippable Vs Element['tooltip']

Oct 25, 2010

I've built a rather robust tooltip class recently that attaches and draws a single tooltip sprite to the root, then uses MOUSE_OVER to detect when it is over a tooltippable object, and shows the appropriate tooltip text. At the moment, I'm ensuring that any elements in my application which wants to take advantage of showing tooltips implement the ITooltippable interface, and expose a public getter, get tooltip().

[Code]...

View 0 Replies

ActionScript 2.0 :: Hiding An Element If Another Element Is Undefined

Apr 13, 2006

Basically I have 14 text boxes, each box draws its content from an external txt file. Next to each text box is a button. I want the button to be either visible=true or visible=false depending on weather or not the text box has content or is "undefined" Here is what I have so far, and it's not working:[code] I would like a FOR loop to just run through the variables and check to see if any of them are undefined. if it is, then make the correct send button invisible.

View 8 Replies

ActionScript 3.0 :: In-visible Sprite With Visible Children?

Sep 28, 2011

My question is: Set parentSprite.visible = false will make all children in parentSprite all invisible, right? And is there any way to just make parentSprite itself invisible without effecting it's children?

View 2 Replies

ActionScript 3.0 :: On Click Object Visible Not Visible

Aug 8, 2010

I want to click on an object and make it appear and disappear. As the object is rectangular, I figured putting a white button the same size on a white background on a layer underneath the object would do this, but I can't seem to make it happen.I'm a complete novice, frustrated as I've been trying to achieve this all day and I'm sure it should be pretty simple, but could you give me the idiots guide. I know how to name an instance, make an object, script in actions on a separate layer. I would like to draw the button myself and give it an instance rather than drag it off the button component (as I can't work out how to make the component button white, change its size etc.!)

View 5 Replies

ActionScript 2.0 :: Visible = True & Visible = False?

Apr 1, 2009

Code:
my_Dyn_Txt1._visible = false
cb1.onRelease=function()[code]....

When the checkbox (cb1) is clicked the "my_Dyn_Txt1" is visible. The problem I'm having is - when I move forwad and back in my frames the checkboxes which were clicked are not visible due to

Code:
my_Dyn_Txt1._visible = false

How can I make ("my_Dyn_Txt1"), a clicked checkbox STAY VISIBLE even after I move forwad and back in my FLA frames?

View 11 Replies

Flex :: Get An Array Element?

Aug 18, 2009

I have an array like this

public var dataAL:Array=[
{Kiv:"cash", jan:26,janTarget:28,feb:27,febTarget:26,mar:30,marTarget:32,apr:31,aprTarget:32,may:28,mayTarget:29,jun:46,junTarget:32,jul:37,julTarget:39,aug:40,augTarget:42,sep:41,sepTarget:42,oct:48,octTarget:49,nov:40,novTarget:41,dec:38,decTarget:40},

[code]....

Now if i want to access febTarget for cash how will i do it?

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 :: Get Item From AdvancedDataGrid Given Index

Jul 7, 2009

I've got a subclass of AdvancedDataGrid showing a tree-like data structure. How can I, given the index returned by calculateDropIndex, get the item at that index? After reading through reams of code, it seems like the least terrible way is:

var oldSelectedIndex:int = this.selectedIndex;
var mouseOverIndex:int = this.calculateDropIndex(event);
this.selectedItem = mouseOverIndex;
var item:* = this.selectedItem;
this.selectedIndex = oldSelectedIndex;

The other option seems to be tinkering around with the iterator property... But, judging by the way I've seen it used, that will get pretty harry pretty quickly too. So, how can I get the item at a particular index in an advanced datagrid without going insane?

View 3 Replies

Flex :: Set Tab Index > 0 In TabNavigator At Initilize?

Jun 9, 2010

How to set tab index > 0 in TabNavigator control at initilize, flex

View 2 Replies

Flex :: Tab Index On Flash Movieclip?

Dec 30, 2010

I have a form that pops up in flex, it is a movieclip contained within a UIComponent. Within this movieclip are form fields.

For some reason I can't get the tab button working to be able to tab between the fields. I set up each field with a tabindex, but that doesn't work.

Is there anything else I need to do besides this? This is basically all the code I am using:

email.tabIndex = 1;
city.tabIndex = 2;
firstName.tabIndex = 3;
etc.

Is this not working because of flex? And if so, what is a workaround?

View 1 Replies

Flex :: Spark Tab Bar Rollover Index?

Mar 13, 2011

I am using a the spark tabbar and gave a view stack as dataprovider.....in the view stack there are n elements ...and each element has a panel....my code would be some thing like this....

<s:tabbar dataprovider = {viewstck-id} height="100%" width="100%"/>
<viewstack id="viewstck-id">
<navigatorContent >

[code]....

View 1 Replies

Flex :: Show Row Index For DataGrid Rows?

Nov 24, 2009

Is it possible to dynamically show row index for DataGrid rows ?

I have a static ArrayCollection which is set to be DataGrid's data provider and I would like to always have row numbering for each populated row (e.g. in a column called "#").

View 1 Replies

Flex :: Get Item By Index In A Tree Control?

Jan 20, 2010

I'm doing a drag and drop operation on a tree using some help from Adobe's quick Starts:[URL]

The code suggested is roughly this:

var dropTarget:Tree = Tree(evt.currentTarget);
var i:int = dropTarget.calculateDropIndex(evt);
myTree.selectedIndex = i;

[Code].....

EDIT: I forgot to post that my current workaround is setting the selectedIndex = -1 after I get my node:XML. I'm afraid that if something bogs on the processor the user may see it select then deselect.

View 2 Replies

Flex :: Bubble A MouseEvent By Z-index Instead Of Hierarchy?

Feb 24, 2010

I have two components being absolutely positioned within a container (they are MapSymbols on an ILOG Elixir map, if that helps). Each component is a VBox with an Image and a Label. Images have functionality tied to the Click event; labels do not.

The problem is when 2 items are positioned so that the label of one is above the icon of another in the z-index, so that the label eats any mouseOver and mouseDown events. Bubbling doesn't help since it bubbles from the label to the vbox to the container, never hitting the lower element. I can't set the vbox to mouseChildren="false", since that keeps the image from getting clicked, as well.[code]...

View 2 Replies







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