|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Cannot use array values inside a function
I am trying to use values in an array within a different function than where the array was created.
I created and am attempting to access the array as _global Is there something special I need to do than I am already doing. PolishEagle Last edited by polisheagle : January 6th, 2004 at 09:49 PM. |
|
#2
|
|||
|
|||
|
Hi, what happens if you create the array outside of both functions?
|
|
#3
|
|||
|
|||
|
actually upon looking at the code again the array is created ouside of a function, but within a conditional loop.
|
|
#4
|
|||
|
|||
|
Hi, I just tried it out. If you move the _global.myarray outside of everything you can definately access it from functions. Try creating it first and then using it...i.e. get it out of the loop
|
|
#5
|
|||
|
|||
|
return?
when I attempt to place a return outside of the nested conditional statement the values are usable, but unfortunately the rest of the conditionals are not executed.
Is there a way to "return" the values without breaking out of loops? |
|
#6
|
|||
|
|||
|
Hi, could you show us some code? Makes it a bit easier than guessing... :¬)
|
|
#7
|
|||
|
|||
|
Different Angle
I tried it from a different angle...
Instead of using an array: Code:
_global.stextBuffer[i][n] = I used a dynamically generated variable name: Code:
this["stextBuffer2_"+((i*10)+n)] = This seemed to be more readily accessable from different parts of my app. PolishEagle |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Cannot use array values inside a function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|