Xml :: Flex ListCollection Iteration Concatenating Collected Values?

Dec 29, 2010

I am working in flex builder 3 with an XMLListCollection and have run into this (should be simple) parsing snag...The XMLListCollection Data:

<data>
<term name="NUMBERS">
<alt_form name="1"/>

[code]......

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Setting And Concatenating Variable Values?

Jul 24, 2009

I&#65533;m calling a ColdFusion page that generates output in the form of a text file to be used in a scrolling dynamic text field.So, Instead of calling a text file like so:

//calls a static text file
loadText.load("StaticTextFile.txt");
Im calling a ColdFusion page like so:

[code].....

View 1 Replies

XML :: Flex Sorting Of ListCollection Sub Elements

Aug 13, 2009

In a Flex webapp, is there an easy way to go about applying a sort to the children of an XML element, based on the children's attributes? Example follows below:

XMLListCollection:
<a anotherProp="ABCDE">
<e prop="AB">1</element>
<e prop="BC">2</element>
</a><a anotherProp="FGEH">
<e prop="HF">3</element>
<e prop="AD">4</element>
<e prop="AC">5</element></a>

I would like to sort the <e> elements, within each <a> element separately, according to their "prop" attribute. My code for generating the array containing the <a> elements is along the lines of:
for each(var node:XML in initialInput:XMLListCollection){
if(node.localName()=="a"){
//I was hoping to be able to sort the <e> children of the node variable here
xmlListCollectionVar.addItem(node);
}}

At the end I would like the <a>'s to remain in their defined order, but their <e> children to be sorted based on the "prop" attribute. So far if I try:
node.children().sort=someSortVar
Where someSortVar has its fields set to:
SortFields("e.@prop",...)
I get an exception about a null value. Any way to convert the children list to XMLListCollection, sort it and integrate it back into the node variable?

View 3 Replies

Actionscript :: Air/Flex Concatenating A Variable With A Property

Apr 8, 2010

I have three text boxes on the stage id=red, blue, green same as the keys in my
cars Object/Array

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code]....

So I'm thinking "tempObj.text" would equal red.text but I can't stick "tempObj" with ".text" is there a way this can be done?

View 1 Replies

Flex :: Recursive Iteration Through Every Component Instance?

Nov 17, 2009

I have various custom component instances in my flex app. I want to loop through them recursively and get their instance Ids. The recursive part is very important to me. I have tried doing this, but it didn't do recursive:

for each (var myItem:* in this.MasterContainer.childDescriptors)
{
trace(myItem.id);
}

View 3 Replies

Flex :: Function Be Garbage Collected Before Evaluating?

Jan 26, 2011

I have that function in the class:

private function fireItemCreated(data: ByteArray): void {
setTimeout(function(): void {
var event: ItemCreatedEvent = new ItemCreatedEvent(data);
dispatchEvent(event);
}, 1000);
}

This function called to dispatch item created event when image thumbnail created.But it delays event on some time to prevent user interface freezes. And I'm guessing what could be happen if garbage collector executes after fireItemCreated function call but before timer event. Does the closure will be removed or it stays until it will be executed?

View 1 Replies

Actionscript 3 :: Flex Spark Textinput Prevents Component To Be Collected By GC

Mar 28, 2012

I've got a custom component (quite complex so I can't post any code here, although that shouldn't matter), that I can add to a view. When the component is deleted from the view or the view is switched I call my own dispose method which removes remaining eventListeners and kills some references so that the component can eventually be nulled and collected by the GC.

All that works perfectly fine until I add a Spark TextInput to the MXML part of the component (it took me hours to find out what is preventing the component to be collected!), so I recon that the TextInput somehow automatically adds some eventListeners.

My question is what are these listeners, or is there anything else I haven't thought of?

View 1 Replies

Flash :: Flex - If An Object Is Garbage Collected Are The Reference Counters Of Objects It References Decremented Automatically?

Jun 20, 2011

