This is a discussion on "array of class" within the Flash & Multimedia Forum section. This forum, and the thread "array of class are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
array of class
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
hello. i'm just an actionscript beginner so sorry for a dumb question...
i'm trying to use an array of my own classes. the class is called hostitel and works well - i have tested it. the array is called hostitelia the definition is this: var hostitelia:Array; hostitelia[1] = new hostitel(hostitel1,10); hostitelia[2] = new hostitel(hostitel2,10); hostitelia[3] = new hostitel(hostitel3,10); . . . so far everything works well - the initial function runs. problem comes here: hostitelia[10].posun(); there's no error message, however, the function posun() won't run if this is a wrong way of defining an array of class, what would be the right way than? thanks! |
|
|
|
#2
|
|||
|
|||
|
Re: array of class
so i found the solution - push
crazy |
|
#3
|
|||
|
|||
|
Re: array of class
ok, back again with a new problem...
i'm using more object of the same class. like this: pris = new prisavka(prisavka1,10); pris2 = new prisavka(prisavka2,10); it has instances like this: public var meno:String; public var poziadavky : Array = new Array(); i can set different names for pris and pris2 but change in the array poziadavky affects both, pris and pris2! why? thx |
|
#4
|
|||
|
|||
|
don't bother, solved... tricky though
class prisavka extends MovieClip{ public var poziadavky : Array; public function prisavka() { poziadavky = new Array(); } } |
|
#5
|
|||
|
|||
|
Re: array of class
Huray! Problem solved! And I didn't even have to do anything....This is good...
Haha....well, glad you figured out your problem..and they're aren't any stupid questions. So feel free to ask any other questions...about flash... |
![]() |
| Tags |
| array, class |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] div class and div id | danny322 | Web Page Design | 1 | Nov 22nd, 2007 12:52 |
| [SOLVED] Web design class | thewebkid | Starting Out | 1 | Oct 27th, 2007 04:32 |
| Div class failing to validate | saracen | Web Page Design | 2 | May 8th, 2007 14:02 |
| Sorting a new array from an existing array | Ozeona | Flash & Multimedia Forum | 2 | Sep 20th, 2005 08:43 |
| array unable to check another array so as to be displayed | Ozeona | Flash & Multimedia Forum | 1 | Aug 5th, 2005 10:26 |