array of class

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.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Apr 8th, 2007, 21:12
New Member
Join Date: Apr 2007
Location: slovakia
Age: 26
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Question array of class

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Apr 8th, 2007, 21:31
New Member
Join Date: Apr 2007
Location: slovakia
Age: 26
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: array of class

so i found the solution - push

crazy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Apr 8th, 2007, 22:20
New Member
Join Date: Apr 2007
Location: slovakia
Age: 26
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Apr 9th, 2007, 10:44
New Member
Join Date: Apr 2007
Location: slovakia
Age: 26
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Re: array of class

don't bother, solved... tricky though

class prisavka extends MovieClip{
public var poziadavky : Array;

public function prisavka() {
poziadavky = new Array();
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Apr 9th, 2007, 13:54
Reputable Member
Join Date: May 2006
Location: NC, USA
Age: 16
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
array, class

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 07:31.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42