I was thinking about Flash GC the other day and came up with a question about how reference counting would work in the following 4 class scenario (assume GuiMain is the movie's document class):

[Code]...

View 4 Replies

ActionScript 3.0 :: Concatenating A Class Name?

Sep 30, 2009

I have the following function which returns a string: cues.getCurrentCue(); returns: "Definition_1" Definition_1 is the class name of a movie clip. I would now like to do something like this:
 
var currentDev:String = "new " + cues.getCurrentCue() + "()";
def_mc = currentDev;
addChild(def_mc);
 
But I get the following error: 1180: Call to a possibly undefined method currentDev.

View 1 Replies

ActionScript 2.0 :: Concatenating Three Variables?

Jul 14, 2005

It's another simple problem that has me stumped.

x = 1;
y = 2;
z = 3;

[code]....

View 7 Replies

ActionScript 3.0 :: XML Get Node By Concatenating @ With String?

Oct 10, 2011

I need to get an XML node by using this syntax:

[pseudo code]
xml.node["subnode"].@string.children();
[real code where _xml is XML]
_xmlList:XMLList = _xml.cases["case"][@id == event.target._id].files.children();

And yes, case is a reserved word - therefore the brackets and quotes.

event.target._id is a string, but I can't seem to figure out how to concatenate the @ (at sign) with a string to get the attribute (or the node that corresponds to the attribute).

I've tried _xml.cases["case"].(@id == event.target._id).files.children();

But it doesn't work. How am I totally off in the wrong direction?

View 1 Replies

ActionScript 2.0 :: ComboBox Value Concatenating Instead Of Adding?

Jun 6, 2008

I'm trying the add the data value of a selected combo box item (.35) to 1 using:

var theFringe:Number = _root.calc.fringe.getValue();
_root.calc.fFringe.text = theFringe+1;

Returns: .351

Is there a way to convert the data from the comboBox to an integer so that when I add .35 +1 I'll get 1.35?

View 1 Replies

ActionScript 3.0 :: Show Steps Of An Iteration In It?

May 28, 2009

I did an ActionScript 3 version of my old algorithm made in c language to solve the �Tower of Hanoi� puzzle.

The problem is that I knew how to show the intermediary steps in c language but I don�t know how to do that in ActionScript 3.

The below .as file code uses just three disks of successive bigger diameters ( and different colors ) created as MovieClips in Flash which must move from the first peg to the third one, through appropriate moves, in such way that they end up piled up in the same crescent order as they were in the first peg.

The way the code is written just shows the beginning disks position and the end result but not the intermediary steps.

I want this code being capable to show the successive disks positions on the pegs in each step of the process, each time I right-click the mouse.[code]...

View 2 Replies

ActionScript 3.0 :: Pausing A Loop At Each Iteration?

Nov 30, 2009

I'm working on a script and I've run into a coder's writing block so-to-speak. I have an array of twenty object (with attributes). I want to loop through the array and for each object, update some text fields, create a tween, pause, and create another tween (i.e. fade in / fade out). I tried working with the timer class but the for loop, as expected, keeps on rollin' after the function has been called by the listener.

View 10 Replies

Actionscript :: Use For Variable As Parameter And Keep It Different For Each Iteration

Mar 25, 2010

I have a basic for loop to loop through buttons and set some stuff and onPress handlers:[code]However, as I noticed, all buttonsthen link to one and same frame - all point to last i + 1 - Is there any possibility to call gotoAndStop with "static" Number, so in next iteration, it won't change?[code]

View 1 Replies

ActionScript 2.0 :: How To Remember Iteration Numbers

Oct 25, 2008

I have this code.
for (i=1; i<6; i++) {
this.attachMovie("myMovie","unit"+i,i);
this["unit"+i]._x = i*100;
this["unit"+i].onRelease = function() {
trace("Unit number " + i + " was pressed");
};}
I want to trace the number (i) of the button that is pressed. But no matter what button I press, I always get the value '6' on my trace. Isn't there a way to store the a value for i in each movie clip attached?

View 3 Replies

ActionScript 3.0 :: Last Iteration Of A Loop - Buttons

Jul 30, 2009

i have this from as2, where i can create many buttons on stage and loop. then create a function that applys to all the buttons

Code:
for (var i = 1; i <= 3; i++)
{
bt = this["button" + i];

[Code].....

View 3 Replies

ActionScript 3.0 :: Stop Flash From Concatenating Strings?

Jan 6, 2011

I have an external interface call which I need to pass several values to. Each value has an indentifier string and the value itself.

Code: ExternalInterface.call("submitIUR", answers +"promo", promo+ "url", nextUrl); The problem is that when I pass this through to the javascript function, flash concatenates the identifier strings. So for example if promo is 12345 when passed through the "url" indentifier gets tacked on the end so I get 12345url.

Is there an easy way to separate out the variables being passed through to stop the strings being tacked on to the variables?

View 6 Replies

IDE :: Concatenating Text In Dynamic Field Of MovieClip

Dec 1, 2009

I'm writing a menu generating script. It's suppose to display arrays
and any inner arrays.
Ex:["test item",["item 1",["item 2","item 3"]],"item 4"];

These movie clips should be displayed if the actionscript is correct.:
test item
item 1 <---this of course, has a following subarray
item 4
and the submenu should display:
item 2
item 3

I run the script and it see's the inner array items ["item 2", "item 3"] and shows them in the next submenu -FINE---but what I get in the main menu to my surprise is 'run-on text' in the Dynamic field of that movieclip. ex:
test item
item 1; item 2; item 3 <---? seems to concatonate inner items in text field
item 4

I only want to see text "item 1" ....not the items associated with it as well.
(they are already displayed in submenu)

Code:
for (var i = 0; i < menuArray.length; i++) {
var menuItemName = "mc_menu_item_" + i;
if (typeof(menuArray[i]) == "object") {
this["mc_menu_box"].attachMovie("h_menu_middle_sub", menuItemName, tempLevel);

View 2 Replies

ActionScript 2.0 :: Addition - Get Two Numbers To Add And Instead It Is Concatenating Them Together As A String?

Mar 29, 2005

has anyone had any problems with addition? I'm trying to get two numbers to add and instead it is concatenating them together as a string, however when I multiply, divide, or even subtract them it works fine.

View 10 Replies

Component Can't Get Garbage Collected

Oct 18, 2010

I just noticed a strange behaviour while looking at my application in the Flash Profiler. When I click a button in my TitleWindow then the TitleWindow doesn't get garbage collected after it is removed. I have no idea why that is happening.[code]...

View 2 Replies

ActionScript 3.0 :: Objects Not Being Garbage Collected?

Jul 21, 2009

I have checked and rechecked, and I do not know why these "buckets" aren't being killed when I run the reset menu function, a fresh set of eyes could really help.

Code:
package com.Views {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;

[Code]...

i'm sure there are a lot of problems, but the only one I care about is destroying those buckets. inside the buckets, I have a listener for "removed from stage", and that kills all the listeners, etc, inside the buckets.

View 4 Replies

ActionScript 3.0 :: How Would These DisplayObjects Be Garbage Collected

Feb 3, 2012

there is a Class A, it has a timer which updates its x position periodically. So all the instance of Class A will update their own x position. There is another Class B which extends Class A and overrides the function which updates position to change y position and call the trace function.

Now what I do now is create two instance alpha1, alpha2 of Class A and other two instance beta1, beta2 of Class B.

- alpha1 is only instantiated, but not added to the stage.

- alpha2 is instantiated, and there after added to the stage.

- beta1 is only instantiated, but not added to the stage.

- beta2 is instantiated, and there after added to the stage.

- let say after few seconds, I remove alpha2 and beta2 from stage.

Now suppose the GC fires collection, who all would be collected ?

View 1 Replies

Arrays - Make For Each Loop Dynamically Depth Of Iteration?

Mar 24, 2012

I hope I am clear enough. My data set is populated I have

comment:CommentVO;
comment.replies=[comment:CommentVO,comment:CommentVO,comment:CommentVO];
_comments:Array = [comment:CommentVO,comment:CommentVO,comment:CommentVO]

I've correctly populated my _comments Array and the replies array in my CommentVO Obj.

[Code]...

View 3 Replies

ActionScript 2.0 :: Use Iteration To Reference Each Array Name To Pass It Into A Function

Nov 12, 2004

In AS2 I have several arrays constructed like this :

var myArray0:Array=new Array(value,value,value...)
var myArray1:Array=new Array(value,value,value...)
var myArray2:Array=new Array(value,value,value...)
var myArray4:Array=new Array(value,value,value...)
...

What I'm trying to do is use iteration to reference each array name to pass it into a function.

[Code]...

View 2 Replies

ActionScript 3.0 :: Creating Variable Named By Concatenating Two Array Elements.

Oct 2, 2009

A snippet of my code is [code]The first element in the mainOptions Array is linked (metaphorically) to tab1.The second element in the mainOptions Array is linked (metaphorically) to tab 2 and so on.I want to create 12 variables named AudioMP3, AudioHEAAC, NewsBBC, NewsTwitter, VideoVideo and so on down to PicsPics2. i.e concatenate each entry in say tab1 through 5 to the each element from mainOptionsArray and make a new variable using that name then assigning a number to this variable.[code]

View 1 Replies

ActionScript 2.0 :: Build An Uploader That Will Take Data Collected?

Jan 15, 2009

This is the situation: I am trying to build an uploader that will take data collected earlier in the form before the upload occurs and then rename the uploaded file with it. I've gotten the upload itself to work, but thus far I have no luck getting any sort of renaming to work, not even by PHP. I tried Loadvars to transfer the variables over and rename it during upload, yet it says "NO" and rejects the post variables when the upload occurs. I even tried loading the variables into an external file and transfering them back to the uploader via cookie, all at the same time. Again it says "NO!", and the file is uploaded as __"filename".jpg. This is my code thus far:

[Code]...

View 1 Replies

Actionscript 3 :: Test To See When Variable Has Been Garbage Collected?

Feb 20, 2011

I'm trying to set up a test that will tell me whether a variable exists in memory or not. I'm running into the problem of my nested function preserving the local variable it uses, called "shouldBeDead". Here's my best effort, which doesn't work for me because the "shouldBeDead" variable is still alive[code]...

View 4 Replies

ActionScript 3.0 :: Check When Object Really Has Been Garbge Collected?

Jun 13, 2010

I'd like to know for sure that my objects are deleted when I 'null' them and remove listeners etc..

I'm not sure if the debugger in CS4 has a way to display that kind of info. Is there some other way?

View 4 Replies

ActionScript 3.0 :: Thumbnail Tween Getting Garbage Collected?

Jul 13, 2010

I recently posted on here about tweening in alphas of thumbnails that I was adding to a movieclip. It seems that the tween is getting garbage collected because not all of the thumbs fade in all the way. I have the tween defined outside of the function, but it is tweening a loader that is created within the function. Could this cause the tween to get garbage collected? if so, how do I fix it?

Here is the pertinent code:

var thumbTween:Tween;
var my_thumb:Loader;
function thumbLoaded(e:Event):void{

[code]...

View 1 Replies







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