Array issues

This is a discussion on "Array issues" within the Flash & Multimedia Forum section. This forum, and the thread "Array issues are both part of the Design Your Website category.



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

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 26th, 2004, 15:09
New Member
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Array issues

Im using Flash MX 2004 Pro.

in my HTML i have these two lines:
<param name="Maxnum" value="3" >
<param name="Dirname" value="imagedir/" >

In the actionscript I would like to remove the line that manually sets the array, and replace it with something 'like' this:

Code: Select all
var Maxnum = 3;    // the html does this, but for the sake of arguement
var Dirname = "imagedir/"   // I will include it hear anyway.

for (i=0;i<Maxnum;i++) {

this.pArray[i] = [Dirname + (i +1) + ".jpg]; 

}

thus resulting with the equivilent of :

this.pArray = ["imagedir/1.jpg" , "imagedir/2.jpg" , "imagedir/3.jpg];

nomatter how i try this i cannot set the value of the array correctly. Any ideas ?

  #2 (permalink)  
Old Feb 26th, 2004, 15:20
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
what are you getting? imagedir/.jpg ? imagedir/ ?

just looking at that I can't really see any reason why it shouldn't work
  #3 (permalink)  
Old Feb 26th, 2004, 22:36
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Your code is fine, you just need to declare that pArray is an array object:

pArray = new Array();

before you use it, and your code works fine.

You can check your results with

trace(pArray);

For clarification, you would have been getting "undefined" as the contents of pArray (if you used trace) and not any result at all, which clearly shows that you simply didn't tell flash that pArray was an array.
  #4 (permalink)  
Old Feb 27th, 2004, 08:37
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
trouble with not having to declare variables, and loosely typed languages :-)
Closed Thread

Tags
array, issues

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
Help with array searching womble JavaScript Forum 2 Nov 25th, 2007 01:31
Top 4 array to text box buzcajun Flash & Multimedia Forum 10 Sep 14th, 2006 19:13
Getting an item from an array monfu ASP.NET Forum 0 Mar 29th, 2006 13:17
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 04:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs 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 43