Flex :: Get Viewport Element Index?
Dec 5, 2009I 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?
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?
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.
How can I delete the element with a certain index in a Flex XMLList?
View 1 RepliesIs there a way to get the content of a component inside a scroller to be at 100% height.
here is a simple example:
<s:Scroller width="100%" height="100%">
<s:viewport>
<s:Group height="100%">
[Code]....
As you can see, the green bar (set at 100% height) is just using the height of the viewport, not that of it's parent group, that is stretched by the red one to be 500px high.
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.
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] .....
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
I have a Flex Spark List (well it's a Tree to be precise but it renders as a list) and as I'm scrolling through it I want to provide information about the item that is currently at the top of the list in context to the viewport. So this could be the 100th item in the list depending on how far you've scrolled down.
View 1 RepliesI have data ItemRenderers with DataGroup, but I have many items, and it seems to me that DataGroup create all of them not only those few displayed on users screen, which takes time and resources.
View 1 RepliesI have provided an ArrayCollection to a List, works fine, scroll and sweet.
I am able to access the carretIndex (though not necessarily the ones in view) by
list.caretIndex
Is it possible to access the list of items currently visible in the List.
What I am curious to know, is how can I can access (read) the first (or any of the) item in a given View port of the list.
I have a s:TileGroup as follows:
<s:TileGroup id="myTileGroup"
clipAndEnableScrolling="true" focusEnabled="true"
horizontalGap="4"
[Code]....
As items are added to the TileGroup it "overflows" its' bounds, items are displayed below, and when scrolled above, the 3x3 grid.
Is there a way to "mask" or otherwise hide these items?
I looking at the properties of TileGroup, I've tried to emplement the "verticalScrollPosition" and "bottom" properties - these don't do it.
Setting the "height" property effectively creates a bottom limit for the group, but when scrolled items are still displayed above the "padding" area.
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 RepliesSay, 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.
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 RepliesI 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.
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.
Goal: I want flash to have accurate information about the width and height of the browser viewport in device pixels when intializing, resizing, or on browser zoom events.
Specifics: I need to embed flash into an html page that runs in chrome, safari, firefox, ie. The swf must fill the entire browser viewport.I don't want the flash to zoom.Inside of flash I can set StageScaleMode.NOSCALE so that flash renders to Device Pixels.I also set the state's alignment to StageAlign.TOP_LEFT.Now all I need is the number of device pixels in the browser!
Problem: when there is a browser zoom or I open the site while the browser is zoomed, I cannot easily get information on the browser's dimensions in device pixels.
Solution: acrobat.com's online document editor (formerly known as buzzword) handles this problem just fine (free to play with with an account).What are they doing?In webkit browsers, they are able to keep the document.width to report device pixels every time. I am not sure what they are doing in firefox and ie.
What doesn't work:Swffit does not support this.Just loading the swf into the browser is not a solution, as the swf needs to be embedded.This solution scales a swf to accomodate different browser zooms but does not get information on the browser window dimensions.
I have a interactive flash application where I can click on menus and do stuff with it. Is it possible to capture the whole viewport which involves expanding menus and stuff and turn it into a video stream in flash?
View 1 RepliesI'm using the google maps API v3 with flash and it works fine on one of my websites.I transfered it to another website and changed the API key, but all I see is the defaultbackground color with no error message. Unfortunatly, I cannot access the flash source code.Is there a way to debug the application or see some error messages without the source code?
View 2 RepliesSo, 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);
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 RepliesI 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 RepliesI 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.
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]...
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 RepliesI 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?
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 RepliesI'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?
How to set tab index > 0 in TabNavigator control at initilize, flex
View 2 RepliesI 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?