|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Call instance name from array or variable.
Maybe an easy one, but I can't figure it out.
How do you call a instance name or movieclip name from a variable or array. For example I want to move certain movieclips. for(i=0;i<6;I==){ movieclip[i]._x = movieclip[i]._x + 5; } and it moves the six movieclips. I tried naming the movieclips "movieclip0 thru movieclip5" and "movieclip[0] thru movieclip[5]". But neither seems to work. Also, I need to figure out how to make it move all the movie clips after the one being called. Like in an on release command have it move all the ones after it. i.e. MovieClip[2] moves MovieClip[3] thru MovieClip[whatever]. But I want it to do it dynamically. Cause there are alot of movieclips. (Sorry if this is just psychotic rambleing) Any suggestions would be great, Thanks
__________________
Travis |
|
#2
|
||||
|
||||
|
Your for statement has a syntax error (unless it's just a typo) it should be
Code:
for(i=0;i<6;i++){
__________________
No problem is so complex that it cannot be resolved with the proper use of explosives. |
|
#3
|
||||
|
||||
|
yes it's just atypo, I was just trying to give an example. But "movieclip" + i._x works? See I new it was simple. Now do you know a way I can get "i" back out of the name, like movieclip2 and get 2 out of the name?
Thanks |
|
#4
|
||||
|
||||
|
Ok sweetheart, glad I could help, but now I think you you are trying to parse a string, you are going to have to explain what you are doing a little clearer.....
|
|
#5
|
||||
|
||||
|
Well, I'm trying to make this crazy intregate menu. All the buttons are mclips. When you click on one I want it to expand. Hence why I need all the other mclips to move down, opening up space for the submenu's to be listed. Then when you click it again it collapses(I think that's how you spell it). I can get the first one to work right, but I can't get the others to. They just move all of them. I'm sure I can write some long as crazy function, but there's 37 menu options now. And I want to be able to have the option of expanding later down the line. So I need something simple that does it dynamically. Hope this is more clear.
Thanks again, |
|
#6
|
||||
|
||||
|
Stuck again,
When I try and use "menu"+i I get this error. Hope you can help. Scene=Scene 1, Layer=Layer 1, Frame=1: Line 20: Expected a field name after '.' operator. _root."menu"+i._y = _root.this._y - (22.3 * HOWMANY); Thanks, Travis |
|
#7
|
||||
|
||||
|
Set frame with SetProperty
Does anyone know how to set the frame with setProperty? I need to use setProperty because I'm doing ("movie" + i) if I do "movie"+i.gotoAndStop(1) if gives me an error. So I need to use setProperty to set the frame.
Thanks, |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Call instance name from array or variable. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|