Flex :: Arbitrary Number Of Anonymous Loader Handers With Individual Data?
May 12, 2009
I have an arbitrary number of files that I need to load in an AIR app.I want to iterate through an array of File object and create and launch Loaders for each one's File.url.When they are done (event COMPLETED or IOErrorEvent.IO_ERROR), I want to stuff their data somewhere. If they fail, I want to make an exception report. I cannot find any way to reference the File object from the event listener (certainly not the IO_ERROR)The best way would be to create individual event handlers for each Launcher that had the File information "hard-coded" into it. At the very least, I could use the function itself as an index to a Dictionary:
foo(fileToLoad : File) : void
{
var theCompletedHandler : Function =
{
[code]....
Can I use event.currentTaget and use the Loader instance as an index? Will that have any weird dependencies ?
View 1 Replies
Similar Posts:
Mar 27, 2012
I'm trying to figure out how to tile a rectangle (the stage) with an arbitrary number of rectangles. Simple tiling where all the tiles are the same size and simply stacked in a grid.I'm doing this with a resizable layout and a number of tiles that is arbitrary and will change over time.
Given a more or less 4:3 or 16:9 monitor I would like a solution that tends toward minimizing the perimeter of the tile and being similar in aspect ratio to the screen. I realize that if I have a prime number of tiles that I won't be able to make a nice grid, but other than that it seems there should be some way to do this.Lets say I have 231 tiles I need to arrange. The factors are 1, 3, 7, 11, 21, 33, 77 and 231.If the screen is really, really wide 1 x 231. Wide but not not as crazy wide as before 3 x 77. And most likely 11 x 21 is what I would need.So is there an easy way to do this on the fly? Is there a pre-calculated way to make it easy?
View 1 Replies
Mar 8, 2011
I want to seed a number generator using a string input. What function would be best for simply turning the string into a number to do this?
View 2 Replies
Dec 15, 2011
In ActionScript 1 and 2, if you compare undefined, null or NaN with an arbitrary number using >= or <= operator, the result is always true. Test code:
var x, n, range = 1000;
for (var i = 0; i < 3; ++i) {
switch (i) {
case 0:
x = undefined;
[Code] .....
Furthermore, isNaN(null) return true. These are contrary to JavaScript and may not conform with ECMA standard.
View 1 Replies
Oct 22, 2011
Why isn't this working as I am thinking it would:
var i:int=-1;
for each(obj in myData)
{
i++;
[Code]....
If I add i to an array (like myArr.push(i)) it will have 3 elements, 0, 1 and 2.
View 2 Replies
Oct 6, 2010
I've got a function wich can accept a varible number of parameter with a rest operator. I want create an object passing the argument collected with the rest operator directly to a constructor without create an object and call an initializing function and without passing the entire array but the parameters ah I do with apply() function.
[Code]...
View 4 Replies
Mar 28, 2011
i have some arbitrary signal data which i'd like to get a frequency analysis of. it's not audio data. is there a way to coerce AS3's computeSpectrum() call into doing this work for me ?
View 1 Replies
Aug 22, 2011
I'd like to convert an arbitrary string (or for easier process a string hash) to a float number between 0 and 1. The purpose is to create a function that returns a color code for a given string so the user always sees that entity in the same color that is generated from its name.OP included this code in comments (included here for readability):
var hashed:String = MD5.hash(input); // creates a 32 long hexa
const max:Number = Number("0xffffffffffffffffffffffffffffffff");
var hashedHexa:Number = Number("0x" + hashed);
[code]....
View 1 Replies
Aug 4, 2010
In as3, I am adding event listener and then attaching the anonymous function to it:[code]Now this whole piece of code is looped n times. Now, I have n myBoxes and whenever I roll my mouse over the box, it should alert the name. But, what I see is that the last value of count is used by each box. How can I pass parameter or value to the anonymous function? ( as roll over , I believe, expects only one variable)
View 2 Replies
Apr 23, 2011
I have been working on a flex application with java, as i have used Life Cycle Data Service for communication, i wana know, is there any function of flex, where i can see the loading status in percentage, that how much record is being loaded.Problem is, if there is lengthy record, no body comes to know, whats happening with software, like in Comboboxes or Grids, users usually think it as a BUG in application, but ofcourse it is not.I need such graphical loader, which keeps on loading with proper status in percentage, until it receives all data from JAVA (SQL Server).
View 2 Replies
Aug 26, 2010
Getter functions allow obj.meth syntax instead of obj.meth(), I'd like to create an anonymous one of these to return from another function. function get ():Object { } is invalid syntax. I don't suppose Flex offers an easy way to get this functionality, if it's even possible?
View 2 Replies
Jul 26, 2010
I'm using a CartesianChart with a DateTimeAxis to display weekly data in a Flex application.When I set dataUnits="weeks" and labelUnits="weeks" on the DateTimeAxis, it automatically places each major tick on a Sunday. However, I would like to provide users with the option of beginning the week on a Sunday or a Monday. How can I ask the DateTimeAxis to instead place the major ticks on a Monday (or some other day of week)?For example, if the user is looking at total sum of something over the week, and requests that weeks start on a Sunday, the Series data would look like:
x: Date(July 11, 2010) y: 25
x: Date(July 18, 2010) y: 30
x: Date(July 25, 2010) y: 32
[code]......
View 2 Replies
May 15, 2011
I'm trying to write a custom fadeTo(component, x, y):void method, which takes an arbitrary Flex Component as an argument and moves it to a given location, but smoothly.
The problem I'm running into is the following.
I want to send the component itself as argument, like this: (using Button as an example only)
fadeTo(myButton, 200, 500);
(this should move myButton smoothly from its current position to the position indicated as parameter)
However, I don't really know what type an arbitrary Flex Component is. How should I handle that?
View 1 Replies
Jun 16, 2011
I import XML data in order to fill an AdvancedDataGrid (using Flex 4.5). This ADG is correctly filled with the data, columns display the right information etc. etc.
I would like to summarize this ADG using
<mx:SummaryRow summaryPlacement="group">
<mx:SummaryField2 dataField="Cost" label="amount" summaryOperation="SUM">
</mx:SummaryRow>
But there is a problem! Indeed, the 'Cost' data are imported as 'Strings' and that is why I cannot do the SUM... I just get a nice 0 as a result! I would like to convert these data into Numbers, so that the addition can be processed. This conversion has to be done before filling the ADG I think.
I already tried to implement a custom summaryOperation but was unlucky...
public function calculateSummary(data:Object, field:SummaryField2, rowData:Object):void
{
var dataField:String = field.dataField;
[Code]...
The Alert always displays a void message, the data are not transmitted to this function I think
There is another thing: the user can insert new data in the XML dynamically and that insertion has to update the SUM result.
View 2 Replies
Jan 11, 2012
I used var dp:ArrayCollection = new ArrayCollection(container.GetVotesResult); to get the JSON data from GetVotesResult method. I get the values as below.
[Code].....
How do I retrieve the 2nd, 3rd, 4th and so on (if it has) array datas individually and dynamically. Say, I want to take 'Atext' from all the array.
View 3 Replies
Apr 29, 2010
I have a map of the UK with around 30 markers on when these are clicked I need the box to appear as shown in my attachment. These all need individual data and a unique link. Could I load the clip from the library and then populate the fields using xml, could this also work for the link?
View 4 Replies
May 19, 2011
private function getPercentage(max:Number, value:Number):int
{
return Number((value*100) / max);
[code].....
View 1 Replies
Jun 20, 2004
I've gotten as far as getting a listbox with a list of articles to display the articles in a dynamic text box, only i can only get it to work if i use one huge external text file that contains all the articles. what i want is to have each item on the list open up its own external text file, i.e. for each item on the list, there exists a separate text file. I'm about ready to put my fist through the monitor, and that would suck because this is a really nice monitor
View 13 Replies
Feb 21, 2007
I trying to load indivual strings of text from an external file. example: I have a movie that navigates from frame to frame. on each frame I'd like a line of text to load into the movie. When the user navigates to the next frame the text loaded vanishes and is replaced by another line of text. This can be done with separate txt files, right but I was wondering if and how it could be done using one external text file.
View 2 Replies
Mar 22, 2011
From Pro Adobe flash can I export an animation's data? like the x and y coordinates and rotation values for individual images in a sequence
View 1 Replies
Feb 8, 2011
I have just implemented a dropdownlist of checkboxes taken from this ComboCheck example but made it extend DropDownList instead of ComboBox to provide better functionality that I required. I am attempting to create a DropDownList where some items are bold and non-checkboxes (or can be checkboxes) and others are not.
I have not been able to find anything online about doing this yet and have been trying to figure it out. I am currently using an ArrayCollection as a dataProvider but I think this could possibly be my issue and I should be trying to setup the labels in flex not AS3.[code]...
View 1 Replies
Jun 21, 2011
If I have a button named:
<mx:Button id="backButton">
and another named:<mx:Button id="cancelButton"
How can I style each button seperatly?
Can I give each button a style, then set the style in CSS... E.g.
Button #style { backgroundColor: red;}
View 1 Replies
Mar 21, 2012
I have figured out a way to change the style of tabs at run time with following logic:
var cssStyle:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".MyTabs");
cssStyle.setStyle("borderColor", "red");
But here ".MyTabs" class is applicable to all the tabs between first and last tab. As per getStyleDeclaration javadoc, it only accepts "class selector" and "type selector" not the id selector.
How can I change the individual tab style at run time?
View 3 Replies
Jun 17, 2009
How can I disable a single button in a buttonbar in Flex?
View 2 Replies
Jun 21, 2010
I want to know if anyone can point me in the right direction for individually loading images (I think thats what is happening) in Flex 4.I saw this site and I like the way each individual picture gets loaded when a new category is opened and thought it would be very useful in our next project.
View 1 Replies
Jun 18, 2010
Right now I am using an apply task inside of an antrun execution.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions><execution>
<id>compile-default-theme-css</id>
[Code] .....
How do I do this in pure maven? Without the antrun plugin?
View 1 Replies
Oct 8, 2010
I have Flex 4 DataGrid, what I would like to do is when an cell has been edited, I would then like to walk through the values of that column and preform math on the values, e.g., I want to total up certain values.
1) How do I reference individual values of a specific column so that I may set them.
2) How do I then set those values or should I create a new column array and pop it in place of that column.
View 3 Replies
Oct 19, 2010
Having read about Container creationPolicy (thanks all the references in StackOverflow)I have a TabNavigator and AS code in the initial Tab needs to reference components of second tab (a Canvas with multiple children).But the components of the second tab are null until that Tab is rendered.
According to the documentation as I read it, I should be able to set creationPolicy on the second tab/Canvas to "all"; the TabNavigator will instantiate all its top-level children, even with its multi-view creationPolicy="auto"; and I was hoping that when creating the child Tab/Canvas, that the creationPolicy="all" of that single-view Container would be honored.
But it appears that this is not the case; if the TabNavigator has creationPolicy="all" then the second Tab is populated (but so are the third, fourth, ...); but with "auto" the second Tab is created, but not populated, even though its creationPolicy="all".Is there a way to get just selected Tabs to pre-instantiate?
View 1 Replies
Jun 22, 2011
I need to write and test xmlStuff.as. I would like to test it on its own without launching the entire application (launched with index.mxml).
Project
Folder: src
Package: Default Package
- index.mxml[c
If I was using java what I would do is I would create a new package: [url].....
And I would put this code in it:
public class xmlStuffTester {
public static void main(String [] args){
XmlStuff xs = new XmlStuff();[code]...
(Alternatly I would write a unit test if I knew exactly what the xml output should be. I don't know that yet so I prefer the above approach.)Question: What is the standard way to do this in Flex builder?
View 1 Replies
Nov 3, 2009
I am creating a chart using mxml. The mxml tags only create a chart with a horizontal axis and vertical axis. My result event handler has actionscript code that loops through the xml result set and creates all the series (line series and stacked bar). This part of the code works fine. Now I need to use the functionfill function to set individual colors to each series. All the examples I have found call the functionfill from within an MXML tag, like so:
[Code]...
View 1 Replies