Similar Threads:
1.Set mc._x property value from an array
Im trying to import x and y points from a external file ("getDevices.txt") and
use them to position a new MovieClip from the library in a loop.
I know I could be using _root.attachMovie("box", "box_mc"+i, 110+i,
{x:something, y:something});
I've just been playing with this all day and tried many different methods, but
still no luck. I think my problem may be in the setup of the array and not how
its presented to _root["box_mc"+i]._y
Because if I create a new array like ypos = new Array(20, 40); it worked
The Actionscript code (Cant seem to find any tags, so I just used Quote)
//get devices and loop through
var mydevices:LoadVars = new LoadVars();
mydevices.load("getDevices.txt");
var ypos = [];
mydevices.onLoad = function() {
for (i=0; i<2; i++) {
//ypos = new Array([this["y"+i]]); //How is this different as
oppose to the next line?
ypos.push([this["y"+i]]);
trace(ypos);
_root.attachMovie("box", "box_mc"+i, 110+i);
_root["box_mc"+i]._y = (ypos);
}
};
I get the values 400 and 200 in the output screen, but need help assinging
them to the objects x and y position.
This is the contents of the text file
&NumofDevices=5&animal0=cow&y0=400&x0=-50&animal1=horse&y1=200&x1=300
Any ideas? where are the AS tags in these forums?
-Jason.:confused;
2.My Array battle (change value)
3.change array value
I have put together a thumbnail scroller with the help of a great tutorial on
kirupa.com. Now when a thumb scrolls far enough to "fall off" the left side I
want to change that thumbnail. I have an array of 10 spaces and 19 thumbs to
choose from so when array[0] falls of, I want to replace the movie clip in
array[0] with another value. My thunbnail setup function is attached and is
called when flash loads (after xml load based on xml values) and a for loop to
10 creates the first ten thumbs and sets them to the array. I have tried
.clear() and .removemovieClip(instancename) to no avail. any ideas out there?
function thumbnails_fn(k, m) {
thumbnailmcArray[m].createEmptyMovieClip("t"+k,
thumbnailmcArray[m].getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
//target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
navigate(k);
};
target_mc.onRollOver = function() {
this._alpha = 50;
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc"+m+".t"+k);
}
4.Change value of variable in array
I'm working with a prebuilt form component that uses several other components
on the stage to pass values to a php page. The problem I'm having is I need to
pass a couple of values to a prebuilt array that is comprised of variables. How
do I set the value of a variable that is already in an array?
5.Storing a Array in Variable & getting it's value using eval
Hi All, I'm creating a tip component in which I took the text as variable and
getting it's value using eval(componentVarName) and displaying it as tip. it's
working fine. But in a file in which I'm getting all of my data from a XML
file and storing all the XMl nodes in to an Array. When I'm giving the array
(_global.XMLarr[0].dataNode[1]) in to the parameter of component, I'm not able
to get it's value using eval(componentVarName) in which I've stored the array
variable name. So can anyone help me in this regard. My basic problem is-- I
want to save the array in to a variable and call it's value using eval for that
variable. Kindly help me. Dummy code (having problem) by which you can be more
clear about my problem is attached
// create a component having a text field in it with the name a_txt
// in component defination add a new value with variable name txtName
// place two copies of this component on the scene & in parameter of each
component asign the var1 & var 2 respectively
// this code is to be written on timeline action of scene1
// this is var1(_global.abcd)
_global.abcd = "dsjks djksa askdj uirqy urewr, hwrer wekjrwer werkjwer
wekjrwekew"
arr = new Array()
// this is var2(_global.arr[0])
_global.arr[0] = "u ierwrgwe hwkghwe rwghj kjgvhgfew gfre wnfj"
// this code is to be written on timeline of the component
a_txt.autoSize = true
a_txt.text = eval(txtName)
// in case of var1 it's working fine but in var2 it's not working
6. Retaining RGB values in .ai export from Flash CS3
7. Retaining RGB values in .ai export from Flash
8. ... taking rgb value from txt file