ActionScript 2.0 :: For + Array + Property + Variable?
Jun 9, 2004
im doing a loop to attribute the values to _x property, and use it to make random movimets with movieclips.i ve got 16 movieclips in my stage, named b1, b2, b3....b16 and the code is
Code:
count = 0
chama = setInterval(function () {
count++[code]....
so... after 3 time that setinterval execute this function, i�d like to call a function to get this movieclips, in their current positions and take them in especifics positions on stage.so I created an Array and I�m trying to use this code to define variables with values from the Array, and make a moviment to the especifics positions
Code:
xC = [63.9, 16.95, 45.85, 65.55, 18.75, 26.2, 55.85, 55.25, 28.85, 21.95, 36.6, 35.75, 14.7, 45.7, 14.45, 60.75]
function cPos () {
for (a=1; a<=16; a++) {[code]...but it�s not working...why??what can I do to Take the variables inside the array and use them to respectives movieclips b1, b2....b16?
View 2 Replies
Similar Posts:
Aug 16, 2011
I think it would be simplest to explain it like this:
[Code]...
View 1 Replies
Oct 12, 2006
I'm going to post the full code of the two functions, disregard the "fluff" unrelated to the two functions as it is all working flawless, I've tested this HEAVILY and cannot understand why it keeps setting the entire array to undefined!
Code:
// processReplace Function
function processReplace(transferFiles) {
var processArray:Array = transferFiles.slice();
[Code]....
Basically it's supposed to check to see if the file exists and return as true if it does and add it to a replace array, then the replace array is processed into a single string and put into a dialog box through the flash wrapper prompting them to "replace the files or not".
It makes the replace array just fine, it actually even has the right "count" in it but it's setting all the "filenames" to undefined because of the exists = processSearch function.
I even tried to make a new array and run the search just from that one and set the values from the old one and it's still failing.
Is it because of the "break" or can anyone figure it out? Iknow it's hard because you can't use the code
View 1 Replies
Aug 25, 2008
I want to change the value of a variable listed in an array using the array. for example:
Code:
var theVariable:Number = 15;
var theArray:Array = [theVariable];
now if I try this
Code:
theArray[0] = 20;
I just get an array with 1 value of 20 in it and it no longer references theVariable what i want to do is change the value of theVariable with out removing it from the array but referencing it from the array in a loop or something.
View 5 Replies
Jan 25, 2009
How do I assign a property to a variable? For example, say I want to change the alpha of a clip named "theClip":I tried:
var theAlpha = theClip.alpha;
theAlpha = .3; THis doesn't work.
View 6 Replies
Sep 25, 2009
I want to loop through an array and use the array value to reference a variable.
The Setup:
(For illustration only. Not actual script)
My MCs:
triangle_mc
square_mc
[Code]....
View 1 Replies
Aug 24, 2011
basically i want to populate an array with some data, photoArray[count]= varLoader.data.nombre; the problem is that "nombre" is suposed to be a variable, this is inside a loop and i have "nombre = "pic" + count;" before it, but it wont work, how am i suposed to call it?
View 3 Replies
Aug 10, 2011
I build an application that need httpservice feature. This application will be deployed at some computer. So, I don't have an idea to set variable at url property.
<mx:HTTPService id="personRequest" url="[URL]" useProxy="false" method="GET" resultFormat="text" result="personJSON(event)">
<mx:request xmlns="">
<getPerson>"true"</getPerson>
</mx:request>
</mx:HTTPService>
I already try with block {}, but no use. Can't I set a variable at property url mx:HTTPService?
View 1 Replies
Mar 28, 2012
I'm wanting to set an Object property using a variable value. I just can't get it to work as it assumes the variable name is the name of the property: I've simplified the issue rather than posting my whole code.[code]It always applies 'attrName' as the property name rather than the value of 'attrName'.Tried loads of things but just can't get it to work.
View 1 Replies
Jul 10, 2009
contactButton_mc.contentLoadTarget = loadContactForm();
How do you write this code so it works and doesn't run the funtion? I want to associate the function with the button so I can load it dynamically with event.currentTarget. Played with storing the funtion in a another variable but wasn't sure how to do that either
View 3 Replies
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
Oct 8, 2010
I'd like to use a variable I'm pulling from XML to compleet a property like so[code]...
I could of course construct some large switch statement to account for every blending mode, but why wont this work - and how might it?
View 2 Replies
Apr 26, 2011
ActionScript Code:
var object:Object = new Object()
var counter = 0
[Code].....
Can you really not pass a variable into an Object property?
View 3 Replies
Feb 11, 2012
[Code]....
I keep getting this message <b> Left side of assignment operator must be variable or property</b> How can I get around it?
View 2 Replies
Dec 3, 2010
I need to create variable object property names for use with the data grid component.
This works: data = new Object(); data.some_name = "the data";
But this does not: data = new Object(); colName = "some_name"; data[colName] = "the data";
View 3 Replies
May 16, 2011
I would like to bind a variable from my ActionScript to a property of a component that is in a ItemRender. But I always get this error:
1120: Access of undefined property currentRoom.
Here is my code
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:solutionItems="com.barco.components.ControlRoomConfigurator.solutionItems.*">
<mx:Script>
[Code]....
I would like to use the object currentRoom in my ItemRenderer component.
View 2 Replies
Jul 12, 2011
I'm trying to change a static variable in the class's constructor. At the start I have:
public static var mainReference:Main;
public static var timerReference:Timer;
public var timer:Timer = new Timer(1000);
This is so my static functions can access main and timer. At Main's constructor I have:
mainReference = this;
timerReference = timer;
The problem is, the first gives no error when I compile it, but the second tells me Access of undefined property (timerReference).
View 1 Replies
Aug 19, 2011
Assign an event listener to a protected timer variable in the parent class.
I am working with Adobe LCCS, and created a BatonProperty which implements Baton
Now, Baton has a protected timer variable declared like this, and for some reason, I am unable to get access to this _autoPutDownTimer, from a BatonProperty instance.[code]...
View 2 Replies
Aug 3, 2010
so I'm trying to create this array property inside an object. here's my class:
[Code].....
what's been frustrating me, is that when I trace city1.adjacentNodes[0], what I get is 200 (the value of what's supposed to be in city2.adjacentNodes[0]). It's as if the last value that was entered to the last object's property overwrites all adjacentNodes property in all Node object..
View 2 Replies
Nov 1, 2010
How to set or get the property of any object in an array. For Example:
ActionScript Code:
import flash.display.MovieClip;
import box;
import flash.events.Event;
import flash.events.MouseEvent;
public class temp extends MovieClip {
[Code] .....
How can we set or get the value of any object in an Array
View 5 Replies
Jan 27, 2011
Sorry if the title is a little confusing. Here's what I meant - I have an array and and object. Let me give a visual:
This is my object:
obj["id"] = ["1","2","3"];
obj["name"] = ["na","no","ne"];
my itemArray:
itemArray = ["id","name"];
[Code]....
but it doesn't work. How do I actually use the arr[i] variable in the array? :s
View 1 Replies
Jan 30, 2012
I'm using flash cs5.5 and i got the fallowing error:Left side of assignment operator must be variable or property_loc2.__set__counter(++_loc2.__get__counter());This is the line witch don't work.But to be sure you understand,i will add the whole script,is for a game, this error causes the text ballon don't work.
class com.clubpenguin.ui.balloons.BalloonManager extends MovieClip
{
var _shell, _engine, _interface, attachMovie, onEnterFrame;
[code].....
View 1 Replies
May 20, 2011
I have spark States declared in mxml. I also have a class with string constants. I want my states names to match the string constants. Is it possible to do that directly in mxml and how? [code]...
View 1 Replies
Feb 25, 2012
I am trying to assign true/ false using for loop
for (i=1;i<31;i++){
_global.level + i + Access = true;
}
and got error as "Left side of assignment operator must be variable or property"
View 3 Replies
Dec 22, 2004
i'm creating a completely dynamic form. i want to assign a variable name to a textfield and then pass that variable with a LoadVars() object.
here's a small piece of code i can't get working:
//create movieclip (used like a form)
_root.createEmptyMovieClip( 'dialog_body', 0 );
//create textfield input
[Code].....
bottomline: if i create a textfield using the traditional method and assign the 'var' it works fine. if i create a textfield dynamically at run time, and use the *.variable property, the variable is NOT sent..
View 2 Replies
Mar 14, 2009
I'm pretty new to AS3, using Flash (CS3) to build applications for my university degree. In my movie I've got an array (completionArray) with 7 values, which are set to all be "false". What I'd like to be able to do is use the contents of this array to switch GUI elements on and off.As an example, I've got a movie clip called cowItem on the stage. I'd like to use the first value in the array to set the .visible property of that movie clip, but I can't for the life of me work out how to get it to work.[code]Like I say, I'm new to AS3 and haven't tried using variables as part of a property before, and I also have a similar problem using variable values as part of a method call.
View 3 Replies
Dec 10, 2011
Okay, very simple: there is an array containing 3 objects. Each object has a unique property called "ID" with values of either 1, 2, or 3One of the objects gets deleted.The objective now is to update the ID property of each object corresponding to the new array.length valueSo for example, the object with ID of 2 got deleted. The remaining objects in the array would each have ID values of 1 and 3 respectively.o the objective is to loop through the array and update the ID properties to 1, and 2 (instead of 1 and 3)
View 2 Replies
Sep 20, 2009
What (if any) is the correct way to access a property within an array of objects to sort upon. for example:
mySprite = new Sprite();
mySprite_child1 = new Sprite();
mySprite_child2 = new Sprite();
[Code]....
How would I get to mySprite.mySprite_child1.x (or any of mySprite_child1 properties) as the sort variable?
View 3 Replies
Nov 28, 2010
The behaviour looks little weird for me and dont know how to get valus through static property from an array:
[Code]....
but if I initialize missions with values not in the construtor but through variable initialization I gets output = 4; why is that? Doesnt static class initialize its variables in the constructor statement??
View 3 Replies
Feb 5, 2012
I have an array of Widgets and each widget has it's own Date property already set to the Date it was created. I'd like to know if there is an easy way to sort the items in my array according to latest first.
View 1 Replies