Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 20th, 2004, 10:36 PM
absolutemonkey's Avatar
absolutemonkey absolutemonkey is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Boston
Posts: 116 absolutemonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 40 sec
Reputation Power: 5
Send a message via MSN to absolutemonkey Send a message via Yahoo to absolutemonkey
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

Reply With Quote
  #2  
Old February 21st, 2004, 12:21 AM
rynoe's Avatar
rynoe rynoe is offline
_root.troubleMaker
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Location: Florida, USA
Posts: 638 rynoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 8 m 30 sec
Reputation Power: 5
Your for statement has a syntax error (unless it's just a typo) it should be
Code:
for(i=0;i<6;i++){
and I think you need "movieclip" + i._x but I am a little confused at what you are doing, seems pretty complicated!
__________________
No problem is so complex that it cannot be resolved with the proper use of explosives.

Reply With Quote
  #3  
Old February 21st, 2004, 12:25 AM
absolutemonkey's Avatar
absolutemonkey absolutemonkey is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Boston
Posts: 116 absolutemonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 40 sec
Reputation Power: 5
Send a message via MSN to absolutemonkey Send a message via Yahoo to absolutemonkey
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

Reply With Quote
  #4  
Old February 21st, 2004, 02:31 AM
rynoe's Avatar
rynoe rynoe is offline
_root.troubleMaker
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Location: Florida, USA
Posts: 638 rynoe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 8 m 30 sec
Reputation Power: 5
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.....

Reply With Quote
  #5  
Old February 21st, 2004, 03:15 AM
absolutemonkey's Avatar
absolutemonkey absolutemonkey is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Boston
Posts: 116 absolutemonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 40 sec
Reputation Power: 5
Send a message via MSN to absolutemonkey Send a message via Yahoo to absolutemonkey
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,

Reply With Quote
  #6  
Old February 22nd, 2004, 11:13 AM
absolutemonkey's Avatar
absolutemonkey absolutemonkey is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Boston
Posts: 116 absolutemonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 40 sec
Reputation Power: 5
Send a message via MSN to absolutemonkey Send a message via Yahoo to absolutemonkey
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

Reply With Quote
  #7  
Old February 22nd, 2004, 01:09 PM
absolutemonkey's Avatar
absolutemonkey absolutemonkey is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Boston
Posts: 116 absolutemonkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 40 sec
Reputation Power: 5
Send a message via MSN to absolutemonkey Send a message via Yahoo to absolutemonkey
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,

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Call instance name from array or variable.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT