Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Array problem from string to sub AddChild

Participant ,
Feb 07, 2009 Feb 07, 2009
Hello great people.

how can it be that I cant be allowed to do this? I get errors with pladsList array which should attach a jpg to a movieclip from an XML

1. Array with strings, (MovieClips on stage).
2. addChild the loaded JPG.

gets error "value is not a function."
TOPICS
ActionScript
593
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Feb 07, 2009 Feb 07, 2009
code
Translate
LEGEND ,
Feb 07, 2009 Feb 07, 2009
The forum doesn't allow me to type in the right text to show [ i ], it treats that as italics!

Put "this[" before your pladsList addChild line, and "]" before the .addChild part, so that your array element is evaluated.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 08, 2009 Feb 08, 2009
LATEST
I'm going to try again to show what the line should look like, by using the Attach Code button.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 07, 2009 Feb 07, 2009
xmlList.length() needs to be xmlList.length
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 07, 2009 Feb 07, 2009
quote:

Originally posted by: dzedward
xmlList.length() needs to be xmlList.length


xmlList.length() is a function which tracks the length of the array.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 08, 2009 Feb 08, 2009
length() is not a method of the Array class, but length is a property. I had hastily read your code wrong due to the error you specified, since I sometimes mix up Array.length with XML.length() and it spits out the same error. However, why would you store strings in your array to represent the movie clips. Store the actual reference and you wouldn't have a problem.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 07, 2009 Feb 07, 2009
code
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines