ActionScript 2.0 :: Loop Through Children In MovieClip And Get Values

Nov 8, 2009

I have a movie clip (mc_moviegroup) which is made of a group of many dynamic text fields. I want to loop through the dynamic text field children of mc_moviegroup and pull out their text values in a string. Does a movie clip have a property which gives the number of it's children movieclips?

View 2 Replies


Similar Posts:


ActionScript 2.0 :: RollOver & RollOut In Children's Children's Movieclip?

Jan 11, 2010

I want to have a rollover effect of a movieclip (mo1) inside a movieclip (mo) of another movieclip (popup1).Is it possible to do that? I try calling it using this code in the frame 1 of my flash, am i doing wrongly?

Code:
popup1.mo.mo1.onRollOver = function() {
popup1.mo.mo1.gotoAndStop(2);

[code]......

View 9 Replies

ActionScript 3.0 :: Add All Values From Xml.children()

Sep 1, 2010

I have an xml of numbers that I am using to power some dynamic bar charts..
 
I can easily pull out a string of all node values for variable area (SQMI)
 
trace(stsXml.Records.Record.SQMI.children());
 
the trace result looks like this
 
6729014724597803833449707411067084872157776104101113713121757
 
these values do not appear to be seperated but I am hoping they are (there should be 11 unique values here).
 
How can I sum the 11 values as extracted from my XML?

View 2 Replies

ActionScript 3.0 :: Loop With Varying Values Depending On Where Are In The Loop?

Jul 20, 2009

I have need of loops / nested loops that pick different figures depending on where you are in the loop. The whole function needs to run through 'ml' times. 'ml' is a dynamic figure. Loop 1 = While the loop is within the first 12 iterations, 'exconemp' must equal 100. For iterations 13 - 24, 'exconemp' must equal 102.5, for 25 - 36 it will be 105.06, for 37 - 48 it will be 107.69. This needs to change every 12th iteration until it has reached 'ml'. The calculation takes the value of the previous 'exconemp' and then multiplies that by 0.025.

Loop 2 = While the loop is within the first 120 iterations, 'abc' must equal 0.015 and any further iterations must use 0.01. This must also work in a way to figure out whether 'ml' is higher or lower than 120 and work accordingly. My main issue is this - how do I get the loops to run through as this: While the iteration is < 12, do this, THEN take the final figure (12th iteration) and start on 13 - 24, do this THEN etc etc. How do I produce a THEN statement? I can get the code to pick up the final values, but not change along the way.

[Code]...

View 6 Replies

ActionScript 3.0 :: Prevent Children From Shrinking To Infinitesimal Values On MouseEvents?

Feb 5, 2011

I have the following code:

[Code]...
 
The problem I'm facing is not with loading the content of the Movie Clip, (though I might experience issues with that later when I try to load dynamic swfs) because as for now I just have placeholders on frames.
 
What I want to know is why my red squares on the left navigation keep getting smaller as I repeat the MouseOver and MouseOut events.  It doesn't seem that these squares follow the logic of the code the way I have written it.  Some of the code was generated from a previous post with the help of contributors.
 
Now I have again hit a slight snag with coding the math properly.  Initially when I tested the code it worked fine without any "shrinking" going on.  However, now with more code added the red navigation squares don't bounce back to their original states, they just keep getting smaller.

View 10 Replies

Flex :: GroupingCollection: Loop Through The Children

Nov 13, 2009

I am using a GroupingCollection to bind my advanceddatagrid. I have used groupingcollection to group the data by date.

Now I need to select the data in the datagrid through the code. I need to loop through the adg's dataprovider and select the item that matches the criteria for the selection.

View 2 Replies

Flash :: Loop Through Children And Display Each - As3

Mar 30, 2010

How do I loop through all of my children, and display each? I would like to know the best way to do this. my children and containerfive children, one plays every sec, 1,2,3, etc.

[Code]...

View 1 Replies

ActionScript 3.0 :: Calling On Children Through A Loop And Using E.currentTarget

Aug 25, 2010

I have a number of MC's that I've assigned listeners to through a loop that references an xml table.
 
//create listeners for all biketrails mc's and designate functionsfunction createListenersbk():void{for(var i:uint=0;i<bktrlXml.row.length();i++){var mc:MovieClip =

[Code].....

I thought I'd be able to replicate the above code and somehow refernce the "idlink" children through the e.curentTarget. 

View 1 Replies

Flash :: Loop Through Children In MXML View?

Mar 5, 2011

I have mxml component and want to go through all its children, that I've created in it and not to go deeper. For example I have this view:

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

[Code].....

View 1 Replies

ActionScript 3.0 :: Loop Through Children And Add Them Instance Names?

Jan 14, 2010

how could I make a simple loop which loops through the childrens of specific movie clip and add each of them instance name lets say "iname", since I have movie clip in which childrens are not added by code.

And if I'm sure I could acces those childrens then by code like iname.x = 100?

View 6 Replies

ActionScript 3.0 :: Add Children To These And Tween Them With A Loop In Function?

Sep 13, 2010

so on my main stage I have clips that are placed with AS.

container.1
container.2
container.3
and so on....

I am trying to add children to these and tween them with a loop in this function.

[Code]...

View 4 Replies

Actionscript 3 :: Modify Position Of Children Inside Loop?

Mar 3, 2010

I'm trying to make a dynamic image gallery from and xml. From my tutorials, right now i've got it so it will constantly add the next thumbnail below the other, which is fine, but I'm trying to figure out how to make it that once it reaches a certain y coordinate, it will move the x coordinate over and stack them again. So that rather one long list of thumbs, it will be a side by side stack. For some reason, I can't get it in my head how something like this would work. My goal is to have a side by side stack that I will end up putting in a movie clip that will be masked to show only 2 stacks at a time. Then when clicking a button will slide it over. I was planning to use the "movieclip.length" to calculate how far over to move it, but i haven't gotten that far yet. This is what I got:

[Code]....

View 1 Replies

ActionScript 3.0 :: Controlling Multiple Children Created In For Loop?

Nov 15, 2011

So I'm working on a Flash version of the old "Robots!" game. In case you're not familiar: the game lays out a number of robots on a grid (number varies by level), and drops the player in the middle. As the player moves around the grid, the robots all move towards the player one grid space per player move. The object is to destroy all the robots by making them run into each other (or the rubble left from previous collisions) without letting a robot run into you.

Anyway, my robot hordes are being created on the stage through a "for" loop, and each icon is a child of variable "evilBot" which references a library item with the class name "enemy."

ActionScript Code:
function placeBots():void{
for (var c = 0; c < numBots; c++){
evilBot = new enemy;

[Code]....

I've run a trace on "evilBot.name" and verified that the children are being given instance names of "evilBot0, evilBot1 ..." and so on. But no matter what I try, I can't issue instructions (regarding movement, orientation, etc) to individual children.

Using a for loop and "this["evilBot" + x]" returns a "term is undefined" error.

If I store the instance names in an array (named "botName") and use "evilBot.name[botName[x]]", I get the error "Property evilBot0 not found on String and there is no default value."

View 9 Replies

ActionScript 3.0 :: Xml.children() Returns Grand-children And Gr8-gran-children?

Nov 18, 2009

I'm making a OSX-finder-type file browser in CS4.The Structure for the folder and files is being generated by a PHP in a XML, heres an example:(sorry the xml is not sorted, but the command i'm using in php doesn't sort it)

Code:
<root>
<dir name="images">

[code]....

View 2 Replies

Flex :: Elements - Loop Over Children Of A Container When They Are State-dependent?

Aug 17, 2011

Flex's new States re-parents visual items that are marked with includeIn/excludeFrom. If I have a Group (MainGroup) with 5 children/elements that are state controlled, is there still a way to get a reference to MainGroup's children? mainGroup.numChildren and mainGroup.numElements don't work since the children are re-parented. At best, they show 1.

<s:states>
<s:State name="view1State" />
<s:State name="view2State" />
<s:State name="view3State" />

[code]....

View 4 Replies

ActionScript 3.0 :: Loop Through A Display Object And Reset Their Children's ChildIndex Based On Their Y Value?

Sep 5, 2009

Would it be possible (Without being extremely inefficient) to loop through a display object and reset their children's ChildIndex based on their y value?

View 1 Replies

ActionScript 3.0 :: Resize Movieclip Without Stretching Movieclip Children?

Nov 16, 2010

Is it possible to resize a movieclip without stretching the contents of the movieclip??? I'm having the most frustrating time trying to do this.

View 5 Replies

ActionScript 2.0 :: Loop With Two Values?

Nov 13, 2011

I want to do a loop of this

Code:
t_1=parseInt(mcArray1[0]);
t_2=parseInt(mcArray1[2]);

[code]....

View 3 Replies

ActionScript 2.0 :: Copy MovieClip With His Children Movieclip ?

Jul 29, 2009

when I have one movieclip mc1, mc2 is child movieclip in mc1. How can i copy mc1 to mc1_1 with all children movieclip ? if i use attachMovie or duplicateMovieClip, i only copy mc1 without mc2.

View 3 Replies

Actionscript 3 :: Loop Over Array With Xml-values?

Dec 7, 2011

So I have an array, which consists of xml-values. I want to check a node from each array entry. I've tried reaching xml-values as such:

var eventArtists:XML;
for each (xmlEvent in arEvents)
{

[code].....

View 1 Replies

Actionscript 3.0 :: Loop Not Incrementing Values

Apr 24, 2010

I've solved this problem in AS2 but I can't seem to sort it out in AS3.[code]...

View 1 Replies

ActionScript 2.0 :: Storing Values Using Loop

Apr 18, 2008

I have five buttons on stage and I simply want to trace "1" when I click the first button and trace "2" when I click the second button and so on.I am always getting the last number and cannot figure out, how to store the values.

View 4 Replies

ActionScript 2.0 :: Variable Button Values In Loop?

Mar 15, 2010

I have a query regarding assigning values to buttons in a for loop, I will explain:This is a string which I want to assign to a button value via getURL:

var myURL = "http://www.mywebsite.co.uk" + "/?Group=" + mySharedObject.data["destination"+i] + "&" + "SearchType=654&" + "Target=offers&" + "Paging=on&" + "HotelName=" + mySharedObject.data["hotel"+i];

[code].....

View 1 Replies

ActionScript 2.0 :: Output Values For Buttons In Loop?

Jan 13, 2009

I have this little loop that creates buttons. My aim is to change value of variable 'thevalue' on everytime button is pressed, first button should give value 0, second 1, third 2 and so on.

Code:
for (jo=0; jo<xmlData.firstChild.childNodes.length; jo++) {
value1= xmlData.firstChild.childNodes[jo].attributes.value;
_root.attachMovie("button", jo, (1000-jo), {_x:20, _y:20+(jo*20)});

[Code]....

View 2 Replies

ActionScript 2.0 :: Build New Array From _width Values In Loop?

Sep 9, 2007

I have a bunch of thumb mc instances on my stage, using the same mc symbol. They're all sized differently so the widths(which are same as heights) vary.I want to be able to access their width value from an array independent of all the scaling I'm doing with rollovers. That is, I need to have each mc instance's original width accessible from anywhere in my code.The simplest way to do this is to hard code an array, like:

var Twidth:Array = new Array();
Twidth[0] = "33";
Twidth[1] = "45";[code]....

But since I have 22 thumbs and several portfolios, and want the option of changing their original sizes on the stage, I want to create the array above on the fly using information in a loop. For instance, I already have a loop in a function called generateThumbs(). Here's what I've tried:

for (var i = 0; i<total; i++) {
Twidth = new Array();
Twidth[i] = this["thumb_mc"+i]._width;[code]....

for trace on the first method, replacing 'i' with the key I want (Twidth[2]):

undefined
undefined
45
undefined
undefined

As you can see, this gives me non-indexed non-delimited value for the whole loop (the actual in my real movie is 22). There's no length or array because its actually just one value. Entering a number in the key will display a bunch of undefined with one defined. I have no way of extracting that one key without getting all the other undefined values.my question is: How do I put 'this["thumb_mc"+i]._width' values into a loop with each value indexed for the rest of my functions to access?

View 2 Replies

ActionScript 3.0 :: Loop And Create New Arrays From Each Of The Values In The CategoryArray?

Mar 23, 2009

I have a array of categories, for e.g.

var categoryArray = new Array('value1', 'value2', 'value3');

I would like to loop and create new arrays from each of the values in the categoryArray I tried...

for(var i=0;i<=categoryArray.length-1;i++){
this[categoryArray[i]] = new Array();
}
value1[0] = "dsfsdf";
trace(value1[0]);

It doesn't seem to work.

View 3 Replies

Actionscript 3 :: Flex In Construct When Modifying Loop Source Values?

Dec 9, 2009

DISCLAIMER: relatively new to Flex/AS3, I might be missing something obvious. After doing some research it appears that using the for(var property:String in object) does not guarantee the enumeration order of properties, however it doesn't say anything about modifying the VALUE that property points to as changing the for...in loop.

[Code]...

As a solution I can create a temp object to store the data while doing the loop on the original object, and then replace the original object with the modified data, but I'd like to know what exactly is going on.

So my question is, does the value of object property modify the looping order of the for...in construct? And if so, should it or is this a bug?

View 3 Replies

ActionScript 2.0 :: Loop - Extract The Individual Values From A Nested Xml Node

Mar 4, 2007

im having problems with a nested loop. i found some post here, but they didn�t help me. i need to extract the individual values from a nested xml node. i simplyfied the xml.
this is the code:

[Code]....

View 1 Replies

ActionScript 2.0 :: Pre-calculate The Perlin Noise Values And Then Loop Through It In An OnEnterFrame

Mar 9, 2007

i got this perlinnoise called function and movieclip.filter = [displacementMapFilter] inside a onEnterFrame and it's eating me at 100 percent. are there any substitutions for making it much less processor intensive? I'd like to show a picture rippling and i'd like to use perlinNoise. Is there a way i can pre-calculate the perlin noise values and then loop through it in an OnEnterFrame

View 7 Replies

ActionScript 3.0 :: Adding Previous Numeric Values In Array During For Loop?

May 23, 2009

While a for loop runs through all the elements in an array I want to get the width of each element and add it to the sum of the width of all previous elements.

View 2 Replies







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