Error #1056: Cannot create property 0 on String.
I found similar posts about this but was unable to find my situation.
I have 2 arrays, One is filled out earlier in the program by user inputs in the following format:
VideoArray[0] : nothing
VideoArray[1] : [Object]
VideoArray[1][0]: String (this string is inputed by the user in a text field)
VideoArray[1][1]: String (this string is inputed by the user in a text field)
It then follows the pattern of user inputs:
[2]:Object
[2][0]:string
[2][1]:string
[3]
[3][0]
[3][1]
... repeat for as long as the user inputs data.
I am trying to copy the data into another array using a series of loops since i wont know how many sets of data the user inputs. i dont need the object data in the new array. The new array (InfoArray) will be structured like so:
InfoArray[0]: String
InfoArray[1]: Number
InfoArray[2]: nothing
InfoArray[2][0]: VideoArray[1][0]
InfoArray[2][1]: VideoArray[1][1]
InfoArray[3][0]: VideoArray[2][0]
InfoArray[3][1]: VideoArray[2][1]
.. repeat untill all the data is copied.
I do this with the following:
| ArrayCount = VideoArray.length + QuestionArray.length + 2 | |||||||
| for(var i:int = 0; i<=ArrayCount; i++) | |||||||
| { | |||||||
| if (i == 0) | |||||||
| { | |||||||
| InfoArray=ModuleName; | |||||||
| }else | |||||||
| { | |||||||
| if (i == 1) | |||||||
| { | |||||||
| InfoArray=Number_Of_Videos; | |||||||
| }else | |||||||
| { | |||||||
| if(i <=Number_Of_Videos + 2) | |||||||
| { | |||||||
| InfoArray=[]; | |||||||
| for(var j:int = 0; j<=1; j++) | |||||||
| { | |||||||
| trace("i = "+i); | |||||||
| trace("j = "+j); | |||||||
| trace("VideoArray[i-1] | |||||||
| InfoArray = "Video: "; | |||||||
| Line 272 | InfoArray | ||||||
| } | |||||||
| }else | |||||||
| { |
(not sure why it copied the code like this, I couldnt find an "insert code" button)
When I run it I get my traces and the error:
i = 2
j = 0
VideoArray[i-1]
ReferenceError: Error #1056: Cannot create property 0 on String.
at BWSModuleGenerator_fla::MainTimeline/Compile_Info()[BWSModuleGenerator_fla.MainTimeline::frame1:272]
Ive never gotten this error before, and im not sure whats wrong with my coding.
thanks for any help.
