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 November 24th, 2003, 02:17 PM
kubicon's Avatar
kubicon kubicon is offline
pogremar
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2003
Location: At Work
Posts: 950 kubicon User rank is Corporal (100 - 500 Reputation Level)kubicon User rank is Corporal (100 - 500 Reputation Level)kubicon User rank is Corporal (100 - 500 Reputation Level)kubicon User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 15 h 57 m 55 sec
Reputation Power: 7
array of classes

I wanna make an array of classes and then access those classes through the array.


myArray = ["first","second"];
trace(myArray[0]); // first
theName = "first";
_root.attachMovie("theSymbol",theName, 100);

first.someFunction(); // this works

// I found that You can't do this:
theName.someFunction(); // Here, it thinks that 'theName' is an object; I want to use it's value instead.

// this doesn't work either
myArray[0].someFunction();

how can I make an array of classes u
__________________
Some day I'll create a smart quote to put here.

Reply With Quote
  #2  
Old November 24th, 2003, 02:53 PM
kubicon's Avatar
kubicon kubicon is offline
pogremar
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2003
Location: At Work
Posts: 950 kubicon User rank is Corporal (100 - 500 Reputation Level)kubicon User rank is Corporal (100 - 500 Reputation Level)kubicon User rank is Corporal (100 - 500 Reputation Level)kubicon User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 15 h 57 m 55 sec
Reputation Power: 7
Figured out a way. Don't know if it's the best but here it goes:

someArray = new Array(); // an empty array

for(i=0; i<100; i++){
someArray[i] = new theClassName();

// in other to access the variables of the class we need to use setProperty() so that we can use the variable's value as the name

setProperty(someArray[i], someProperty, 'someValue');
}


my neccessity was to create a class that has the properties of the movieclip class + my own. This doesn't illustrate that, but still I hope that it will be of some use to someone.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > array of classes


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 2 hosted by Hostway
Stay green...Green IT