change mc's rgb values using array?

FLASH

    Next

  • 1. set antialiased font in html?
    Hi, I am trying to set two fonts in one textfield via html-tag <font>. On the textfield I put two fonts, but only the one defined in the first character seems to be antialiased. I also have both fonts defined in the library for import. thanks for any help
  • 2. Multiple domains in System.security.allowDomain()
    In a portal I have to script a Flash 7 object that loads from a different domain. To do this I have to use the System.security.allowDomain() command. But since my portal consists of many domains, do I really have to add all the domains to the allowDomain() function or can I add * domains. I need to do something like: System.security.allowDomain("*.blablabla.bla"); instead of System.security.allowDomain("test.blabla.bla", "test1.blabla.bla");
  • 3. what buttons can do, movie clips cannot?
    After reading about buttons type symbols, I still cannot understand what buttons can do, movie clip with action script cannot. Could someone enlighten me on that?
  • 4. flash + vb.net
    Hallo all, This is about the white space in the dropdown menu ??? I had developed a drop down menu in flash to use with vb.net, In vb.net, I had given the wmode property of the flash has transparent. But I am getting white space below my flash file, how to avoid these white space in flash. I had done this technique in html pages, but I don't know how to do with vb.net. I had also read document on " Macromedia Flash and VB: A Potent Combination ". But no information is given about this ? Can you help me in this ??

change mc's rgb values using array?

Postby vidiwell » Tue, 24 Aug 2004 20:54:22 GMT

I'm trying to use an array to change the rgb value of a mc each time
it loops. I have 6 elements and would like it to use each one
sequentially and then start over again from 0.

I've tried several variation on this, but know I'm missing the point
each time as I'm not quite up to speed on actionscript yet. I've tried
to look everywhere for an answer to this on the web, but with no luck
so far and I'm sure the answer is very straight-forward.

So far I have:

colorz = new Array(0x36047B, 0x4B05AB, 0xD3B5FD, 0xAA6FFB, 0xE8D8FE,
0x6506E6);
newcolorz = math.random(colorz);

my_color = new Color(_root.screenz.prodplace);
my_color.setRGB(newcolorz);



Any advise appreciated.

Steve.

Re: change mc's rgb values using array?

Postby vidiwell » Fri, 27 Aug 2004 18:42:48 GMT

I've also been trying this, but still with no luck:

myArray = new Array();
		myArray[0] = 0x36047B;
		myArray[1] = 0x4B05AB;
		myArray[2] = 0xD3B5FD;
		myarray[3] = 0xAA6FFB;
		myArray[4] = 0xE8D8FE;
		myArray[5] = 0x6506E6;
colorz = random(myArray);
newcolorz = colorz;
my_color = new Color(_root.screenz.prodplace);
my_color.setRGB(newcolorz);
stop();


Any advise appreciated,

Steve.

Re: change mc's rgb values using array?

Postby place57 » Sat, 28 Aug 2004 02:18:37 GMT



Maybe colorz = myArray[random(6)];

Re: change mc's rgb values using array?

Postby vidiwell » Sat, 28 Aug 2004 18:37:52 GMT

Thanks for replying, Bob. 

That worked greator a random element, Bob. Thing is though, how can I
return a unique, incremental element from the array each time the mc
loops? I've looked everywhere for a tutorial on this.

eg:

myArray[0]
//returned first loop
myArray[1]
//returned second loop
myArray[2]
//returned third loop
myArray[3]
//returned fourth loop
myArray[4]
//returned fifth loop
myArray[5]
//returned sixth loop
myArray[0]
//returned seventh loop etc, etc




Steve.

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



Return to FLASH

 

Who is online

Users browsing this forum: No registered users and 83 guest